Linux Commands
Linux Commands
Linux Commands
->date:- it gives date time with seconds just to see date then {date +%D} for time
{date +%T}, {date +%H:%M} will give time but only hour and minutes.
-> ls-> it gives all the present files and folder in that directory folder might
be in bold or different color.
->ls -lt :- it will show present files and folder with detailed explaination like
last modified time ,size ,read write expand permits.It basically sort files on the
basis of their date and time of modification if we do {ls -ltr} then it sorts in
revers order using above criteria.
==> In all ls -lt or ltr or lh it shows - before r,w,e for files and d before
r,w,h for folder.
->less <filename>:- it is also used to read the file but in last line if we
add{/virat} then it will show all instances where virat is there in that file by
pressing n we can see another instance of that word in that file.By pressing
"shift+g" we can go directly to that last line of that file.
"shift+p" to go to first line. {? virat} it will show instances where virat is
present from that file rest is same .By pressing "q" we get out of that file.
->more <filename>:- it is also used to read a file but it show content pagewise by
pressing arrow keys.
->touch <filename> :-it create a new file in that directory where we are passing
that command.
->rm <filename> :- it removes that file from that directory.
->vi <filename> :- it will create file in that directory and let us to edit it just
after it.by pressint "i: we can write in it .after editing or writting we need to
press esc key then to save that file we need to press "shift+;".then by pressing
"wq" we can come out of that file editor and back to terminal.
->if we give full path from root loc to final then it is called absolute path.if we
give only final folder name or dir with respect to that then it is called relative
path.
-> cp <file> /dest/path:- This is copy command first we give filename which needs
to be copied then final dest where it neds to be copied.
-->"." it means present directory if previous dir have some file to be copied to
this dir then {cp ../<fn> .}.
-> cp <fn> <fn>:- in this content of first file get cpy paste in second file.
->mv <fn> <folder_name>:- it will move or cut-paste fn file from current dir to
folder_name dir.
--> we can rename filename by giving new name on second place of mv command rather
than giving dir.
->cmp fileA fileB:-It checks wheather two files are identical or not.
->diff fileA fileB:-It also checks for difference in two filesit tells the lines
which are different in those two files.
->locate <fn>:- it locates that file from its cache database so first we need to
use update command.
->uptime:- it will give for how many time linux server is working and how many
users are logged in.
-> unzip
File system:-
->