Create a directory: mkdir dir
Create nested directories: mkdir -p dir1/dir2
cd .. (parent directory)
cd -(previous directory)
cd (home directory)
cd ~bill (home directory of user bill)
Print the working (current) directory: pwd
Copy a file to another: cp source_file dest_file
Copy files to a directory: cp file1 file2 dir
Copy directories recursively:
cp -r source_dir dest_dir
rsync -a source_dir/ dest_dir/
Create a symbolic link: ln -s linked_file link
Rename a file, link or directory: mv source_file dest_file
Remove files or links: rm file1 file2
Remove empty directories: rmdir dir
Remove non-empty directories: rm -rf dir
Most Popular Articles
List all “regular” files (not starting with .) in the current directory:lsDisplay a long...
Concatenate and display file contents:cat file1 file2Display the contents of several files...
Concatenate all “regular” files: cat *Concatenate all “hidden” files: cat .*Concatenate all files...
Show only the lines in a file containing a given substring: grep substring fileCase insensitive...
Add write permissions to the current user:chmod u+w fileAdd read permissions to users in the file...