1. Commands for navigating directories
ls
is the command for listing files in a directoryls -a
will display all files including hidden files within a directoryls -al
will display all files + hidden files and their permissionspwd
Abbrv. for Print Working Directory - it will output the aboslute path of directory you're incd /home/kvis
is the command for changing directory to/home/kvis
- Typing
cd
alone, will go to the user's home folder cd ..
will move a level up like a back buttoncd -
will return to the previous directory you were incp file_to_copy.txt new_file.txt
will copyfile_to_copy.txt
and make a new file with the same contents in the same directory callednew_file.txt
. First argument is always the source and the second argument is always the destinationcp -r dir_to_copy/ new_copy_dir/
is used to copy entire directories. You must use the-r
flag (recursive flag) in order to copy a dir and everything within itrm file_to_copy.txt
will delete the filerm -r dir_to_remove/
will delete an empty directoryrm -rf dir_with_content_to_remove/
will delete a directory and the data within it as well! BE CAREFUL with this commandmkdir images/
will create an empty directory calledimages
mkdir -p movies/2004/
will createmovies
directory along with an unlimited amount subdirectories beneath it.touch new_file.txt
will create a new empty file callednew_file
For More Useful Commands, visit this page
No Comments