Directory Commands
cd
cd
change directory
cd
With no argument, cd
moves to the user’s home directory. If you are hopelessly lost, you can always type cd
and start over.
cd ../projects/project1
mkdir
mkdir
to create a directory. Works relative to current working directory.
mkdir new_project
or
mkdir new_project
mkdir ~/projects/new_project/src
rmdir
rmdir
to remove an empty directory. Does not affect directories with content.
rmdir ~/projects/new_project/src
rm -rf
rm -rf
to force the removal of a directory and all its contents, including subdirectories.
rm -rf ~/projects/project1/src
cp -r
Directories are copied with the cp -r
command previously discussed.