One minute
Basic Terminal Commands
Note: I’ll be using word directory instead of folder .
Why? - because it makes sense and help me remember all the commands
Display files and directories
ls
- display the files and directories in your current directory
ls : list storage
ls -a
- display all the files and directories in your current directory (including the hidden ones)
Creating files and directories
touch newfile.txt
- create a file
newfile.txt
in the current directory
mkdir myfolder
- create a directory
myfolder
in the current directory
mkdir stands for make directory
Moving in the Terminal
cd myfolder
- will change your directory from current directory to
myfolder
cd : change directory
Note: Here myfolder
should exist inside the current directory
Deleting Things
rm myfile.txt
- will remove the file named
myfile.txt
If you tried rm myfolder
where myfolder
is a directory rm
won’t be able to do it
we need -r
flag to remove a directory
rm -r myfolder
- deletes the directory
myfolder
Share: