Purpose | Command |
know the working directory of any file or directory | pwd present working directory or cd space single dot |
List files and directories | ls |
List files including hidden files and directories | ls space -a |
ClearingScreen | clear |
Change to son Change to son directory From current working directory | cd space sondirectoryname cd /c –> / represents change directory to root directory and from root directory change to c directory cd /c/ravi –> / represents change directory to root directory and from root directory move to c/ravi directory |
Go from current working directory to current working directory | cd . cd space singledot or pwd |
Go to parent directory | cd space .. |
Go to grandparent directory | cd space ../.. |
Directly go to your home directory from any directory | cd or cd space ~ |
Create single directory | mkdir [directoryname] |
create multiple directories | mkdir [directoryname] [anotherdirectoryname] |
create single file | touch filename.fileextension |
create multiple files | touch filename.fileextension Anotherfilename.fileextension |
see what is written on a file without opening it | cat filename.fileextension |
Delete a file | rm filename.fileextension |
Delete multiple files | rm filename.fileextension anotherfilename.fileextension |
Delete a empty Directory | rmdir directoryname |
Delete multiple empty directories | rmdir directoryname anotherdirectoryname |
Copy a File or Directory | cp sourcefilenameordirectorywithpath destinationwithpath |
Move a File or Directory | mv source destination |
Rename a file | mv |