Commands to know:
| Command | Purpose | Usage |
|---|---|---|
| cat | Reads an entire file and sends it to STDOUT | cat apache.log |
| head | Like cat, but reads a certain number of lines from the start or top of a file | head apache.log head -20 apache.log |
| tail | Like head but reads from the end of a file | |
| cut | Cuts each row of text into columns based on a delimiter and then selects a column or columns | cat apache.log | cut -d ” ” -f 2 Reads apache.log, splits it into columns on each space, and then prints out only the second column of each row. |
| sort | Sort | |
| uniq | Unique | Make sure to run output through sot before sending it to uniq -c or you’ll get incorrect results. |
| wc | Word Count | |
| tr | Replaces one character with another one | cat textfile.txt | tr a B |
| sed | Replaces a string of characters with a different string | cat textfile | sed s/one/two Also supported inside Discord. Try sending s/one/two/g as a message and see it edit the word “one” in your last message to “two”. |