0% found this document useful (0 votes)
33 views

Unix Commands

This document contains a list of Linux commands and their descriptions. Some of the commands listed include cd, chown, chmod, cp, crontab, date, df, du, find, gzip, hostname, kill, ls, lsof, mkdir, mv, netstat, pwd, rm, scp, ssh, sudo, tar, telnet, top and traceroute.
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Unix Commands

This document contains a list of Linux commands and their descriptions. Some of the commands listed include cd, chown, chmod, cp, crontab, date, df, du, find, gzip, hostname, kill, ls, lsof, mkdir, mv, netstat, pwd, rm, scp, ssh, sudo, tar, telnet, top and traceroute.
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 4

cd --------------------------------------------goto home dir

cd - --------------------------------------------goto last visited dir


cd .. -------------------------------------------goto previous /one step
back
cd ~---------------------------------------------goto home dir
clear--------------------------------------------clear screen
chown owner filenames----------------------------to change
ownership
chown owner:group filename-----------------------to change file
owner and group
chmod 777 filename-------------------------------to change
permission------------ugo-user group other---r=4 w=2 x=1 -R-for folders
cp -p filename /locati0n/---------------copy file-withsame time
(details)
crontab -e---------------------------------------crontab/cronjob edit
crontab -l---------------------------------------crontab/cronjob list
cksum filename-----------------------------------this give a unique no
to file . this is use to verfify file copied to other location.
date---------------------------------------------to get date time
df -k h ------------------------------------------disk partion h in human
readable
df -k . -----------------------------------------disk free in current
location
du (du -sh *) ------------------------------disk used(list all directry
disk utilisied in current dir)
du -sh * ----------------------------------------show file size in this
location.
du -sk * --------------------------------------- to find which file using
how much of file space
find . -type f -name "*.gz" -mtime +30 -exec ls -l {} \;----------to
search file old than 30 days

gzip -9 filename---------------------------------high level compresion


gzip -1 filename---------------------------------fast compresion
gzip file----------------------------------------gzip a dir------it will
replace
gunzip fils.gz-----------------------------------to ungzip
hostname-----------------------------------------servername
hostname name------------------------------------to change server
name
history -n---------------------------------------list n no of previous
commands ran
history------------------------------------------list all previous
commands ran
id-----------------------------------------------id group with ids(uid gid
groups ){uid=0(root) gid=0(root) groups=0(root),1(bin
kill -9 process id ------------------------------kill process
kill -3 process id-------------------------------thread dump: give line
stack of thread info
ls -R--------------------------------------------list file in each directory
recursively.
ls -ld-------------------------------------------list only directories
lsof | grep Bbarsrr | wc -l----------------------give count of no of
files opened.
ls -l----------------------ls -l for linux
mkdir dirname --------------------------------make dirctory
mv oldfilename newfilename-----------------------rename a file
nslookup servername------------------------------server details ip
name dns
netstat -s -P tcp--------------------------------tcp parameters
netstat ip---------------------------------------it will constatly update
new connections
nslookup servername------------------------------ip servername
pwd----------------------------------------------present working
directory
prtconf | grep Mem-------------------------------ram of serevr
rmdir dirname -------------------------------remove dirctory
rm file name -----------------------------remove file
rm -rfi -----------------------------------------r>remove recursively
f>forcefully i>it will ask yes/no
scp id@servername:/location/filename . ---------to copy files
from other to this box .
scp filename id@servvername:location-------------scp file

sftp id @serverip--------------------------------sftp
ssh servername/ip--------------------------------login to server with
current user
ssh 1d@servern ----------------------------------login to server with
id
ssh -l id servername-----------------------------login to server with
id
sudo su - -------------------------------------switch to root id
sudo -l------------------------------------------displays the list of sudo
access given to ur id
su - user id-------------------------------------switch user
service httpd restart----------------------------to restart httpd
service
top----------------------------------------------cpu utilization details
tar -tvf file.tar -------------------------------list the files inside tar
file.--to see the contents of the file without untarring its
tar -cvf file.tar file---------------------------tar a directory --it will
create new
tar -xvf file.tar--------------------------------untar tar file Tape
archive
tar -zcvf file.tar.gz ffolder--------------------tar gzip
tar -zxvf file.tar.gz ---------------------------untar gun zip
tar -tvf file.tar--------------------------------test of untar .what
happen when untared
tar -czf 17642.tgz /opt/JAS/firemon.log.txt------tar& gzip file
tar -A-------------------------------------------to append to existing tar
file
traceroute 198.132.39.177------------------------to chk connection
telnet ip 23-------------------------------------to login to server
telnet hostname port-----------------------------to test port on
hostname
du -sk * | sort -rn | more
a
uuencode filename filename | mailx gkrishno@in. Ibm.com
/usr/ucb/ps -auxxww | grep -i "SGD71-A-1"
find . -xdev -depth -size +10000 -exec ls -l {} \;|more

10.54.136.63

/u0100/EIAM/Prod/EIAM-P-Domain/servers/EIAM-P-C1/logs/EIAM-P-C-1.log00001.tar.gz
/u0100/EIAM/Prod/EIAM-P-Domain/logs

You might also like