COMMANDS

Reports the size of each file in the current directory:-
du -s <file-name>.extension

Display the same data, but in a "human-readable" size format, and display a grand total:-

du -shc <file-name>.extension

Shows the amount of disk space used and available on Linux file systems:-
df

du -mh
du -gh
free –m = memory consumed by RAM
df –kh = disk space checking by File System
du –sh <file/folder directory name> = file/folder in size human readable format
cat /proc/cpuinfo = No of CPU usage (or) CPU list or CPU information.
cat /proc/meminfo = Total Memory (or) Used Memory (or) Free Memory
netstat –an | grep <Port No: 7001> = LISTEN/CONNECTED
ifconfig = To check particular server
netstat –an = All server ports will be displayed
ping  google.com = To check HOST is reachable (or) not
telnet <destination> <port no>


nslookup  irctc.co.in = It is used for querying the Domain Name System (DNS) to obtain domain name or IP address mapping information

poweroff = Means shutdown the machine
service network restart = to restart the networking service.
ps -ef | grep java = To Check all java processes running on the server
pwd = present working directory
cd .. = Two steps backward slash
clear =clear the screen
exit = exits the command line or the account
tar xvf httpd-2.4.37.tar 
cd bin = change directory to bin directory
ls
ll
find . -name <file/folder> = find command
cd ../../../ = Two backward slashes
vi magic = vi editor to open magic file
ls -lrt = list files
ls -lart = Hidden files
ls -lrt /apps/
cd ../Desktop/ = One step back and one step forward
cp calendar.war calendarr.war . = copy file to present working directory
cp calendar.war /home/raghu/calendar.war = copy file to home directory
rm calendarr.war = remove command
mv calendarr.war = move command
ifconfig = To check machine ip address
ifconfig -a
hostname = To check host name of the machine
cat /proc/cpuinfo = Cat command is used to see the content in command line
cat /proc/meminfo = Cat command is used to see the content in command line
top = to check top processes running on the server
netstat -an | grep
netstat = Netstat provides information and statistics about protocols in use and current TCP/IP network connections.
netstat -an
netstat -an |
history = will display entered commands up to now

Heap dump:-
kill -3 [PID]

Thread dump:-
To obtain a thread dump using jstack, run the following command:
jstack -l <pid>

You can output consecutive thread dumps to a file by using the console output redirect/append directive:
jstack -l <pid> >> threaddumps.log


CSR file generation:-
->pwd
/home/sv-wl10
$ openssl req -new -newkey rsa:2048 -nodes -keyout  inddlvtwlmas01.srisohan.net.key
-out inddlvtwlmas01.srisohan.net.key
-out inddlvtwlmas01.srisohan.net.csr

Explanation:-
openssl req = certificate request generating utility
-new = generates a new certificate request
-newkey = creates a new certificate request and a new private key
rsa:2048 = generates an RSA key 2048 bits in size
-nodes = if a private key is created it will not be encrypted
-keyout = the filename to write the newly created private key to
-key = specifies the file to read the private key from
-out = specifies the output filename.key
-out = specifies the output filename.csr


pack and unpack Command:-
pwd
/apps/oracle/weblogic10.3.6/weblogic10.3.6/wlserver_10.3/common/bin

1st machine=common/bin path:-
./pack.sh  
-domain=/apps/oracle/weblogic10.3.6/user_projects/domain/raghu_domain
-template=/apps/oracle/domainpacks/raghu_domain.jar
-template_name=remote_managed   -managed=true

./pack.sh:- 
=>command creates a template (a .jar archive file) that contains a snapshot of either an entire WebLogic domain or a subset of a WebLogic domain.

-domain=domain:-
=>The full or relative path for the WebLogic domain from which the template is to be created.

-template=template:-
=>The full or relative path and file name of the template to be created. The template filename must include the .jar extension.
-template_name=remote_managed:-
=>Descriptive name for the template. Quotes are required only if the value contains spaces.

 -managed=true | false:-
=>Specifies whether the template is to be used to create Managed Servers on remote machines. The default is false.When this parameter is set to true, a Managed Server template is created that contains a minimal set of files, including SerializedSystemIni.dat and nm_password.properties. It also includes a domain.properties file that is unique to the Managed Server template.


Go to same path in another machine:-
./unpack.sh 
-domain=/apps/oracle/weblogic1036/user_projects/domain/raghu_domain
-template=/apps/oracle/domainpacks/raghu_domain.jar

./unpack.sh:-
=>unpack command creates a full WebLogic domain or a subset of a domain used for a Managed Server domain directory on a remote machine.
=>unpack only with a template that is compatible with your current installation.
=>When you use the unpack command with a domain template, it creates a WebLogic domain containing all of the application and resource files defined in the template. It also creates necessary start scripts, and certain security and configuration files.

-domain=/domains/raghu_domain = domain path:-
=>The full or relative path of the WebLogic domain to be created.

-template=/apps/oracle/domainpacks/raghu_domain.jar:-
=>The full or relative path and filename of the template from which the WebLogic domain is to be created.

Delete previous log files:-

Delete command

find /path/to/files/ -type f -name '*.jpg' -mtime +30 -exec rm {} \;

Explanation:-

path/to files = where your files are located
* = wildcard
-type = file type
f = stand's for files
-name = limiting *.jpg means ending with all .jpg files OK
-mtime = how many days the files older then will be listed
+30 = files older then 30 days
-exec = executes a command
rm = is the command to remove
{} = gets the file list of all *.jpg files OK
\; = closes the command













No comments:

Post a Comment