Friday, July 27, 2007

Unix for Apps DBA

Below are the commands which I use frequently.

To monitor CPU activity mpstat -P ALL 5
Display number of CPU in solaris psrinfo -r
Identify all held RAM memory segment. ipcs -pmp

Genral commands.

sort Sort entries in a order
sort -u Remove duplicate entries

/dev/null Dummy dir -- this command used to redirect junk output.

uname -a To display server name.

hostname

nslookup - host ip

netstate -a | grep find if port is in use.

head
tail

which to find location of the executable

find

grep

file

awk , awk -F

sed -> sed/oldstring/newstring > new file loaction

basename

env Show env variable names.

.sh_history File to keep command history

always use rm -i

set alias=<...>

cut

truss command to know what is happning with process.

truss -a show argument passed to the exec system call

truss -p hook to an existing process

truss - spacify a program name

uniq - elimenate or count duplicate lines in a pre sorted file (this command used in combination with sort)

strings

No comments: