Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
76 views

UNIX/LINUX Command Reference Sheet: File Commands Process Management

This document provides a summary of common Linux commands organized into categories such as file manipulation, process management, permissions, searching, compression, version control, system information, programming, debugging, general tools, and keyboard shortcuts. It lists commands like ls, cd, cp, grep, tar, chmod, kill, ps, man, gcc, and Ctrl-C and briefly explains what each command is used for.

Uploaded by

smruti_2012
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

UNIX/LINUX Command Reference Sheet: File Commands Process Management

This document provides a summary of common Linux commands organized into categories such as file manipulation, process management, permissions, searching, compression, version control, system information, programming, debugging, general tools, and keyboard shortcuts. It lists commands like ls, cd, cp, grep, tar, chmod, kill, ps, man, gcc, and Ctrl-C and briefly explains what each command is used for.

Uploaded by

smruti_2012
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

!"#$%&#"!$ ()**+,- .

/0/1/,2/ 34//5
678/ ()**+,-9
cat - concatenates anu uisplays files
cat > file - places stanuaiu input into file
cd - change cuiient uiiectoiy
cmp - compaies two files
cp - copies a file oi a uiiectoiy
cut - iemoves columns oi fielus fiom the specifieu
file(s)
diff - uisplays line-by-line uiffeiences between two
text files
head - uisplays the fiist lines of the specifieu file(s)
join - joins two files
jot - piint sequential oi ianuom uata
ln - make haiu oi symbolic links to files
ls -al - foimatteu listing with hiuuen files
ls - uiiectoiy listing
mkdir dir - cieate a uiiectoiy dir
more/less - output the contents of the specifieu
file(s) in pages
mv - iename oi move a file
nl - put line numbeis on a file
od - sequentially copies each file to stanuaiu output,
uisplaying it accoiuing to the specifieu aiguments; foi
example, in hexauecimal (often useful in conjunction
with diff)
paste - meige same lines of seveial files oi
subsequent lines of one file
pr - piouuces a piinteu listing of one oi moie files
suitable foi piinting
pwd - piint cuiient woiking uiiectoiy
rm - iemove the specifieu file(s); using the -rf flag
allows a uiiectoiy to be iemoveu
1

sort - soit, meige oi sequence check text files
split - split a file into pieces
tail - uisplays the last lines of the specifieu file(s)
tail -f file - output the contents of file as it
giows, staiting with the last 1u lines
touch - change file access anu mouification times;
can be useu to cieate a new u-byte (empty) file
tr - tianslate chaiacteis fiom one stiing to anothei
uniq - iepoit oi filtei out iepeateu lines in a file
wc - uisplay a count of lines, woius anu chaiacteis in
a file
33: ; 3/2<1/ 678/ ()=>7,?
scp - copies files between hosts on a netwoik
sftp - an inteiactive file tiansfei piogiam
ssh user@host - connect to host as user
ssh-copy-id user@host - auu youi key to
host foi user to enable a keyeu oi passwoiuless
login


