Your DevOps study space

Real explanations. Videos with tests. Fresh exams every time. Keep the streak alive and watch the XP stack up.

Text tools, pipes & redirection · Linux Docs · StackwisePlanDevOps Text tools, pipes & redirection · Linux Docs · StackwiseCodePython Text tools, pipes & redirection · Linux Docs · StackwiseBuildDocker Text tools, pipes & redirection · Linux Docs · StackwiseTestDevOps Text tools, pipes & redirection · Linux Docs · StackwiseReleaseGit Text tools, pipes & redirection · Linux Docs · StackwiseDeployKubernetes Text tools, pipes & redirection · Linux Docs · StackwiseOperateLinux Text tools, pipes & redirection · Linux Docs · StackwiseMonitorDevOps

Pick a topic

Eight tracks, each with docs, a cheat sheet, videos and tests.

How it works

One loop, repeated until it sticks.

Jump back in

Picked up from where you left off.

Free forever

Your DevOps journey starts with one click.

Sign in with Google or GitHub to open every chapter, video, test and challenge. Your progress is saved wherever you learn.

Text tools, pipes & redirection

Linux commands are small tools that each do one thing well, and the real power comes from chaining them together. Logs, config files and command output are all just text, so a handful of text tools lets you answer almost any question about a server.

Input, output and errors

keyboardor a file: < in.txt./deploy.sha running commandscreenor: > out.logscreenor: 2> errors.txt0 stdin1 stdout2 stderr2>&1 means: send 2 to wherever 1 is going right now
Three numbered channels. Redirection only changes where a number points: > moves 1, 2> moves 2, and 2>&1 joins 2 to 1.

Every command has three channels: stdin (input, usually your keyboard), stdout (normal output, usually your screen) and stderr (error messages, also the screen, but a separate channel). Redirection reroutes them:

$ ls > files.txt          # stdout into a file (overwrites it)
$ echo "done" >> log.txt  # append instead of overwrite
$ ./deploy.sh 2> errors.txt        # only the errors into a file
$ ./deploy.sh > all.log 2>&1      # errors into the same place as output
$ ./noisy.sh > /dev/null           # throw output away

2>&1 reads as "send channel 2 (errors) to wherever channel 1 (output) is going". /dev/null is a special file that swallows everything written to it.

Pipes

The pipe | sends one command's output straight into the next command's input, so you build answers step by step:

$ ps aux | grep nginx                       # only nginx processes
$ cat access.log | wc -l                    # how many requests?
$ grep " 500 " access.log | wc -l           # how many were server errors?
$ cut -d' ' -f1 access.log | sort | uniq -c | sort -rn | head
#   ↑ which IP addresses hit us most often

Read that last line left to right: take the first space-separated field (the IP) from each line, sort them so duplicates sit together, count each group with uniq -c, sort by that count biggest first, show the top ten.

cut -d' ' -f1take the IPsortgroupuniq -ccount eachsort -rnbiggest 1stheadtop 10each | feeds one command's output into the next command's input
Read a pipeline left to right. No temporary files: the text flows from one small tool into the next.

grep: finding lines

$ grep "error" app.log          # lines containing "error"
$ grep -i "error" app.log       # case-insensitive
$ grep -n "timeout" app.log     # show line numbers
$ grep -v "DEBUG" app.log       # lines that DON'T match
$ grep -r "DB_HOST" /etc/myapp  # search every file in a folder
$ grep -c "404" access.log      # just count matches

Sorting, counting, cutting

  • wc -l counts lines (-w words, -c bytes).
  • sort sorts lines; -n numerically, -r reversed, -h understands sizes like 2G.
  • uniq collapses repeated neighbouring lines (so sort first); -c counts them.
  • cut -d',' -f2 takes the 2nd comma-separated column.
  • awk '{print $1, $9}' prints chosen whitespace-separated columns, handy for logs.
  • sed 's/old/new/g' file finds and replaces; sed -i edits the file in place.
  • diff a b shows which lines differ between two files.
  • xargs turns input lines into arguments: find . -name "*.tmp" | xargs rm.

Environment variables and PATH

An environment variable is a named value that programs can read, which is how apps get settings like database addresses and API keys without hard-coding them. export DB_HOST=10.0.0.5 sets one for the current shell and anything it starts; echo $DB_HOST reads it; env lists them all. Put exports in ~/.bashrc to set them on every login.

PATH is the variable listing the folders the shell searches when you type a command name. "command not found" usually means the program isn't installed or its folder isn't in PATH.

Your shell also remembers what you typed: history lists it, !! repeats the last command (sudo !! reruns it with sudo), and Ctrl+R searches back through it.

Questions

Pick an answer. Get it wrong and you can try again right away, no waiting. 10 questions per topic - pick a filter below, then use Recreate questions for a fresh set on that topic.

Fresh questions every time

Exam

A mixed test across the whole site, shuffled so you never know which topic comes next. When you submit, every mistake comes with the reason and a jump to the exact moment in the video that explains it.

30 questions 6 topics 20 minute limit Up to 70 XP
1–4 answer · ←→ move
History

Essay

0 / 200-250 words
Sample answer
History
0:00 / 0:00
Not started

on YouTube
Subscribe

Topic progress

Activity

Achievements

Settings

Your profile and your account.

Profile details

* Required. Saved in this browser until you sign in.

Letters, numbers, dots, dashes and underscores.
0 / 160

Account

Checking…

App

Install Stackwise on your phone or computer. It opens in its own window from your home screen, and the Docs and cheat sheets you've opened keep working without internet.

Only admins can see this

Dashboard

Sign-ups, activity, messages and reviews in one place.

Prove it

Certificates

Pass a topic's test and get a certificate with its own public page you can share or add to LinkedIn. Each test is 10 questions drawn at random and graded on the server; you need 8 right, you have 15 minutes, and you get one try per topic a day.

From first command to production

Linux for DevOps

A path through Linux the way DevOps engineers use it: ten stages, every command explained with its flags, examples, real output and mistakes, the combinations engineers chain together, and incidents worked through step by step. Practise everything in a safe lab folder.

Before the interview

Interview prep

Questions that come up in real DevOps interviews, with the kind of answer that lands. Say yours out loud first, then compare. Each one links to the chapter that goes deeper.

    Private to you

    My notes

    Everything you wrote down while watching and reading, in one place. Saved to your account, never shown to anyone.