Skip to main content

Posts

Showing posts with the label unix

A Few Unix/Linux Tips

Some Basic Linux And Unix Commands Common Unix Commands [vi/vim] Save on Exit Copy/Paste the block of text in vi/vim How to get CPU utilization for Unix OS?

How to get CPU utilization for Unix OS?

You may use top and ps commands. Display the process utilizing the most cpu and quits to sh:  top -b -n -1 Display CPU Utilization:  sar -u And use ps to display processes with the highest CPU utilization:  ps -eo pid,pcpu,args | sort +1n Read man pages of each of the above commands to get more details and supported options.

[vi/vim] Save on Exit

I see a lot of people using 'wq' a lot but never a form 'x'. In vi and vim, if you want to save and exit with a simple key stroke simply use: :x

Some Basic Linux And Unix Commands

cat - Lets you view the contents of a file. Many linux commands can use the redirection symbol > to redirect the output of the command. For example, use the redirection symbol with the cat command to copy a file: cat /etc/shells > newfile ( the contents of the shells file are written to newfile ). cd - Changes the directory. chmod - This command changes the attributes assigned to a file. clear - Clears the screen. This command is useful when the screen has become cluttered with commands and data that you no longer need to view. cp - Used to copy a file. date - Entered alone, this command displays the current system date settings. Entered in the format date , this command sete the system date. echo - Displays information on the screen. fdisk - Creates or makes changes to a hard drive partition table. grep - Searches for a specific pattern in a file or in multiple files. hostname - Displays a server's FQDN. ifconfig - Used to troubleshoot problems with network connec...