The cd
command is used to change the current directory.
cd stand for change directory
cd path/of/directory
To move up by one directory you can hit
cd ..
(Source)
The ls
command list all files of a type other than directory, found in the current directory.
ls stand for list segments
ls
The man
command display the online manual pages. You can specify a section as parameter. The section is normally the command, function or file name.
man stand for manual.
man name_of_command
To exit the manual you can hit
q
,:q
,Q
,:Q
orZZ
.
The mkdir
command is used to create a new directory. The directory would be create in the current directory.
mkdir stand for make directories.
mkdir name-of-directory
The rmdir
command is used to remove an empty directory.
rmdir stand for remove directories.
rmdir name-of-directory
We can pass an -p
option. In this case each directory argument will be treated as a single path and will be removed if they are empty.
rmdir -p name/of/directory
The mv
command is used to move a file into a given directory.
mv stand for move.
mv name_of_file name/of/directory/destination/
We can use mv
to simply rename a file without changing file's location. (Thanks to Gary Ash for the tips.)
mv old-file-name new-file-name
On macOS, the open
command is used to open a file or a directory. (Thanks to Ian Kirker for the correction.)
open name-of-file
Nice so far, I have a few things to add:
mv your_folder destination_folder
mv original_name new_name
rm -r directory