Mikey’s Linux Field NotesAll topics

GUIDE 01 / START HERE

Terminal & files

Navigate the filesystem, inspect files, and work comfortably in the terminal.

4 quick lessons · Examples to adapt to your server
In this guide
Find your placeCreate, copy, and moveIdentify and read filesFind files by name

Commands use class paths and example filenames. Replace placeholders and inspect the target before making changes.

01

Find your place

An absolute path starts at /. A relative path starts from your current directory. The ~ shortcut refers to your home directory.

COMMANDS & EXAMPLES
pwd
ls -lah
cd "$HOME"
cd /var/log
cd ..
Field note

Use ls -ld DIRECTORY to inspect the directory itself rather than its contents.

02

Create, copy, and move

Work in a practice directory while learning. mkdir -p creates missing parent directories. cp copies a file; mv moves or renames it.

COMMANDS & EXAMPLES
mkdir -p ~/practice/linux
cp ~/practice/example.txt ~/practice/linux/
mv ~/practice/linux/example.txt ~/practice/linux/notes.txt
Field note

These copy and move examples assume ~/practice/example.txt already exists. Check destination names before overwriting files.

03

Identify and read files

file inspects content to identify a file type. less and more are pagers; less supports convenient forward and backward navigation. Press q to leave a pager.

COMMANDS & EXAMPLES
file notes.txt
less notes.txt
head -n 10 notes.txt
tail -n 10 notes.txt
wc -l /etc/passwd
Field note

Renaming image.png to image.pdf does not convert its contents. Use a real conversion tool. diff works best on text; extract PDF text before comparing document wording.

04

Find files by name

Quote patterns so find receives the wildcard. The starting directory is depth 0; -maxdepth 1 examines immediate children, and -maxdepth 2 also examines their children.

COMMANDS & EXAMPLES
find /etc -maxdepth 1 -type f -name "*.conf" 2>/dev/null
find /etc -maxdepth 2 -type f -name "*.conf" 2>/dev/null
find "$HOME" -type f -name "*.pub"
Field note

Permission errors hidden with 2>/dev/null mean your search may be incomplete. wc -l counts output lines, which normally correspond to paths unless a filename contains a newline.