Some Useful Bash/Terminal Commands

Some Useful Bash/Terminal Commands

These are the basic commands for navigating directories in a Terminal or Git Bash window

Moving in directories

Change Directory

cd [path/to/desired/directory]

Change to Home Directory

cd ~

Move to One Directory Up

cd ..

View Folders and Files in the Directory

ls

Show the current Directory

pwd

Autocomplete a File Name in the Current Directory

Press tab key once to autocomplete once you have typed a unique portion of a file name.

File Manipulations

Make New File

touch [name of file to create]

Make New Folder

mkdir [name of directory to create]

Delete file

rm [name of file to remove]

Delete folder

rm -r [name of directory to remove]

Copying File

cp [filename1] [filename2]

Move/Rename File

mv [filename1] [filename2]

Mac Only

Open file or folder (Mac only)

open [name of file]

Open all files and folder in current directory (Mac only)

open .

PC Only

Open file or folder (PC only)

explorer [name of file]

Open all files and folder in current directory (PC Only)

explorer .