Bash Commands
In the table below command arguments are described as <arg-info>
, key presses are described by [key]
and key combinations are described by [key-1]+[key-2]
Command | Name | Description |
man
|
Manual |
show the manual entry for the specified command - once the manual entry opens, press q to quit- to navigate use up-arrow /down-arrow and page-up /page-down |
ls
|
List |
lists directory contents - use ls -l for a list with file properties- use ls -a to show hidden files- use ls -orth for a time-sorted list with the most recent filesat the bottom of the list and clear file sizes (good for listing downloads) |
pwd
|
Print Working Directory | prints the full file path of your current directory location |
mkdir <name>
|
Make Directory | creates a directory with the specified name |
cd <directory>
|
Change Directory |
move into the target directory - use cd .. to move up one directory- all files and directories are case sensitive - for names with spaces in them, use double quotes: cd "My Folder"
|
rm <target-file>
|
Remove |
delete the target file - use rm -r to remove a directory and all of its contents
|
gcc -o <program-name> <source-file>.c
|
GNU C Compiler |
Attempt to compile target <source-file>.c and create an executable binary with <program-name> Source files names must end in '.c' . The program name should have no file name extension in Linux or '.exe' in Windows. Do not name the output <program-name> the same as the source file or it will overwrite (delete) your source code! If the command executes with no output, compiling is typically successful. If errors are output, no program will be created. |