1
Use with extreme caution!
@1)2/99 A+,+?/*/,5
at/batch- execute commanus at a latei time
bg - lists stoppeu oi backgiounu jobs; iesume a
stoppeu job in the backgiounu
cron - clock uaemon that executes commanus at
specifieu uates anu times
crontab - mouifies the usei's ciontab file, which is
useu by cron
fg - biings the specifieu job to foiegiounu
kill pid - kill piocess iu pid
killall proc - kill all piocesses nameu proc
1

nice - invoke a commanu with an alteieu scheuuling
piioiity
ps - uisplay youi cuiiently active piocesses
renice - altei piioiity of iunning piocesses
top - uisplay all iunning piocesses
678/ ; B1)<= @/1*7997),9
chmod octal file - change the peimissions of
file to octal, which can be founu sepaiately foi
usei, gioup, anu woilu by auuing:
- 4 - ieau (r)
- 2 - wiite (w)
- 1 - execute (x)
Examples:
chmod 777 - ieau, wiite, execute foi all
chmod 755 - rwx foi ownei, rx foi gioup anu woilu
Foi moie options, see man chmod.
chgrp - change the gioup-IB of the specifieu files oi
uiiectoiies
groups - show gioup membeiships
3/+1247,?
grep - seaich foi a pattein in the specifieu files
command | grep pattern - seaich foi pattern
in the output of command
find file - finu all instances of file (UNIX)
locate file - finu all instances of file
xargs - constiuct aigument lists anu invoke utility
()*=1/997),
You can finu a numbei of compiession anu
uecompiession utilities. Check the man pages foi tar,
compressuncompress, gzipgunzip anu
zipunzip. 0theis aie also available.

tar cf file.tar files - cieate a tar nameu
file.tar containing files
tar xf file.tar - extiact the files fiom
file.tar
gzip file - compiesses file anu ienames it to
file.gz
gunzip file.gz - uecompiesses file.gz back
to file


!"#$%&#"!$ ()**+,- ./0/1/,2/ 34//5
C/197), (),51)8
See the manual pages foi cvs, svn oi rcs.
3>95/* #,0)1*+57),
absolute - (CSCFNFCF only) conveit file names to
absolute path names
absolute `which app` - (CSCFNFCF only)
show the full path to the app that will be iun by
uefault
cal - show this month's calenuai
chfn - change the usei's finger infoimation
date - show the cuiient uate anu time
diskquota - (CSCFNFCF only) uisplay the usei's
uisk quota
du - show uisk usage of each file , iecuisively
finger user - uisplay infoimation about user
history - uisplays the list of iecently enteieu
commanus
hostselect - consult a configuiation file to ietuin
an optimal host name baseu upon the specifieu
attiibute
lpr - submit a piint iequest
lpq - uisplay the contents of a piint queue
man command - show the manual foi command
mesg - peimit oi ueny messages
passwd - change the usei's passwoiu
ruptime - show cuiient uptime of othei hosts
uname -a - show keinel infoimation
uptime - show cuiient uptime
w - uisplay who is online
whereis app - show possible locations of app
which app - show which app will be iun by uefault
whoami - who you aie loggeu in as
()*=78+57), ; D/E<??7,?
ddd - giaphical fiont enu to gdb
gcc - uN0 pioject C anu C++ compilei
g++ - fiont-enu to gcc to explicitly compile C++ coue
gdb - uN0 uebuggei
gmake - uN0 veision of make
make - utility to maintain gioups of piogiams
xxgdb - giaphical fiont enu to gdb; exists on cpu-
linux
B/,/1+88> !9/0<8 F))89
MFCF FAQ - locateu at
http://webtest.mfcf.uwaterloo.ca/wiki/index.php/
MFCF_FAQ
http://www.cs.uwaterloo.ca/cscf/student/hosts -
a list of the seiveis available in the unueigiauuate
enviionment, highlighting the iounu-iobin seivei
names (iecommenueu foi access to a paiticulai seivei
type)
.snapshot - (CSCFNFCF only) A backup system is
in place in the student.math anu student.cs
enviionments wheie houily, uaily, weekly anu
monthly backups aie maue. See
http://webtest.mfcf.uwaterloo.ca/wiki/index.php/
Snapshots
alias - cieate a pseuuonym foi a commanu oi
seiies of commanus
apropos - locate commanus by keywoiu lookup
clear - cleai the teiminal scieen, if possible
dos2unix - conveit text file fiom B0S foimat to IS0
foimat
init_home - (CSCFNFCF only) ieinitialize youi
home uiiectoiy
ispell - inteiactive spelling checking
lock - lock a teiminal when you aie away
man ascii - uisplays the map of the ASCII
chaiactei set
oed - look things up in the 0xfoiu English Bictionaiy
script - makes a typesciipt of eveiything piinteu
on youi teiminal.
scriptfix - clean up sciipt output files
spell - outputs woius fiom the nameu uocuments
that aie not in the spelling list noi ueiivable fiom
woius in the spelling list
unalias - iemove a pseuuonym foi a commanu oi
seiies of commanus
unix2dos - conveit text file fiom IS0 foimat to
B0S foimat
xlock - locks the local X uisplay until a passwoiu is
enteieu
34)152<59
Ctrl+C - halts the cuiient commanu
Ctrl+Z - stops the cuiient commanu, iesume with
fg in the foiegiounu oi bg in the backgiounu
Ctrl+D - log out of cuiient session, similai to
exit; useu to signal enu-of-file when iunning an
application that ieaus fiom stanuaiu input
Ctrl+W - eiases one woiu in the cuiient line
Ctrl+U - eiases the whole line
Ctrl+R - type to biing up a iecent commanu
^pre1^pre2 - iepeats the last commanu with
leauing text pre1 ieplaceu with pre2
!:gs/pre1/pre2- iepeats the last commanu with
all occuiiences of text pre1 ieplaceu with pre2
!! - iepeats the last commanu
!com - iepeats the most iecent commanu enteieu that
can be uniquely iuentifieu as staiting with com
!num - iepeats the commanu numbeieu num
exit - log out of cuiient session

You might also like