Linux
Linux
Command Line:-
RM:-
to remove files and directories
rm filename (permanently deletes not in recycle bin)
rm -i filename (sends to recycle bin)
rm-rf (deletes directories or delete forcefully)
CP:-
to copy file
cp filename path ex: cp file1 sample/
cp -i (to prevent cp from overwriting existing files)
MV:-
two uses
to move file
mv filename path EX: mv file2 sample/
to rename file
mv filepresentname filenewname
HEAD:-
top lines of a file
head -10 path EX: head -10 /etc/passwd
TAIL:-
down lines of a file
tail -10 path EX: tail -10 /etc/passwd
ls shows list
clear clears terminal
ls -l shows list with details
ls -la a means shows hidden files
CAT:-
to read file
cat filename
to create new file and write in it
cat > newfile.txt
to stop writing and exit
control+c
or
cat > newfile.txt <<stop (to stop writing and exit type stop)
man pages:-
man command/toolname
it is basicaly a manual consists details of the command/toolname
to exit press q
Control operaters:-
multiple commands in single line
semicolon ; :-
echo abc ; echo xyz