Solaris tips

Solaris tips


recursively Search keywords


find . -type f -print | xargs grep chaine_a_chercher

Reboot


shutdown -i 6 -g 2 -y "bye"

List the files in current directory sorted by size


ls -l | grep ^- | sort -nr 

Delete blank lines in a file ?


cat sample.txt | grep -v '^$' > new_sample.txt

Display the Disk Usage of file sizes under each directory in currentDirectory ?


du -k * | sort –nr 
or 
du –k . | sort -nr

Set the Display automatically for the current new user ?


export DISPLAY=`eval 'who am i | cut -d"(" -f2 | cut -d")" -f1?`

List some Hot Keys for bash shell ?


Ctrl+l – Clears the Screen. 
Ctrl+r – Does a search in previously given commands in shell.
Ctrl+u - Clears the typing before the hotkey. 
Ctrl+a – Places cursor at the beginning of the command at shell. 
Ctrl+e – Places cursor at the end of the command at shell. 
Ctrl+d – Kills the shell. 
Ctrl+z – Places the currently running process into background.

How do you find out drive statistics ?


iostat -E

Display top ten largest files/directories ?


du -sk * | sort -nr | head

How much space is used for users in kilobytes ?


quot -af

Display Ethernet Address arp table ?


arp -a

Display the no.of active established connections to localhost ?


netstat -a | grep EST 

Display the state of interfaces used for TCP/IP traffice ?


netstat -i

Show the working directory of a process ?


pwdx <pid> 

Display the processes current open files ?


pfiles <pid>

Alternative for top command ?


prstat -a

Leave a Reply




Security Code: