Testing your Linux skills

Photo By mkrigsman

If you’re a developer, you probably find yourself using Linux at least some of the time. Knowing your way around the OS can make your life a lot easier, and I’ve sometimes found myself wishing I knew certain commands or concepts a lot sooner. I’m no expert, but since I thought it might be useful, I’ve put together a short quiz to test your Linux skills.

Important Note: Since you are reading this through a feed reader or by email, the answers will be right below the question. On the main blog entry the answers are hidden until you mouse over or click on the “+” next to the question. Click here to be taken to the blog entry if you wish to not see the answers.

So, let’s get started…

  1. What does the cd command do when handed each of the following inputs: “-”, “/tmp” and “~”? [+]

    • “cd -” changes the current directory to the directory you were previously in.
    • “cd /tmp” changes the current directory to “/tmp”
    • “cd ~” changes the current directory to your home directory.

  2. What are two ways of copying a text file without using the cp command? [+]

    • cat the file and redirect the output to a new file.
    • Use the scp command (secure copy).

  3. You want your console window to continuously show you the latest updates to a log file as its being updated. How would you do this? [+]

    • Use the tail command with the -f flag.
    • Use the less command with the +F option (personal favorite).

  4. What is the difference between the “which” and “whereis” commands? [+]

    • which shows the full path of a given command.
    • whereis locates source, binary, and manual files for a given command.

  5. How would you find all of the files modified within the last day under a particular directory structure? [+]

    • find ./ -type f -mtime -1

  6. What is the purpose of the “/etc” and “/var” directories? [+]

    • The main directory layout for all Linux systems is based on the Filesystem Hierarchy Standard (FHS).
    • The “/etc” directory contains host-specific, system-wide configuration files (sometimes called “Editable Text Configuration”).
    • The “/var” directory contains “variable files”, or files whose content is expected to continuously change during the normal operation of the system (ex: log files).

  7. What are “cron jobs”? [+]

    • Linux systems have a program called “cron” which runs in the background and executes jobs (commands, scripts, etc) based on a schedule defined in a crontab file. This allows you to routinely do certain tasks. A “cron job” refers to a job run by the cron daemon.

  8. What does the “nohup” command do? [+]

    • Short for No Hang Up, this command allow you to execute a command that will keep going after you’ve logged out (ie, one that ignores hang up signals).

  9. You have a directory tree which contains all of the files for a web application. You want to make a list of all of the files that contain a phone number in the format of “(XXX) XXX-XXXX”. How would you do this? [+]

    • The key insight is to use the grep command with the -R flag (recursive directory search), -l flag (list files) and a regular expression to find the phone numbers.
    • As a side note, this used to be a popular interview question that Amazon gave to potential applicants (for more info, see the “Notes” section at the bottom of this post).

  10. What is the name of the official Linux kernel mascot? [+]

    • Tux.

Mouse over or click the +’s to see possible answers (though I didn’t include all possible answers – so you may have thought of some solutions that aren’t listed).

If you found yourself doing poorly, or just want to refresh your linux skill set, check out:


They have some of the best tutorials I’ve seen on Linux. However, if anyone knows of any other good tutorials let me know and I’ll add them here too.


  • For more information on question 9, click here and go to the section titled “Area Number Three: Scripting and Regular Expressions”.