Linux 101


layout: cover kicker: Living on the command line title: Linux 101 subtitle: SSH, files, pipes, and the modern CLI toolkit


layout: agenda title: What we'll cover items:



layout: section index: "01" kicker: Part one title: SSH & keys


layout: define kicker: How it works term: Public & private keys definition: You generate a key pair — two linked files. The public one you hand out; the private one never leaves your machine. points:



layout: default kicker: Setup title: Generate a key and hand it over


layout: default kicker: Quality of life title: SSH config — name your hosts

Define aliases once, stop typing IPs, users, and ports:

Host devbox
    HostName 192.168.1.50
    User cagdas
    Port 2222
    IdentityFile ~/.ssh/work_key

Now ssh devbox just works — and so do scp, rsync, and git over that host.


layout: section index: "02" kicker: Part two title: Files & permissions


layout: reference kicker: The fundamentals title: Get around & manage files groups:



layout: code-explain kicker: Permissions title: Reading an ls -l line notes:


-rw-r--r--  cagdas devs  config.yaml   # file: owner writes, rest read
drwxr-xr-x  cagdas devs  src/          # dir:  owner writes, rest enter

chmod +x script.sh           # make executable
chmod 600 id_ed25519         # rw-------  (required for SSH keys)

layout: reference kicker: Looking inside title: Read files items:



layout: section index: "03" kicker: Part three title: Environment


layout: default kicker: Variables & PATH title: Where the shell finds things

man ls for the full manual, ls --help for a quick reminder — and tldr ls for practical examples (coming up).


layout: section index: "04" kicker: Part four title: Pipes & redirection


layout: define kicker: The core idea term: The pipe | definition: Sends the output of one command as the input of the next. Each command does one thing; the pipe chains them into something bigger. points:



layout: code-explain kicker: Why it works title: Three streams per process notes:


ls > files.txt          # stdout to a file (overwrite)
echo more >> files.txt  # append
make 2> errors.txt      # just the errors, to a file
make &> all.txt         # output and errors together

layout: default kicker: Build a pipeline title: From a log to an answer, step by step

Same three-move combo — sort | uniq -c | sort -rn — answers a huge share of "what's most common?" questions.


layout: section index: "05" kicker: Part five title: Text processing & search


layout: reference kicker: The workhorses title: grep & find groups:



layout: default kicker: Cut & transform title: awk & sed — the 20% you'll use

# awk — pull out columns (whitespace-split by default)
ps aux | awk '{print $1, $11}'      # user + command
cut -d',' -f1 users.csv              # cut: simpler column grab

# sed — search & replace
sed 's/localhost/prod-db/g' config.yaml     # all on each line
sed -i 's/localhost/prod-db/g' config.yaml  # edit the file in place

sed -i edits in place with no undo — test without -i first.


layout: define kicker: The missing link term: xargs definition: Some commands take arguments, not stdin. xargs turns piped output into arguments for them. points:



layout: section index: "06" kicker: Part six title: The modern CLI toolkit


layout: default kicker: Structured data title: jq — slice JSON like a pro

cat todos.json | jq .                       # pretty-print
cat todos.json | jq '.[].title'             # one field per item
cat todos.json | jq '.[] | select(.done==false)'   # filter
cat repo.json  | jq '{stars: .stargazers_count}'    # reshape

jq is to JSON what grep/awk are to plain text — pipe any API response straight into it.


layout: panels kicker: Faster, friendlier replacements title: Tools worth installing today panels:



layout: reference kicker: A few more title: Keep these in your back pocket items:



layout: default kicker: Putting it together title: Real one-liners you'll reach for

# most common errors in a log
grep ERROR app.log | awk -F'[][]' '{print $2}' | sort | uniq -c | sort -rn

# busiest IPs in an access log
awk '{print $1}' access.log | sort | uniq -c | sort -rn

# pick a file with a live preview, open it
fzf --preview 'bat --color=always {}'

layout: statement kicker: The whole idea title: Small tools that each do one thing, joined by pipes. Learn the joins, not a thousand commands.


layout: end title: That's the toolkit subtitle: Pick two new tools and use them this week until they're muscle memory.