Terminal Commands Cheat Sheet - scuacmw/Intro_to_C_and_Terminal_Workshop GitHub Wiki
Change directory
Command: cd
What it does: Changes the directory of the command line path.
Example: cd "path/to/directory/"
List directory
Command: ls
What it does: Lists the contents of a directory.
Example: ls "path/to/directory/"
Create a directory
Command: mkdir
What it does: Creates a new directory in a specified path.
Example: mkdir "path/to/new/directory"
Move back a directory
Command: cd ..
What it does: Changes the directory back to its parent directory.
Example: cd ..
Clear the screen
Command: clear
What it does: Clears the screen of all previous commands
Example: clear
Create/edit a file
Command: vim
What it does: Creates a new file to edit and access
Example: vim lab1.c
Vim commands
To edit: type 'i'
To escape insertion mode: press esc key
To save and quit: outside insertion mode, type ':wq'
To just quit: outside insertion mode, type ':q'
Run a C program
gcc lab1.c // this creates an executable file
./a.out // this runs the executable file, aka your code