Linux File Management and Commands Guide
Linux File Management and Commands Guide
Synto
by byte,
cmp-ile1irt fil2hat
file 1 ttf [Link]
Cnp -s
mke (amveend
Ceeoles
ditlotiss
vmkdivlepties
phions
-é' tale povtnt dieclo ries
Jzvecloy-rome
ptioms
-f Fovce move loy duetwri tirg the destiationfile.
withoot poo mpt
multple
is used fo dsplay
tiles,amd
the contets
eediect
of fleSy (omcaten ate
[tile]
SyotaxcatLoptiesas]
Optio
Eile Comtent
DDisplay txt
Cat file name
)lComcatehade
Moltple
Cat fle
files
trt file2
frt . [Link]
txt
o cembind
the output
mey
avchi tectve is deSiy me dina modolo
Umi +hat wovk fogetkrm
SpUptadlayev s
Cons's ing ot
stable amd flerbte.
operatimg
prouide a
to
9stem
means fo
32|| Syste Cal Intov foçe '-pvo Vi des a
wrth te
pacp pv0gyoms to ccnmumcate
useo
koynel
amd peutes
It imtvpves USevico wmmamds
thegm
and teminatom
CT-2
Eis ose d
the file topomoue o
dpletes s'ngle file. If
Mame om d ts
inade etfetmce
Veuse
omaking the f:le eg
aNalehe
Umlink filename
(diskusage) estimates
amd displays fhe amaumt
of disk cpace Used by fles and diecories
eptions
-h Disploy Sizes im a humam Vepa da ble toat
-T Oisp lay the file systeon type.
- D isplay inode in fov matiom instead of blark usogc
divectovies on a
toraye
a cessib le
frice
S)
butput
fone
cem rone
cemnaneke
los
This
Lane the
Com mamd Seguehtes
cempleK
co hinends togelkeve
Lby chanig moltiple
et As to gvep to fifen
Passing Ahc output
iles ca taiminy og
fhe contntot
lem bims ing Catamd sovt tosovt
la file:
cat filename txtsovt
Options!:
-4 Cov- append):Append to fhe g'vem files Yathe
th an ovepwwwt:ng them
t
Betce
Eyamples
Set am du Se a ve yia ble
fools fou
amd job contvol auc essemtiad
Vaviable5, aliase5,
cveating efficient
fhe shell enviv ooment
memagimg tommand eecuTiom
wovkflows amd simpl tying
Brice
2
AnsThe gp Command Umix - ike os is use d fo
Brice
fev fhat
jntovpve
Ars shel 'S a commamd lie he
fo
access 'ng
Peoides
SpoiceS
APIS ove
Pxecote
Syskem
a
ef
u5P ntev face
om
fumda mentals,
Cammomdsy
vesouveS
oppvatingSystev
um
ttlowim
amd
Sevipts
g osevs
monage
to
2
Ans
Types_
Prompt
3)lcshel
Symtax inspiwed by cpueguamm ming
Alas nehanssm fov commamd shovots ,Dob
Contol, Boilf -im ovithonetic expresion.
Prompt %
Seapnl
m
trice
Eramp les E
Witing fhe oulput of fo both the trumieh av
a
file
while puoces5img
cat tienometxt |
tee [Link] lsot
jobs
•g: bq
Bring
Resunme
c backg vound
a stopped
job
job
to the fov cgv oumd
in the backgvound
Example
Command
jobs
f9 ojob-numbe
bg ojob-numbe
kl %job- rUmbey
Brtce
nat fom
e shovoto altet
AliasVs commenes
seis oF
OCemmed o
a
and shofen
oveUsed to simp
Alioses.
esed commands
Hvcguetly
Fxonples
Cvcate an aias foe l -lai
alias ll-ls- la
Re move am alias:H
UMalias namC
potpyt 6f Commamds
Synta
"Set a Vavable
Use a voviable
fail
ota
comamand
frle alimpot
ts used fo disply the emd port
Examples
Di'splay the last to
limes ofaf:le
tail filename, txt
tail h 20f:lename tt
Disploy the Last so tes at a hy file :
tail c so filenamett
tov mew
Continyoslymomitov atile
lianes
ta'l -f filenamctt
Brice
Date
LoptiomS
fs type : specifies the tile syctem type
such os pradonly
peitiesoptions
ptioms
voopad- wv; fe lrw)tc
2 Comwamd
s uscd
Ashead Command the head
fie
to displa the begining
paytof_a
inpot
Examples
Display Ahe fvst lo lines ofaflk
head Tile name txt
Suntar: auplopTION]
Etampk
Disploy Fhe covent ARP ta ble
Swapnil
kumar
Brice
Date
Havdwove
Kevme
Shell
Applleationr
Swagnl
kumar
Brice
cantyols hey
fo
mamayetles
data is
oa that
disko
ergaizediaa Soved
De cteite
stovage dpuce
vent tile
Systems com be used
opevating systam am d
epemdimg om the
thepeificneeis of Fhe ure
applicatiom
fules
2)l Diveetovy diles ; These tiles cen taim nfomalien a bout othen
iMo de MUMb
files and diectovies They map tite mames to
67Haed imk-
symbo
Theye
lc imks, havd
timky
file
annot
mame but
to
tile Unl; ke
ot Aink
to the
amd do
divectoyies
inode
filct
the
Brice
Repeated pmpty es
9)suppocss
Cat -s [Link]
eJocptl mpty lines inte
squeeze [Link]
Thrsiwr
sngle ennpty ie
of a file im Rouey se (wiHh fac
xplay Contemk
tac filema mie .txf
to diwdbrycantent
s Comane i csed list
Lpeemisriemsyoadmbev of inks,ownegvoupie
ond nodticatom dte
32s- a - This lists ell i les iaee incla'ng hid den
fles
epLugsive ly.
15-lf - this sorts the output hy mo litcaton
4ime,mewest fivst.
brtce
vetovy Contonts
scom mamd bsls
ophiows
-a: Jnclude hidden files
optioms
-b Dsp lays fhe time of the lastisystemm boot
H: Printa hpadp ine
mat, dis pkyimg only the useomawes an)
-9 aoic k foy
4he nombev of usevs logged
idle tmes
path
hor tLut thet pemtsto the
tagcf ije C
divecto vy
Lim k
Symbolie Link
Havd
Pvopcuby Dtfevent fron tavyct file
tavyet file
Same as
)Tnode vo
Nombe
file
to the tovget
doaPath
ptevencp to
tle
2 Re ffevemeDiveet
bodarics
fiksystem
Con ceass
only
3 FeLimi
system Same filesystem
ink to diyetovies
diweetooies
an
fo
Canmot ink
4Di wcctovy
lonb
d whe
nk becodbgoken
if
delete
Data is only tavge
t is deleted
Dpletiom bemaed
imkis
last symbyke.
Tmpact
nrs [Link]
[Link]
lnovginalfile
6 Cueatio n
Command
Brice
Sxo
Ameirate 4
output but sehs
the files dHfe
the rast stodus te
tilcs
fo
AsAaw nk Tisasieef vtevente fhce
afo fk on the
hond
filesys ken, Noltiple
dota
Samme fle shave the same imode
IE ks lo th e
Tncle
Pveper fes )Tbate shorin
Dndstm guishable
)Deletie
4)Same Pilesys fem
S)No d'verteries