SlideShare a Scribd company logo
If there is any issue at setup or connection contact support@k21technologies.com
Overview of Unix
Activity Guide 1
[Edition 1]
[Last Update 130815]
For any issues/help contact : support@k21technologies.com
If there is any issue at setup or connection contact support@k21technologies.com
Sno Topics
1 IntroductiontoUnix,History,Versions,Features.FileSystems
2 LoggingIn,Password,CreatingFilesandDir.Removingfilesanddir.
3 Additional commands (uname,mv,date,,lsoptions,finger,who,cal.
Copyingusing(absolute,relative)method,
Wild characters, redirection(?, *,[] ),(stdin, stdout, stderr)
4 Fileaccesspermissionschmod(absolute,symbolic),umask.Simplefilters(more,less,wc,sort,
cut,paste,tr)
5 Editors-vi(advance)-3modes-escape,insert,colon
6 Searchingfilesusingfindcommandbyusingvariousoptions,communicationstools-using
write,talk, mail, wall commands
7 Advancefilters(grep,sed,awk)
8 Linkingfilesusinghardlinkandshortlink,processscheduling-backgroundprocess,killing
process
If there is any issue at setup or
connection contact
support@k21technologies.com
CompaniesthatlaunchedMULTICS
If there is any issue at setup or connection contact
support@k21technologies.com
IBM Mainframe Computers
If there is any
issue at setup or
connection
contact
support@k21tec
hnologies.com
KenThompson
If there is any
issue at setup or
connection
contact
support@k21tec
hnologies.com
Linus Torvolds
If there is any issue at setup or
connection contact
support@k21technologies.com
General Operating SystemDiagram
If there is any issue at
setup or connection
contact
support@k21technolo
gies.com
FileSystemofUnix
If there is any issue at setup or connection contact
support@k21technologies.com
Directory Structure & its contents
OrdinaryFiles
If there is any issue at setup or connection contact support@k21technologies.com
Devi ces
Directories
Links
If there is any issue at setup or connection contact support@k21technologies.com
Basic Commands
Creating,Removing,Copying,Moving files& directories
Creatinga file inLinux
Usingcat command:
 Cat (concatenate) commandisusedtocreate a file andto displayandmodifythe contents
of a file.
 To create a file.
#cat > filename(sayktfile)
HelloWorld
Ctrl+d (to save the file)
 To Displaythe contentof the file
#cat filename (sayktfile)
 To append (edit)thedatainthe alreadyexistingfile
#cat >> <filename>
#cat >> ktfile
Ctrl+d (tosave the changes)
If there is any issue at setup or connection contact support@k21technologies.com
Creatingmultiplefilesatsame time usingtouchcommand andto checkthe fileswith“ls”command
#touch <filename1><filename><filename>
Creatinga Directory
#mkdir<dir name>
Making multipledirectoriesinside adirectory
Checkit byusingtree command or ls –R command
If there is any issue at setup or connection contact support@k21technologies.com
CopyingfilesintoDirectory
#cp <source filename><destinationdirectoryinwhichtopaste the file>
#cp file1ktdir
If there is any issue at setup or connection contact support@k21technologies.com
Copyingdirectoriesfromone locationtoother
#cp –rvfp<dir name><destinationname>
Movingfilesfromone locationtoother(cutand Paste)
#mv <filename><Destinationdirectory>
MovingDirectoryfromone locationto other
#mv <filename><Destinationdirname>
#mv ktdirktdir2
RenamingaFile
If there is any issue at setup or connection contact support@k21technologies.com
#mv <oldname> <newname>
RenamingaDirectory
The procedure andcommand forrenamingthe directoryisexactlysame asrenamingafile.
#mv <oldname><newname>
#mv ktdirkerneldir
RemovingaFile
#rm filename or#rm –f filename(withoutprompting)
If there is any issue at setup or connection contact support@k21technologies.com
RemovinganEmptyDirectory
#rmdir dirname
Removingadirectorywithfilesordirectoriesinside:
A di wichis havingsome contentsinsideitcannotbe removedbyrmdir command.There are two
waysto delete the direcotywithcontents.
Remove the contentsinsidethe directoryandthenrunrmdircommand
#rmdir –rf dirname( where rstandsforrecursive andf stands forforcefully).
If there is any issue at setup or connection contact support@k21technologies.com
VIMEDITOR
VIVisual Displayeditor
VIMVisual Displayeditorimproved
Thisis commandmode editorforfiles.OthereditorsinLinux are emacs,gedit.Vi editorismost
popularithas 3 modes(1 CommandMode,2 InsertMode,3 extendedcommandmode)
Note:whenyouopenthe vimeditor,itwill be inthe commandmode bydefault.
In the commandmode the cursor’scan be usedas h/l/k/j tomove cursorleft/right/up/down
Insert mode
i To begininsertmode atthe cursor position
I To insertat the beginningof line
a To appendto the nextword’sletter
A To appendat the endof the line
o To inserta newline belowthe cursorposition
O To inserta newline above the cursorposition
Command Mode
gg To go to the beginningof the page
If there is any issue at setup or connection contact support@k21technologies.com
G To go to the endof the page
w To move the cursor forward,wordby word
b To move the cursor backward,wordby word
nw To move the cursor forwardto n words(5W)
nb To move the cusor backwardto n words(5B)
u To undolast change (word)
U To undothe previouschanges(entire line)
Ctrl+R To redothe changes
Yy To copy a line
Nyy To copy n lines(5yyor4yy)
p To paste line belowthe cursorposition
P To paste line above the cursorposition
dw To delete the wordletterbyletter(like Backspace)
x To delete the worldletterbyletter(like DEL Key)
dd To delete the entire line
ndd To delete nno.Of linesfromcursor position(5dd)
/ To search a wordin the file
ExtendedMode:(ColonMode)
ExtendedMode isusedforsave and quitor save withoutquitusing“Esc” keywith“:”
Esc+:w To Save the changes
Esc+:q To quit(Withoutsaving)
Esc+:wq To save and quit
Esc+:w! To save forcefully
Esc+wq! To save and quitforcefully
Esc+:x To save and quit
Esc+:X To give passwordtothe file andremove password
Esc+:20(n) To go to line no.20 or n
Esc+: se nu To setthe line numberstothe file
Esc+:se nonu To Remove the setline numbers
To openmultiple filesinvimeditor
#vim–o file1file2
To Switchbetweenfilesuse Ctrl+w
ListingfilesandDirectories
If there is any issue at setup or connection contact support@k21technologies.com
#ls List the file names
#ls –l Long listof the file
#ls –l filename To see the permissionsof aparticularfile
#ls –al Showsthe filesinascendingorderof modification.
#ls p* All the filesstartwithp.
#ls ?ample Fileswithanyfirstcharacterand has ample
#ls –ldl* Directorylistingonly
#ls –lddirectoryname To see the permissionsof aparticulardirectory
#ls [ae]* Firstcharacter of the filename mustbe aor e.
#ls [!ae]* ! Symbol complementsthe conditionthatfollows.The charactersmust
not be a or e.
Typesof Files
Symbol Type of File
- Normal file
d Directory
l Linkfile (shortcut)
b Blockfile (Harddisk,Floppydisk)
c Character file (Keyboard,Mouse)
P A namedpipedfile isusedforinterprocesscommunication
S Its isa socketfile usedforinterprocesscommunication
D A doorfile .it isa special file forinterprocesscommunication (sunsolaris)
SymbolicLink
There are twotypesof Links:-
S.No. SoftLink Hard Link
1 Size of linkfile isequal tono.Of characters inthe name
of the original file.
Size of bothfile issame
2 Can be createdacross the partition Can’tbe createdacross the
partition.
3 inode no.Of source and linkfile isdifferent inode no.Of both file issame
4 If original file isdeleted,linkisbrokenanddataislost If original file isdeletedthen
alsolinkwill containdata
5 SHORCUT FILE BACKUPFILE
If there is any issue at setup or connection contact support@k21technologies.com
Creatinga softlink:
#ln -s<source file><destination>
CreatingHard Link
#ln <source file><Destination>
Grep:
Grep standsfor Global RegularExpression Print.It isusedto pickout the requiredexpressionfrom
the file andprintthe output.If grep iscombinedwithanothercommanditcan be usedto pickout
the selectedword,phrase fromthe outputof the firstcommandand printit.
Examplesof Grep
Let uspick the informationaboutrootfromthe file /etc/passwd(/etc/passwdconatainsinformation
aboutall the userspresentinthe system)
#grep root/etc/passwd
If there is any issue at setup or connection contact support@k21technologies.com
To avoidcase sensitivityof the word(i.e the wordmaybe uppercase of lowercase) use -i
#grep -i IT ktfile (letsgrepthe word IT whetherupperof lowercase inthe file ktfile)
To displayaword and 2 linesafterthe word
To displayaword and 2 linesafterthe word
To displaythe things exceptthe givenword
To displaythe searchedwordincolor
If there is any issue at setup or connection contact support@k21technologies.com
Combininggrepwithothercommands
FilterCommands:
filtercommandsare usedtofilterthe outputsothat the requiredthingscaneasilybe pickedup.The
commandswhichare used to filterthe outputare
 #less
 #more
 #head
 #tail
 #sort
 #cut
 #sed
If there is any issue at setup or connection contact support@k21technologies.com
less:- The lesscommand is usedto see the output line wise or page wise.
Note:-
pressEnterkeyto scroll downline byline (or)
Use d to go to nextpage
Use b to go to previouspage
use / to searchfor a wordin the file
Use v to go vi mode where youcan editthe file andonce yousave it youwill backto lesscommand
more: more isexactlysame like less
If there is any issue at setup or connection contact support@k21technologies.com
Ex: #more /etc/passwd
Note:-
pressEnter keyto scroll downline byline (or)
use d to go to nextpage
use / to searchfor a wordin the file
Use v to go vi mode where youcan editthe file andonce yousave ityou will backtomore command
head: it is usedto displaythe top 10 linesof the file.
ex:# head/etc/passwd
To display the custom lines
#head -n /etc/passwd (where n can be any number)
tail: It is usedto displaythe last 10 linesofthe file
#tail /etc/passwd
If there is any issue at setup or connection contact support@k21technologies.com
To display the custom lines
#tail -n /etc/passwd(where n can be any number)
sort: It is usedto sort the output in numeric or alphabeticorder
#sort filename
If there is any issue at setup or connection contact support@k21technologies.com
To sort the file accordingto numbers
#sort -dktfile
To remove the duplicate entriesfrom the output
#sort -uktfile
If there is any issue at setup or connection contact support@k21technologies.com
cut command:
The cut commandisusedto pick the givenexpression(incolumns) anddisplaythe output.
#cut -d -f filename(where dstandsfordelimiterex.:," "etcand f standsfor field)
If there is any issue at setup or connection contact support@k21technologies.com
To delimitspacesandprintthe field
#cut -d "" -f1 filename
To delimitcommasandprintthe field
#cut -d, f1 filename
sedcommand
sedstands forstreameditor,whichisusedtosearch a word inthe file andreplace itwiththe word
requiredtobe inthe output.
Note:- itwill onlymodifythe output,butthere will be nochange inthe original file.
sed's/searchfor/replacewith/g' filename
Redirection:Redirectionisaprocesswhere we cancopy the outputof anycommand(s),file(s) intoa
newfile.There are twowaysof redirectingthe outputintoafile.
Using> or >> filename afterthe command,and usingtee command
Note:if the givenname of the file isnotavilable anew file will be createdautomatically.If the file
alreadyexiststhenitwill overwrite contentsof thatfile.
If there is any issue at setup or connection contact support@k21technologies.com
Appendinganotheroutputinsame the same file
Likewise thereare manyoptionswhere we canuse redirections
Ex: copyingcontentsof twofilesinanew file
#cat file1file2>file3
Usingtee
The above optionsof redirectionswill notdisplayanyoutput,butdirectlysave the outputinafile.
usingtee commandwill notonlyredirectthe outputtonew file butitwill alsodisplaythe output.
Syntax:cat <filename>|tee <newfile name>
Note:If the givenof the file (newfile)isnotavailable anew file will be createdautomatically.If the
file alreadyexiststhenitwill overwrite contentsof the file.
#cat ktfile |tee ktf1
If there is any issue at setup or connection contact support@k21technologies.com
Appendingdatainthe same file usingtee command
Syntax: cat filname | tee -a filename2
#cat ktfile1| tee -a ktf1
FindCommand
findcommandis usedto findthe filesordirectory'spath, itisexactlylike the findoptioninwindows
where youcan searchfor a file.
Syntax: find / (underroot) - option filename
optionsthatcan be usedwithfindcommand:
Option Usage
-name For searchinga file withitsname
-inum For searchinga file withparticularinodenumber
-type For searchinga particulartype of file.
-user For fileswhose owner
-group For filesbelongingtoparticulargroup
If there is any issue at setup or connection contact support@k21technologies.com
Findingafile withname
#find/ -name test
#find/ -num5934
Findingthe files,whose ownerisausercalled"abc"
Findingthe fileswhose groupis"abc"
If there is any issue at setup or connection contact support@k21technologies.com
File Permissions
Permissionsare appliedonthree levels:-
 Owneror User level
 Group level
 Otherslevel
Accessmodesare of three types:-
 r readonly
 w write/edit/delete/append
 x execute/runacommand
Accessmodesare differentonfile anddirectory.
PERMISSIONS FILES DIRECTORY
r Openthe file 'ls' the contentsof dir
w Write,edit,append,deletefile Add/Del/Renamecontentsof
dir
x To run a command/shell script To enterintodirusing'cd'
r : For normal or directoryfile - viewthe contents
w: Editthe contentsof a normal or directoryfile
If there is any issue at setup or connection contact support@k21technologies.com
x: Runan executable file /Enterintodirectoryfile
Permissionscanbe seton any file/dirbytwomethods:-
1. Symbolicmethod (ugo)
2. Absolute method(numbers)
SymbolicMethod
Symbolicmode:General formof symbolicmode is
#chmod [who] [+/-/=] [permissions] file
who> to whomthe permissionstobe assigned
user/owner(u);group(g);others(o)
Example:- Assigndifferrentpermissionstothe file (user=rwx,group=rw andothers=r)
#chmod u=rwx,g=rw,o=r ktfile(where ktfileisthe name of the file)
If there is any issue at setup or connection contact support@k21technologies.com
Assigningfullpermissiontothe file i.e rwx toall
#chmod ugo=rwx <file name>
likewise youcanaddor remove permissionsfromanyfile foranyone(usergrouporother)
 #chmod u+x ktfile (addingexecutepermissionstouseronly)
 #chmod go-wx ktfile(Removingwrite andexecutepermissionsfromgroupandother)
 #chmod go+wx ktfile (Addingwriteandexecute permissionsfromgroupandother)
 #chmod go=r ktfile (Givingonlyreadpermissiontogroupandother)
ABSOLUTE METHOD(NUMBERS)
In Absolute methodwe use numbersinsteadof usingsymbolsi.e
 Read = 4
 Write = 2
 Execute = 1
Assigningdifferentpermissionstothe file (user=rwx,group=rw andothers=r)
#chmod 764 ktfile (where 7 means rwx i.e 4+2+1, rw=6 i.e 4+2 and 1 indicatesx)
If there is any issue at setup or connection contact support@k21technologies.com
Assigningfullpermissionstothe file i.e rwx toall
#chmod 777 ktfile
likewise youcangive differentpermissionsaccordingtoyour requirement
Removingall permissionsfromothers
#chmod 770 ktfile (where 0 indicatesno permissions)
Note:All the above permissionsandprocedure issame forfilesanddirectories
Umask
Whenwe create any file usingtouch,cator vi commandstheygetcreatedwithdefaultfile
permissionsasstoredinumask(userfilecreationmask).umaskisa4 digitoctal numberwhichtells
unix whichof the three permissionsare tobe deniedratherthangranted.Umask will decidethat
whatshouldbe the defaultpermissionsforafile anddirectorywhenitiscreated.
the defaultumask value is 0022
If there is any issue at setup or connection contact support@k21technologies.com
calculationof defaultpermissionsforfile anddirectory,basinguponthe umaskvalue
Note:For a file bydefaultitcannothave the execute permissions,sothe maximumfull permission
for a file atthe time of creationcan be 666 (i.e 777 -111 = 666), whereasadirectorycan have full
permissionsi.e777
The full permissionsforthe file 666
Minusthe umaskvalue -022
The defaultpermissionforfile is 644 (rw-,r--,r--)
The full permissionsforthe directory 777
Minusthe umaskvalue -022
The defaultpermissionforfile is 755 (rwx,r-x,r-x)
#umask002
The modifieddefaultpermissionforafile will be 666-002=664 i.e.rw,rw,r,andforthe directoryit
will be 777-002=775 i.e.rwx,rwx,r-x
If there is any issue at setup or connection contact support@k21technologies.com
Note:Create a file anda directoryandcheckfor the defaultpermissions.
These were the fewthings amongst the basics; keepworkingto furnishyour basics. After all,if the
foundationis good thenonly the buildingcan stand still"
=============End of the Activity 1 Guide========

More Related Content

What's hot

58518522 study-aix
58518522 study-aix58518522 study-aix
58518522 study-aix
homeworkping3
 
Operating system lab manual
Operating system lab manualOperating system lab manual
Operating system lab manual
Meerut Institute of Technology
 
Bozorgmeh os lab
Bozorgmeh os labBozorgmeh os lab
Bozorgmeh os lab
FS Karimi
 
Basic unix commands_1
Basic unix commands_1Basic unix commands_1
Basic unix commands_1
thakor bharati
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unixsouthees
 
Devops for beginners
Devops for beginnersDevops for beginners
Devops for beginners
Vivek Parihar
 
Linux final exam
Linux final examLinux final exam
Linux final exam
Andrew Ibrahim
 
Windows command prompt a to z
Windows command prompt a to zWindows command prompt a to z
Windows command prompt a to zSubuh Kurniawan
 
Basic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manualBasic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manual
Kuntal Bhowmick
 
UNIX Command Cheat Sheets
UNIX Command Cheat SheetsUNIX Command Cheat Sheets
UNIX Command Cheat Sheets
Prashanth Kumar
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
Rajesh Kumar
 
Piping into-php
Piping into-phpPiping into-php
Piping into-php
Shaun Morrow
 
Lecture1 2 intro-unix
Lecture1 2 intro-unixLecture1 2 intro-unix
Lecture1 2 intro-unixnghoanganh
 
Tool Development 08 - Windows Command Prompt
Tool Development 08 - Windows Command PromptTool Development 08 - Windows Command Prompt
Tool Development 08 - Windows Command Prompt
Nick Pruehs
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirectsAcácio Oliveira
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
Nomura Japanese Investment Bank
 
011300 Intro To Dos
011300 Intro To Dos011300 Intro To Dos
011300 Intro To DosCTIN
 
Os lab manual
Os lab manualOs lab manual
Os lab manual
Neelamani Samal
 
Unix short
Unix shortUnix short

What's hot (20)

58518522 study-aix
58518522 study-aix58518522 study-aix
58518522 study-aix
 
Operating system lab manual
Operating system lab manualOperating system lab manual
Operating system lab manual
 
Bozorgmeh os lab
Bozorgmeh os labBozorgmeh os lab
Bozorgmeh os lab
 
Basic unix commands_1
Basic unix commands_1Basic unix commands_1
Basic unix commands_1
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Devops for beginners
Devops for beginnersDevops for beginners
Devops for beginners
 
Linux final exam
Linux final examLinux final exam
Linux final exam
 
Windows command prompt a to z
Windows command prompt a to zWindows command prompt a to z
Windows command prompt a to z
 
Basic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manualBasic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manual
 
UNIX Command Cheat Sheets
UNIX Command Cheat SheetsUNIX Command Cheat Sheets
UNIX Command Cheat Sheets
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Piping into-php
Piping into-phpPiping into-php
Piping into-php
 
Lecture1 2 intro-unix
Lecture1 2 intro-unixLecture1 2 intro-unix
Lecture1 2 intro-unix
 
Tool Development 08 - Windows Command Prompt
Tool Development 08 - Windows Command PromptTool Development 08 - Windows Command Prompt
Tool Development 08 - Windows Command Prompt
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
 
011300 Intro To Dos
011300 Intro To Dos011300 Intro To Dos
011300 Intro To Dos
 
Os lab manual
Os lab manualOs lab manual
Os lab manual
 
Unix short
Unix shortUnix short
Unix short
 

Viewers also liked

Configuring vnc server in linux
Configuring vnc server  in linux Configuring vnc server  in linux
Configuring vnc server in linux
Mohammed Yazdani
 
Administering Remote System in Linux
Administering Remote System in Linux Administering Remote System in Linux
Administering Remote System in Linux
Mohammed Yazdani
 
Installing webmin on linux
Installing webmin on linux Installing webmin on linux
Installing webmin on linux
Mohammed Yazdani
 
Colloque international (hs+pb) 14.10.14 (final version)
Colloque international (hs+pb) 14.10.14 (final version)Colloque international (hs+pb) 14.10.14 (final version)
Colloque international (hs+pb) 14.10.14 (final version)
University of Winchester (UK)
 
Installation of Oracle Linux 5.4 32 bit on vmware
Installation of Oracle Linux 5.4 32 bit on vmware Installation of Oracle Linux 5.4 32 bit on vmware
Installation of Oracle Linux 5.4 32 bit on vmware
Mohammed Yazdani
 
Latihan powerpoint2 001
Latihan powerpoint2 001Latihan powerpoint2 001
Latihan powerpoint2 001
suleunindra
 
Solaris 10 installation on vmware
Solaris 10 installation on vmware Solaris 10 installation on vmware
Solaris 10 installation on vmware
Mohammed Yazdani
 
Backup and restore in linux
Backup and restore in linux Backup and restore in linux
Backup and restore in linux
Mohammed Yazdani
 
Histoire secteur hotelier en Haiti
Histoire  secteur hotelier en HaitiHistoire  secteur hotelier en Haiti
Histoire secteur hotelier en Haiti
University of Winchester (UK)
 
L'enseignement du tourisme en France et au Royaume-Uni: Histoire, comparaison...
L'enseignement du tourisme en France et au Royaume-Uni: Histoire, comparaison...L'enseignement du tourisme en France et au Royaume-Uni: Histoire, comparaison...
L'enseignement du tourisme en France et au Royaume-Uni: Histoire, comparaison...
University of Winchester (UK)
 
User and group administration in Linux
User and group administration in LinuxUser and group administration in Linux
User and group administration in Linux
Mohammed Yazdani
 
Network configuration in Linux
Network configuration in LinuxNetwork configuration in Linux
Network configuration in Linux
Mohammed Yazdani
 

Viewers also liked (14)

Configuring vnc server in linux
Configuring vnc server  in linux Configuring vnc server  in linux
Configuring vnc server in linux
 
Administering Remote System in Linux
Administering Remote System in Linux Administering Remote System in Linux
Administering Remote System in Linux
 
Installing webmin on linux
Installing webmin on linux Installing webmin on linux
Installing webmin on linux
 
Colloque international (hs+pb) 14.10.14 (final version)
Colloque international (hs+pb) 14.10.14 (final version)Colloque international (hs+pb) 14.10.14 (final version)
Colloque international (hs+pb) 14.10.14 (final version)
 
Installation of Oracle Linux 5.4 32 bit on vmware
Installation of Oracle Linux 5.4 32 bit on vmware Installation of Oracle Linux 5.4 32 bit on vmware
Installation of Oracle Linux 5.4 32 bit on vmware
 
Latihan powerpoint2 001
Latihan powerpoint2 001Latihan powerpoint2 001
Latihan powerpoint2 001
 
Solaris 10 installation on vmware
Solaris 10 installation on vmware Solaris 10 installation on vmware
Solaris 10 installation on vmware
 
SHORT VITA 20140630
SHORT VITA 20140630SHORT VITA 20140630
SHORT VITA 20140630
 
Backup and restore in linux
Backup and restore in linux Backup and restore in linux
Backup and restore in linux
 
Histoire secteur hotelier en Haiti
Histoire  secteur hotelier en HaitiHistoire  secteur hotelier en Haiti
Histoire secteur hotelier en Haiti
 
L'enseignement du tourisme en France et au Royaume-Uni: Histoire, comparaison...
L'enseignement du tourisme en France et au Royaume-Uni: Histoire, comparaison...L'enseignement du tourisme en France et au Royaume-Uni: Histoire, comparaison...
L'enseignement du tourisme en France et au Royaume-Uni: Histoire, comparaison...
 
User and group administration in Linux
User and group administration in LinuxUser and group administration in Linux
User and group administration in Linux
 
Network configuration in Linux
Network configuration in LinuxNetwork configuration in Linux
Network configuration in Linux
 
Resume of Aashish
Resume of AashishResume of Aashish
Resume of Aashish
 

Similar to Overview on Linux

Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
Leandro Lima
 
Linux Command.pptx
Linux Command.pptxLinux Command.pptx
Linux Command.pptx
SaileshB5
 
Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling
Ahmed El-Arabawy
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja
Ranjan Raja
 
Group13
Group13Group13
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
PrashantTechment
 
Linux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITLinux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScIT
vignesh0009
 
File Commands - R.D.Sivakumar
File Commands - R.D.SivakumarFile Commands - R.D.Sivakumar
File Commands - R.D.Sivakumar
Sivakumar R D .
 
Basic basic solaris quick referent card
Basic basic solaris quick referent cardBasic basic solaris quick referent card
Basic basic solaris quick referent cardBui Van Cuong
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
Fu Haiping
 
5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variablesGautam Raja
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
GiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
GiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
GiovaRossi
 
Presentation aix basic
Presentation   aix basicPresentation   aix basic
Presentation aix basic
xKinAnx
 
Foss manual (1)
Foss manual (1)Foss manual (1)
Foss manual (1)
Janagi Raman S
 
Handling Files Under Unix.pptx
Handling Files Under Unix.pptxHandling Files Under Unix.pptx
Handling Files Under Unix.pptx
Harsha Patel
 
Handling Files Under Unix.pptx
Handling Files Under Unix.pptxHandling Files Under Unix.pptx
Handling Files Under Unix.pptx
Harsha Patel
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
Acácio Oliveira
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
Acácio Oliveira
 

Similar to Overview on Linux (20)

Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
 
Linux Command.pptx
Linux Command.pptxLinux Command.pptx
Linux Command.pptx
 
Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja
 
Group13
Group13Group13
Group13
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
Linux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITLinux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScIT
 
File Commands - R.D.Sivakumar
File Commands - R.D.SivakumarFile Commands - R.D.Sivakumar
File Commands - R.D.Sivakumar
 
Basic basic solaris quick referent card
Basic basic solaris quick referent cardBasic basic solaris quick referent card
Basic basic solaris quick referent card
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
Presentation aix basic
Presentation   aix basicPresentation   aix basic
Presentation aix basic
 
Foss manual (1)
Foss manual (1)Foss manual (1)
Foss manual (1)
 
Handling Files Under Unix.pptx
Handling Files Under Unix.pptxHandling Files Under Unix.pptx
Handling Files Under Unix.pptx
 
Handling Files Under Unix.pptx
Handling Files Under Unix.pptxHandling Files Under Unix.pptx
Handling Files Under Unix.pptx
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 

Recently uploaded

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 

Recently uploaded (20)

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 

Overview on Linux

  • 1. If there is any issue at setup or connection contact support@k21technologies.com Overview of Unix Activity Guide 1 [Edition 1] [Last Update 130815] For any issues/help contact : support@k21technologies.com
  • 2. If there is any issue at setup or connection contact support@k21technologies.com Sno Topics 1 IntroductiontoUnix,History,Versions,Features.FileSystems 2 LoggingIn,Password,CreatingFilesandDir.Removingfilesanddir. 3 Additional commands (uname,mv,date,,lsoptions,finger,who,cal. Copyingusing(absolute,relative)method, Wild characters, redirection(?, *,[] ),(stdin, stdout, stderr) 4 Fileaccesspermissionschmod(absolute,symbolic),umask.Simplefilters(more,less,wc,sort, cut,paste,tr) 5 Editors-vi(advance)-3modes-escape,insert,colon 6 Searchingfilesusingfindcommandbyusingvariousoptions,communicationstools-using write,talk, mail, wall commands 7 Advancefilters(grep,sed,awk) 8 Linkingfilesusinghardlinkandshortlink,processscheduling-backgroundprocess,killing process
  • 3. If there is any issue at setup or connection contact support@k21technologies.com CompaniesthatlaunchedMULTICS
  • 4. If there is any issue at setup or connection contact support@k21technologies.com IBM Mainframe Computers
  • 5. If there is any issue at setup or connection contact support@k21tec hnologies.com KenThompson
  • 6. If there is any issue at setup or connection contact support@k21tec hnologies.com Linus Torvolds
  • 7.
  • 8.
  • 9. If there is any issue at setup or connection contact support@k21technologies.com General Operating SystemDiagram
  • 10.
  • 11.
  • 12. If there is any issue at setup or connection contact support@k21technolo gies.com FileSystemofUnix
  • 13. If there is any issue at setup or connection contact support@k21technologies.com Directory Structure & its contents OrdinaryFiles
  • 14. If there is any issue at setup or connection contact support@k21technologies.com Devi ces Directories Links
  • 15. If there is any issue at setup or connection contact support@k21technologies.com Basic Commands Creating,Removing,Copying,Moving files& directories Creatinga file inLinux Usingcat command:  Cat (concatenate) commandisusedtocreate a file andto displayandmodifythe contents of a file.  To create a file. #cat > filename(sayktfile) HelloWorld Ctrl+d (to save the file)  To Displaythe contentof the file #cat filename (sayktfile)  To append (edit)thedatainthe alreadyexistingfile #cat >> <filename> #cat >> ktfile Ctrl+d (tosave the changes)
  • 16. If there is any issue at setup or connection contact support@k21technologies.com Creatingmultiplefilesatsame time usingtouchcommand andto checkthe fileswith“ls”command #touch <filename1><filename><filename> Creatinga Directory #mkdir<dir name> Making multipledirectoriesinside adirectory Checkit byusingtree command or ls –R command
  • 17. If there is any issue at setup or connection contact support@k21technologies.com CopyingfilesintoDirectory #cp <source filename><destinationdirectoryinwhichtopaste the file> #cp file1ktdir
  • 18. If there is any issue at setup or connection contact support@k21technologies.com Copyingdirectoriesfromone locationtoother #cp –rvfp<dir name><destinationname> Movingfilesfromone locationtoother(cutand Paste) #mv <filename><Destinationdirectory> MovingDirectoryfromone locationto other #mv <filename><Destinationdirname> #mv ktdirktdir2 RenamingaFile
  • 19. If there is any issue at setup or connection contact support@k21technologies.com #mv <oldname> <newname> RenamingaDirectory The procedure andcommand forrenamingthe directoryisexactlysame asrenamingafile. #mv <oldname><newname> #mv ktdirkerneldir RemovingaFile #rm filename or#rm –f filename(withoutprompting)
  • 20. If there is any issue at setup or connection contact support@k21technologies.com RemovinganEmptyDirectory #rmdir dirname Removingadirectorywithfilesordirectoriesinside: A di wichis havingsome contentsinsideitcannotbe removedbyrmdir command.There are two waysto delete the direcotywithcontents. Remove the contentsinsidethe directoryandthenrunrmdircommand #rmdir –rf dirname( where rstandsforrecursive andf stands forforcefully).
  • 21. If there is any issue at setup or connection contact support@k21technologies.com VIMEDITOR VIVisual Displayeditor VIMVisual Displayeditorimproved Thisis commandmode editorforfiles.OthereditorsinLinux are emacs,gedit.Vi editorismost popularithas 3 modes(1 CommandMode,2 InsertMode,3 extendedcommandmode) Note:whenyouopenthe vimeditor,itwill be inthe commandmode bydefault. In the commandmode the cursor’scan be usedas h/l/k/j tomove cursorleft/right/up/down Insert mode i To begininsertmode atthe cursor position I To insertat the beginningof line a To appendto the nextword’sletter A To appendat the endof the line o To inserta newline belowthe cursorposition O To inserta newline above the cursorposition Command Mode gg To go to the beginningof the page
  • 22. If there is any issue at setup or connection contact support@k21technologies.com G To go to the endof the page w To move the cursor forward,wordby word b To move the cursor backward,wordby word nw To move the cursor forwardto n words(5W) nb To move the cusor backwardto n words(5B) u To undolast change (word) U To undothe previouschanges(entire line) Ctrl+R To redothe changes Yy To copy a line Nyy To copy n lines(5yyor4yy) p To paste line belowthe cursorposition P To paste line above the cursorposition dw To delete the wordletterbyletter(like Backspace) x To delete the worldletterbyletter(like DEL Key) dd To delete the entire line ndd To delete nno.Of linesfromcursor position(5dd) / To search a wordin the file ExtendedMode:(ColonMode) ExtendedMode isusedforsave and quitor save withoutquitusing“Esc” keywith“:” Esc+:w To Save the changes Esc+:q To quit(Withoutsaving) Esc+:wq To save and quit Esc+:w! To save forcefully Esc+wq! To save and quitforcefully Esc+:x To save and quit Esc+:X To give passwordtothe file andremove password Esc+:20(n) To go to line no.20 or n Esc+: se nu To setthe line numberstothe file Esc+:se nonu To Remove the setline numbers To openmultiple filesinvimeditor #vim–o file1file2 To Switchbetweenfilesuse Ctrl+w ListingfilesandDirectories
  • 23. If there is any issue at setup or connection contact support@k21technologies.com #ls List the file names #ls –l Long listof the file #ls –l filename To see the permissionsof aparticularfile #ls –al Showsthe filesinascendingorderof modification. #ls p* All the filesstartwithp. #ls ?ample Fileswithanyfirstcharacterand has ample #ls –ldl* Directorylistingonly #ls –lddirectoryname To see the permissionsof aparticulardirectory #ls [ae]* Firstcharacter of the filename mustbe aor e. #ls [!ae]* ! Symbol complementsthe conditionthatfollows.The charactersmust not be a or e. Typesof Files Symbol Type of File - Normal file d Directory l Linkfile (shortcut) b Blockfile (Harddisk,Floppydisk) c Character file (Keyboard,Mouse) P A namedpipedfile isusedforinterprocesscommunication S Its isa socketfile usedforinterprocesscommunication D A doorfile .it isa special file forinterprocesscommunication (sunsolaris) SymbolicLink There are twotypesof Links:- S.No. SoftLink Hard Link 1 Size of linkfile isequal tono.Of characters inthe name of the original file. Size of bothfile issame 2 Can be createdacross the partition Can’tbe createdacross the partition. 3 inode no.Of source and linkfile isdifferent inode no.Of both file issame 4 If original file isdeleted,linkisbrokenanddataislost If original file isdeletedthen alsolinkwill containdata 5 SHORCUT FILE BACKUPFILE
  • 24. If there is any issue at setup or connection contact support@k21technologies.com Creatinga softlink: #ln -s<source file><destination> CreatingHard Link #ln <source file><Destination> Grep: Grep standsfor Global RegularExpression Print.It isusedto pickout the requiredexpressionfrom the file andprintthe output.If grep iscombinedwithanothercommanditcan be usedto pickout the selectedword,phrase fromthe outputof the firstcommandand printit. Examplesof Grep Let uspick the informationaboutrootfromthe file /etc/passwd(/etc/passwdconatainsinformation aboutall the userspresentinthe system) #grep root/etc/passwd
  • 25. If there is any issue at setup or connection contact support@k21technologies.com To avoidcase sensitivityof the word(i.e the wordmaybe uppercase of lowercase) use -i #grep -i IT ktfile (letsgrepthe word IT whetherupperof lowercase inthe file ktfile) To displayaword and 2 linesafterthe word To displayaword and 2 linesafterthe word To displaythe things exceptthe givenword To displaythe searchedwordincolor
  • 26. If there is any issue at setup or connection contact support@k21technologies.com Combininggrepwithothercommands FilterCommands: filtercommandsare usedtofilterthe outputsothat the requiredthingscaneasilybe pickedup.The commandswhichare used to filterthe outputare  #less  #more  #head  #tail  #sort  #cut  #sed
  • 27. If there is any issue at setup or connection contact support@k21technologies.com less:- The lesscommand is usedto see the output line wise or page wise. Note:- pressEnterkeyto scroll downline byline (or) Use d to go to nextpage Use b to go to previouspage use / to searchfor a wordin the file Use v to go vi mode where youcan editthe file andonce yousave it youwill backto lesscommand more: more isexactlysame like less
  • 28. If there is any issue at setup or connection contact support@k21technologies.com Ex: #more /etc/passwd Note:- pressEnter keyto scroll downline byline (or) use d to go to nextpage use / to searchfor a wordin the file Use v to go vi mode where youcan editthe file andonce yousave ityou will backtomore command head: it is usedto displaythe top 10 linesof the file. ex:# head/etc/passwd To display the custom lines #head -n /etc/passwd (where n can be any number) tail: It is usedto displaythe last 10 linesofthe file #tail /etc/passwd
  • 29. If there is any issue at setup or connection contact support@k21technologies.com To display the custom lines #tail -n /etc/passwd(where n can be any number) sort: It is usedto sort the output in numeric or alphabeticorder #sort filename
  • 30. If there is any issue at setup or connection contact support@k21technologies.com To sort the file accordingto numbers #sort -dktfile To remove the duplicate entriesfrom the output #sort -uktfile
  • 31. If there is any issue at setup or connection contact support@k21technologies.com cut command: The cut commandisusedto pick the givenexpression(incolumns) anddisplaythe output. #cut -d -f filename(where dstandsfordelimiterex.:," "etcand f standsfor field)
  • 32. If there is any issue at setup or connection contact support@k21technologies.com To delimitspacesandprintthe field #cut -d "" -f1 filename To delimitcommasandprintthe field #cut -d, f1 filename sedcommand sedstands forstreameditor,whichisusedtosearch a word inthe file andreplace itwiththe word requiredtobe inthe output. Note:- itwill onlymodifythe output,butthere will be nochange inthe original file. sed's/searchfor/replacewith/g' filename Redirection:Redirectionisaprocesswhere we cancopy the outputof anycommand(s),file(s) intoa newfile.There are twowaysof redirectingthe outputintoafile. Using> or >> filename afterthe command,and usingtee command Note:if the givenname of the file isnotavilable anew file will be createdautomatically.If the file alreadyexiststhenitwill overwrite contentsof thatfile.
  • 33. If there is any issue at setup or connection contact support@k21technologies.com Appendinganotheroutputinsame the same file Likewise thereare manyoptionswhere we canuse redirections Ex: copyingcontentsof twofilesinanew file #cat file1file2>file3 Usingtee The above optionsof redirectionswill notdisplayanyoutput,butdirectlysave the outputinafile. usingtee commandwill notonlyredirectthe outputtonew file butitwill alsodisplaythe output. Syntax:cat <filename>|tee <newfile name> Note:If the givenof the file (newfile)isnotavailable anew file will be createdautomatically.If the file alreadyexiststhenitwill overwrite contentsof the file. #cat ktfile |tee ktf1
  • 34. If there is any issue at setup or connection contact support@k21technologies.com Appendingdatainthe same file usingtee command Syntax: cat filname | tee -a filename2 #cat ktfile1| tee -a ktf1 FindCommand findcommandis usedto findthe filesordirectory'spath, itisexactlylike the findoptioninwindows where youcan searchfor a file. Syntax: find / (underroot) - option filename optionsthatcan be usedwithfindcommand: Option Usage -name For searchinga file withitsname -inum For searchinga file withparticularinodenumber -type For searchinga particulartype of file. -user For fileswhose owner -group For filesbelongingtoparticulargroup
  • 35. If there is any issue at setup or connection contact support@k21technologies.com Findingafile withname #find/ -name test #find/ -num5934 Findingthe files,whose ownerisausercalled"abc" Findingthe fileswhose groupis"abc"
  • 36. If there is any issue at setup or connection contact support@k21technologies.com File Permissions Permissionsare appliedonthree levels:-  Owneror User level  Group level  Otherslevel Accessmodesare of three types:-  r readonly  w write/edit/delete/append  x execute/runacommand Accessmodesare differentonfile anddirectory. PERMISSIONS FILES DIRECTORY r Openthe file 'ls' the contentsof dir w Write,edit,append,deletefile Add/Del/Renamecontentsof dir x To run a command/shell script To enterintodirusing'cd' r : For normal or directoryfile - viewthe contents w: Editthe contentsof a normal or directoryfile
  • 37. If there is any issue at setup or connection contact support@k21technologies.com x: Runan executable file /Enterintodirectoryfile Permissionscanbe seton any file/dirbytwomethods:- 1. Symbolicmethod (ugo) 2. Absolute method(numbers) SymbolicMethod Symbolicmode:General formof symbolicmode is #chmod [who] [+/-/=] [permissions] file who> to whomthe permissionstobe assigned user/owner(u);group(g);others(o) Example:- Assigndifferrentpermissionstothe file (user=rwx,group=rw andothers=r) #chmod u=rwx,g=rw,o=r ktfile(where ktfileisthe name of the file)
  • 38. If there is any issue at setup or connection contact support@k21technologies.com Assigningfullpermissiontothe file i.e rwx toall #chmod ugo=rwx <file name> likewise youcanaddor remove permissionsfromanyfile foranyone(usergrouporother)  #chmod u+x ktfile (addingexecutepermissionstouseronly)  #chmod go-wx ktfile(Removingwrite andexecutepermissionsfromgroupandother)  #chmod go+wx ktfile (Addingwriteandexecute permissionsfromgroupandother)  #chmod go=r ktfile (Givingonlyreadpermissiontogroupandother) ABSOLUTE METHOD(NUMBERS) In Absolute methodwe use numbersinsteadof usingsymbolsi.e  Read = 4  Write = 2  Execute = 1 Assigningdifferentpermissionstothe file (user=rwx,group=rw andothers=r) #chmod 764 ktfile (where 7 means rwx i.e 4+2+1, rw=6 i.e 4+2 and 1 indicatesx)
  • 39. If there is any issue at setup or connection contact support@k21technologies.com Assigningfullpermissionstothe file i.e rwx toall #chmod 777 ktfile likewise youcangive differentpermissionsaccordingtoyour requirement Removingall permissionsfromothers #chmod 770 ktfile (where 0 indicatesno permissions) Note:All the above permissionsandprocedure issame forfilesanddirectories Umask Whenwe create any file usingtouch,cator vi commandstheygetcreatedwithdefaultfile permissionsasstoredinumask(userfilecreationmask).umaskisa4 digitoctal numberwhichtells unix whichof the three permissionsare tobe deniedratherthangranted.Umask will decidethat whatshouldbe the defaultpermissionsforafile anddirectorywhenitiscreated. the defaultumask value is 0022
  • 40. If there is any issue at setup or connection contact support@k21technologies.com calculationof defaultpermissionsforfile anddirectory,basinguponthe umaskvalue Note:For a file bydefaultitcannothave the execute permissions,sothe maximumfull permission for a file atthe time of creationcan be 666 (i.e 777 -111 = 666), whereasadirectorycan have full permissionsi.e777 The full permissionsforthe file 666 Minusthe umaskvalue -022 The defaultpermissionforfile is 644 (rw-,r--,r--) The full permissionsforthe directory 777 Minusthe umaskvalue -022 The defaultpermissionforfile is 755 (rwx,r-x,r-x) #umask002 The modifieddefaultpermissionforafile will be 666-002=664 i.e.rw,rw,r,andforthe directoryit will be 777-002=775 i.e.rwx,rwx,r-x
  • 41. If there is any issue at setup or connection contact support@k21technologies.com Note:Create a file anda directoryandcheckfor the defaultpermissions. These were the fewthings amongst the basics; keepworkingto furnishyour basics. After all,if the foundationis good thenonly the buildingcan stand still" =============End of the Activity 1 Guide========