Home

Coming updates

Posted by patorjk | General News | Monday 28 November 2011 11:31 pm

Photo By gureu

Two updates for the price of one today. It’s been killing me that I haven’t been posting more. I’ve been switching between projects a lot lately and I’m ultimately left with a lot of stuff that’s between 25%-75% done.

Coming up within the next month there will be a make-over/overhaul of an existing app. I also started some big updates for the baby naming tool, but temporarily shelved them when I started the remake of the previously mentioned app – though I’m not sure when these updates will be out. I’ve also been experimenting with FireFox addons, but I haven’t yet put together anything interesting. Sometimes I feel like I have programmer ADD.

Anyway, I just wanted to let you all know I’m still actively working on stuff for this site and haven’t forgotten about it. Sorry it’s been so quiet lately!

Testing your Linux skills

Posted by patorjk | Development Thoughts | Monday 28 November 2011 11:30 pm

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:

http://www.funtoo.org/wiki/Linux_Fundamentals,_Part_1

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.

Notes:

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