Linux Command Line Field Guide
Practical shell navigation, safe inspection commands, pipes, permissions and useful habits for a Linux workstation.
Educational reference drafted for the Nullwire archive. This is not a claim of completed training or original research; verify examples and customise before presenting it as finished work.
Objective
Become comfortable investigating a Linux machine without changing its configuration. A shell is an interface to a running system: every command should begin with a question you want answered.
Establish your bearings
Start by identifying your current directory, user and machine:
pwd
whoami
hostname
ls -lah
pwd prints your location. ls -lah shows permissions, ownership and hidden files in a human-readable format. Paths beginning with / are absolute; other paths are resolved relative to the current directory.
Inspect before modifying
Use commands that observe rather than change state:
find . -maxdepth 2 -type f
du -sh .
df -h
file ./example.txt
Pipe output to search tools instead of scrolling past evidence:
find /etc -maxdepth 1 -type f 2>/dev/null | grep -i network
The 2>/dev/null section discards error messages; only use it when you deliberately do not need them. Errors often tell you exactly why an operation failed.
Read permissions
An entry such as -rw-r----- splits into file type, owner permissions, group permissions and other permissions. Avoid applying chmod 777 as a shortcut. Prefer granting the minimum access that a process or collaborator actually needs.
Practice lab
- Create a disposable directory in your home folder with
mkdir -p ~/nullwire-lab. - Add an ordinary text file and inspect it with
cat,head,tailandwc -l. - Search the file with
grep. - Run
man grepand locate two options you didn’t know before.
Field notes
Before running a copied shell command, identify its arguments, redirections and expected side effects. Never paste an unknown one-liner into a privileged shell.