Linux
BasicCommands
[Link]
shashi@[Link]
BasicLinuxCommands
FileHandling
TextProcessing
SystemAdministration
ProcessManagement
Archival
Network
FileSystems
AdvancedCommands
Sourcestolearncommands??
Primaryman(manual)pages.
man<command>showsallinformationaboutthe
command
<command>helpshowstheavailableoptions
forthatcommand
SecondaryBooksandInternet
FileHandlingcommands
mkdirmakedirectories
Usage:mkdir[OPTION]DIRECTORY...
[Link]
lslistdirectorycontents
Usage:ls[OPTION]...[FILE]...
[Link],lsl,lsprabhat
cdchangesdirectories
Usage:cd[DIRECTORY]
[Link]
FileHandling(contd...)
pwdprintnameofcurrentworkingdirectory
Usage:pwd
vimViImproved,aprogrammerstexteditor
Usage:vim[OPTION][file]...
[Link]
FileHandling(contd...)
cpcopyfilesanddirectories
Usage:cp[OPTION]...SOURCEDEST
[Link].txtsample_copy.txt
cpsample_copy.txttarget_dir
mvmove(rename)files
Usage:mv[OPTION]...SOURCEDEST
[Link].txttarget_dir
[Link]
FileHandling(contd...)
rmremovefilesordirectories
Usage:rm[OPTION]...FILE...
[Link],rmrfsome_dir
findsearchforfilesinadirectoryhierarchy
Usage:find[OPTION][path][pattern]
[Link],[Link]
historyprintsrecentlyusedcommands
Usage:history
Pattern
A Pattern is an expression that describes a set of
strings which is used to give a concise description
of a set, without having to list all elements.
eg. ab*cd matches anything that starts with ab and
ends with cd etc.
ls *.txt prints all text files
TextProcessing
catconcatenatefilesandprintonthestandardoutput
Usage:cat[OPTION][FILE]...
[Link]
[Link]
echodisplayalineoftext
Usage:echo[OPTION][string]...
[Link]
echo$HOME
TextProcessing(contd...)
grepprintlinesmatchingapattern
Usage:grep[OPTION]PATTERN[FILE]...
[Link]
wcprintthenumberofnewlines,words,andbytesinfiles
Usage:wc[OPTION]...[FILE]...
[Link]
[Link]
TextProcessing(contd...)
sortsortlinesoftextfiles
Usage:sort[OPTION]...[FILE]...
[Link]
[Link]
LinuxFilePermissions
3typesoffilepermissionsread,write,execute
10bitformatfrom'lsl'command
12345678910
filetypeownergroupothers
[Link],
grouphasreadandwrite,othershaveonlyread
permission
readpermission4,write2,execute1
[Link]=764
673=rwrwxwx
SystemAdministration
chmodchangefileaccesspermissions
Usage:chmod[OPTION][MODE][FILE]
[Link]
chownchangefileownerandgroup
Usage:chown[OPTION]...OWNER[:[GROUP]]FILE...
[Link]
SystemAdministration(contd...)
suchangeuserIDorbecomesuperuser
Usage:su[OPTION][LOGIN]
[Link],su
passwdupdateausersauthenticationtokens(s)
Usage:passwd[OPTION]
[Link]
whoshowwhoisloggedon
Usage:who[OPTION]
[Link],whob,whoq
ProcessManagement
psreportasnapshotofthecurrentprocesses
Usage:ps[OPTION]
[Link],psel
killtokillaprocess(usingsignalmechanism)
Usage:kill[OPTION]pid
eg.kill92275
Archival
tartoarchiveafile
Usage:tar[OPTION]DESTSOURCE
[Link]/home/[Link]/home/original
tarxvf/home/[Link]
zippackageandcompress(archive)files
Usage:zip[OPTION]DESTSOURSE
[Link]
unziplist,testandextractcompressedfilesinaZIParchive
Usage:unzipfilename
[Link]
Network
sshSSHclient(remoteloginprogram)
sshisaprogramforloggingintoaremotemachineandfor
executingcommandsonaremotemachine
Usage:ssh[options][user]@hostname
[Link]@[Link]
scpsecurecopy(remotefilecopyprogram)
scpcopiesfilesbetweenhostsonanetwork
Usage:scp[options][[user]@host1:file1][[user]@host2:file2]
[Link]@[Link]:~/Desktop/
FileSystems
fdiskpartitionmanipulator
[Link]
mountmountafilesystem
Usage:mountttypedevicedir
[Link]/dev/sda5/media/target
umountunmountfilesystems
Usage:umount[OPTIONS]dir|device...
[Link]/media/target
FileSystems(contd...)
duestimatefilespaceusage
Usage:du[OPTION]...[FILE]...
[Link]
dfreportfilesystemdiskspaceusage
Usage:df[OPTION]...[FILE]...
[Link]
quotadisplaydiskusageandlimits
Usage:quota[OPTION]
[Link]
AdvancedCommands
rebootrebootthesystem
Usage:reboot[OPTION]
[Link]
poweroffpoweroffthesystem
Usage:poweroff[OPTION]
[Link]
Suggested Material
TheUNIXProgrammingEnvironment
byKernighanandPike(PrenticeHall)
YourUNIX:TheUltimateGuide
bySumitabhaDas
ThankYou
Editorcommands
kateKDEAdvancedTextEditor
Usage:kate[options][file(s)]
[Link]
vimViImproved,aprogrammerstexteditor
Usage:vim[OPTION][file]...
[Link].c
[Link].
Usage:gedit[OPTION][FILE]...
[Link]
ProcessManagement(contd...)
bgmakeaforegroundprocesstoruninbackground
Usage:type'ctrl+z'andthen'bg<jobid>'
fgtomakebackgroundprocessasforegroundprocess
Usage:fg[jobid]
jobsdisplaysthenamesandidsofbackgroundjobs
Usage:jobs
AdvancedCommands(contd...)
sedstreameditorforfilteringandtransformingtext
Usage:sed[OPTION][inputfile]...
[Link]'s/love/hate/g'[Link]
awkpatternscanningandprocessinglanguage
[Link]:'{print$1}'sample_awk.txt
findsearchforfilesinadirectoryhierarchy
Usage:find[OPTION][path][pattern]
[Link]
locatefindorlocateafile
Usage:locate[OPTION]...FILE...
[Link]