A place to just document useful commands and all the good stuff in the terminal I’ve found useful so far.

 

Basic Commands
[table id=2 /]

 

Shortcuts

[table id=3 /]

 

File System Management

[table id=4 /]

 

Pipe
Piping is essentially chaining the outputs of a command into the input of the following command.

[table id=5 /]

Example: Grab all instances of foo from command line history

history | grep foo | less

Example: Pipe output in to grep

man curl | grep verbose

 

Flags
Flags are command line parameters appended to a command to specify certain settings, multiple flags can be used in combination. **Note -** The following examples will be based on the command “`ls“`. Flags will vary depending on the command they are affiliated with. The following examples are just “common” flags that you may or may not see in other commands.

[table id=6 /]

Example: Grab all files at a specific location with a specific pattern

grep -l -f /src/bin/foo bar

 

History

[table id=7 /]

 

Job Control
Job control allows you to have multiple processes or “jobs”, essentially run by the shell. Press ctrl + z when in a program (ex – vim) to back out of it and put it into the background.

[table id=8 /]

Example: Send job “top” to foreground

[1]+ Stopped top
 brandon@brandon-Inspiron-560:~$ fg "%top"

 

Networking
“`telnet“` and “`netcat“` are both networking commands for reading from and writing to network connections using TCP or UDP. “`wget“` and “`curl“` are programs that retrieve content from web servers.

[table id=9 /]

Examples coming soon!!!

 

Help and Documentation

[table id=10 /]
Other Useful Stuff
[table id=11 /]

Example: Send a GET request to a local host

$ nc localhost 8008 << HERE > > GET /api/v0/course/all HTTP/1.0 > > HERE

Linux Safe Reset

Alt + SysRq + R E I S U B "Reboot even if system utterly broken"