UNIX Useful Commands
1) How to get memory details in Oracle Sun Solaris
prtdiag | grep -i mem
2) How to get CPU & core details in Oracle Sun Solaris
psrinfo -pv
3) How to get no of core details in Oracle Sun Solaris
kstat cpu_info|grep core_id|sort -u|wc -l
--- OS --------------------------
CPU -> psrinfo -v
Memory -> prtconf | grep "Memory size"
4) Find whether OS is 64/32 Bit Kernel in UNIX.
uname -a
5) Find free physical memory in UNIX.
free -m
6) Find CPU details in UNIX.
cat /proc/cpuinfo
7) Find files modified within specific time.
find . -mtime -3 (modified less than 3days ago)
8) command used to alter file permissions.
chmod 777 abc.txt
9) Command used to reset the Ownership.
chown oracle:dba abc.txt
10) command used to set, or reset, the users login password.
Passwd OSUsername
11) Kill specific process in UNIX.
Kill -9 processid
12) Command used for display last given lines of a file.
tail -n alert_PROD.log
13) Command used for intall a rpm package.
rpm -ivh packagename.rpm
14) Command used to querry about any rpm package
rpm -q packagename
15) Command to Check the server up time
uptime
16) Command to check the file versions
strings -a <filename> |grep ‘$Header’
17) Command will keep ‘n’ number of days files and remove rest of file.
find . -mtime +n -exec rm {} \; &
18) Basic commands for vi editor
i :- insert before cursor.
l : insert begining of the line.
a :- append after the cursor.
A :- Append at the end of the line.
o :- insert a blank line below the cursor.
O :- insert a blank line above the cursor position.
h :- from current position one char towards left .
I :- from current position one char towards right.
j :- from current position one line towards down.
k :- from current position one line towards up.
Shift+g :- go to end of the file.
Shift+:1 :- go to top of the file.
dd –> delete the ful line.
:q! —> closing the file without saving any changes.
:wq! –> save the changes and force close.
:w –> to save the changes without closing the file.
1) How to get memory details in Oracle Sun Solaris
prtdiag | grep -i mem
2) How to get CPU & core details in Oracle Sun Solaris
psrinfo -pv
3) How to get no of core details in Oracle Sun Solaris
kstat cpu_info|grep core_id|sort -u|wc -l
--- OS --------------------------
CPU -> psrinfo -v
Memory -> prtconf | grep "Memory size"
4) Find whether OS is 64/32 Bit Kernel in UNIX.
uname -a
5) Find free physical memory in UNIX.
free -m
6) Find CPU details in UNIX.
cat /proc/cpuinfo
7) Find files modified within specific time.
find . -mtime -3 (modified less than 3days ago)
8) command used to alter file permissions.
chmod 777 abc.txt
9) Command used to reset the Ownership.
chown oracle:dba abc.txt
10) command used to set, or reset, the users login password.
Passwd OSUsername
11) Kill specific process in UNIX.
Kill -9 processid
12) Command used for display last given lines of a file.
tail -n alert_PROD.log
13) Command used for intall a rpm package.
rpm -ivh packagename.rpm
14) Command used to querry about any rpm package
rpm -q packagename
15) Command to Check the server up time
uptime
16) Command to check the file versions
strings -a <filename> |grep ‘$Header’
17) Command will keep ‘n’ number of days files and remove rest of file.
find . -mtime +n -exec rm {} \; &
18) Basic commands for vi editor
i :- insert before cursor.
l : insert begining of the line.
a :- append after the cursor.
A :- Append at the end of the line.
o :- insert a blank line below the cursor.
O :- insert a blank line above the cursor position.
h :- from current position one char towards left .
I :- from current position one char towards right.
j :- from current position one line towards down.
k :- from current position one line towards up.
Shift+g :- go to end of the file.
Shift+:1 :- go to top of the file.
dd –> delete the ful line.
:q! —> closing the file without saving any changes.
:wq! –> save the changes and force close.
:w –> to save the changes without closing the file.
Tags:
UNIX