Ghamura

Linux foundationsLesson 6 of 7

Pipes: small tools, big answers

Chain commands together to answer real questions about a log in one line.

0 of 5 tasks · about 12 min

  1. Step 1

    Save output to a file

    Commands normally print to the screen. > sends the output into a file instead:

    ls /var/log > logs.txt
    

    Nothing appears on screen this time; it all went into logs.txt. Check with cat logs.txt.

    Careful: > replaces whatever was in the file before.

    Save the list of files in /var/log into logs.txt in your home directory.

    Do it in the terminal. This ticks itself off when you have.

4 more steps after this one

Save the list of files in /var/log into logs.txt in your home directory.
Practice lab for "Pipes: small tools, big answers". Type commands here and press Enter. Run help to list them.