Skip to content

Nav & File operation basics

Navigation basics:

Terminal window
cd /path/to/directory # Change directory
cd .. # Go up one directory
ls # List files
ls -l # List with details
ls -a # List all (including hidden)
pwd # Print working directory

File peration basics:

Terminal window
cp file.txt /destination/ # Copy file
cp -r folder/ /destination/ # Copy directory recursively
mv file.txt newname.txt # Rename/move file
rm file.txt # Delete file (careful!)
rm -rf folder/ # Delete folder (VERY careful!)
mkdir -p path/to/nested/folder # Create nested directories
touch file.txt # Create empty file or update timestamp

Using these commands everyday - while trying my best not to use GUI - has helped me solidify the absolute basics of using the terminal. It’s quite fun :)