- Command to find on which Operating System your machine is running in Unix.
- “uname” -a
- Command to find which process is taking how much CPU.
- top command
- top [options]The options are:
-b : Starts top command in batch mode. Useful for sending top output to other programs or file.
-d : specify the delay time between the screen updates.
-n : Number of iterations, the top should produce before ending.
-u : Monitor only the specified user processes.
-p : Monitor only the specified processes. Specify the process ID
- Command to check how much space is left in current server.
- “df” command
- For example “df -h .” will list how full your current drive is
- df displays the amount of disk space available on the file system containing each file name argument. If no file name is given, the space available on all currently mounted file systems is shown. Disk space is shown in 1K blocks by default, unless the environment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.
- Command to check if a particular process is listening on a particular port on remote host.
- “telnet” command
- Example “telnet hostname port”, if it able to successfully connect then some process is listening on that port.
- Command to find whether your system is 32 bit or 64 bit.
- Either by using “uname -a” command or by using “arch” command.
- Command to know how many days your system is up.
- “uptime” command.
- Command to know which remote hosts are connecting to your host on a particular port say 80723.
- “netstat” command
execute netstat -a | grep “port” and it will list the entire host which is connected to this host on port 80723
- “netstat” command
- Command to know if port is used or free.
- netstat -an | grep :8282
- what is the command used to run the process in backgroud ?
&
to log the out of that process
nohup ./anyservice.sh
- what is the use of zip command?
this is used to ‘zip’ the directories or folder.
- How do you schedule jobs ?
‘crontab’ command
is a scheduler which is used to schedule any job at any time around the year.syntax: crontab -l (listing the scheduler)ex:crontab -e (to edit and modify any changes in the scheduler
- If i want to change the permission . what is the command i need to use?
Chmod a+rwx filename
- If i want to copy a file what is the command i need to use?
cp fie1 file2
- If you want to search a file from a folder what is the command i need to use?
ls dirname/filename
- If you want to read last 200 line from a file what is the command i need to use?
tail -200f filename
- If you want to edit a file How can you do it ?
vi <<filename>>
- How do you check an Application name “checkSum” is up and running ?
ps -ef | grep “checkSum”
- How do you stop the running process ?
first you need to get the PID by using ps -ef | grep “checkSum” then use
kill PID
kill -9 PID
- How do you check the virtual memory statistics of your CPU ?
vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.