{"id":1334,"date":"2011-11-28T23:30:15","date_gmt":"2011-11-29T03:30:15","guid":{"rendered":"http:\/\/patorjk.com\/blog\/?p=1334"},"modified":"2014-01-25T17:48:24","modified_gmt":"2014-01-25T21:48:24","slug":"testing-your-linux-skills","status":"publish","type":"post","link":"https:\/\/patorjk.com\/blog\/2011\/11\/28\/testing-your-linux-skills\/","title":{"rendered":"Testing your Linux skills"},"content":{"rendered":"<div class=\"wp-caption alignright\" style=\"width: 260px\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/patorjk.com\/blog\/wp-content\/uploads\/2011\/11\/linux-cupcakes1.png\" width=\"250\" height=\"175\" class=\"size-full wp-image-1100\" \/><\/p>\n<p class=\"wp-caption-text\">Photo By <a href='http:\/\/www.flickr.com\/photos\/mkrigsman\/2993846564\/'>mkrigsman<\/a><\/p>\n<\/div>\n<p> If you&#8217;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&#8217;ve sometimes found myself wishing I knew certain commands or concepts a lot sooner. I&#8217;m no expert, but since I thought it might be useful, I&#8217;ve put together a short quiz to test your Linux skills. <\/p>\n<div style=\"display:none\">\n<u><b>Important Note:<\/b><\/u> 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 &#8220;+&#8221; next to the question. <a href=\"https:\/\/patorjk.com\/blog\/2011\/11\/28\/testing-your-linux-skills\/\">Click here<\/a> to be taken to the blog entry if you wish to not see the answers.<\/p>\n<\/div>\n<p>So, let&#8217;s get started&#8230;<\/p>\n<style type=\"text\/css\">\n.answer1 {display: none;}\n#question1:hover {cursor:default;}\n#question1:hover + .answer1 {display:block;}\n#question1:active + .answer1 {display:block;}\n.answer2 {display: none;}\n#question2:hover {cursor:default;}\n#question2:hover + .answer2 {display: block;}\n#question2:active + .answer2 {display: block;}\n.answer3 {display: none;}\n#question3:hover {cursor:default;}\n#question3:hover + .answer3 {display: block;}\n#question3:active +.#answer3 {display: block;}\n.answer4 {display: none;}\n#question4:hover {cursor:default;}\n#question4:hover + .answer4 {display: block;}\n#question4:active + .answer4 {display: block;}\n.answer5 {display: none;}\n#question5:hover {cursor:default;}\n#question5:hover + .answer5 {display: block;}\n#question5:active + .answer5 {display: block;}\n.answer6 {display: none;}\n#question6:hover {cursor:default;}\n#question6:hover + .answer6 {display: block;}\n#question6:active + .answer6 {display: block;}\n.answer7 {display: none;}\n#question7:hover {cursor:default;}\n#question7:hover + .answer7 {display: block;}\n#question7:active + .answer7 {display: block;}\n.answer8 {display: none;}\n#question8:hover {cursor:default;}\n#question8:hover + .answer8 {display: block;}\n#question8:active + .answer8 {display: block;}\n.answer9 {display: none;}\n#question9:hover {cursor:default;}\n#question9:hover + .answer9 {display: block;}\n#question9:active + .answer9 {display: block;}\n.answer10 {display: none;}\n#question10:hover {cursor:default;}\n#question10:hover + .answer10 {display: block;}\n#question10:active + .answer10 {display: block;}\n<\/style>\n<ol>\n<li>What does the cd command do when handed each of the following inputs: &#8220;-&#8220;, &#8220;\/tmp&#8221; and &#8220;~&#8221;? [<a id=\"question1\">+<\/a>]\n<div class=\"answer1\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">&#8220;cd -&#8221; changes the current directory to the directory you were previously in.<\/li>\n<li style=\"list-style-type: disc;\">&#8220;cd \/tmp&#8221; changes the current directory to &#8220;\/tmp&#8221;<\/li>\n<li style=\"list-style-type: disc;\">&#8220;cd ~&#8221; changes the current directory to your home directory.<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>What are two ways of copying a text file without using the cp command? [<a id=\"question2\">+<\/a>]\n<div class=\"answer2\">\n<p \/>\n<ul  style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">cat the file and redirect the output to a new file.<\/li>\n<li style=\"list-style-type: disc;\">Use the scp command (secure copy).<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>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? [<a id=\"question3\">+<\/a>]\n<div class=\"answer3\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">Use the tail command with the -f flag.<\/li>\n<li style=\"list-style-type: disc;\">Use the less command with the +F option (personal favorite).<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>What is the difference between the &#8220;which&#8221; and &#8220;whereis&#8221; commands? [<a id=\"question4\">+<\/a>]\n<div class=\"answer4\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">which shows the full path of a given command.<\/li>\n<li style=\"list-style-type: disc;\">whereis locates source, binary, and manual files for a given command.<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>How would you find all of the files modified within the last day under a particular directory structure? [<a id=\"question5\">+<\/a>]\n<div class=\"answer5\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">find .\/ -type f -mtime -1<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>What is the purpose of the &#8220;\/etc&#8221; and &#8220;\/var&#8221; directories? [<a id=\"question6\">+<\/a>]\n<div class=\"answer6\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">The main directory layout for all Linux systems is based on the Filesystem Hierarchy Standard (FHS).<\/li>\n<li style=\"list-style-type: disc;\">The &#8220;\/etc&#8221; directory contains host-specific, system-wide configuration files (sometimes called &#8220;Editable Text Configuration&#8221;).<\/li>\n<li style=\"list-style-type: disc;\">The &#8220;\/var&#8221; directory contains &#8220;variable files&#8221;, or files whose content is expected to continuously change during the normal operation of the system (ex: log files).<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>What are &#8220;cron jobs&#8221;? [<a id=\"question7\">+<\/a>]\n<div class=\"answer7\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">Linux systems have a program called &#8220;cron&#8221; 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 &#8220;cron job&#8221; refers to a job run by the cron daemon.<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>What does the &#8220;nohup&#8221; command do? [<a id=\"question8\">+<\/a>]\n<div class=\"answer8\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">Short for No Hang Up, this command allow you to execute a command that will keep going after you&#8217;ve logged out (ie, one that ignores hang up signals).<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>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 &#8220;(XXX) XXX-XXXX&#8221;. How would you do this? [<a id=\"question9\">+<\/a>]\n<div class=\"answer9\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">The key insight is to use the <i>grep<\/i> command with the -R flag (recursive directory search), -l flag (list files) and a regular expression to find the phone numbers.<\/li>\n<li style=\"list-style-type: disc;\">As a side note, this used to be a popular interview question that Amazon gave to potential applicants (for more info, see the &#8220;Notes&#8221; section at the bottom of this post).<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<li>What is the name of the official Linux kernel mascot? [<a id=\"question10\">+<\/a>]\n<div class=\"answer10\">\n<p \/>\n<ul style=\"list-style-type: disc;\">\n<li style=\"list-style-type: disc;\">Tux.<\/li>\n<\/ul>\n<\/div>\n<p \/><\/li>\n<\/ol>\n<p>Mouse over or click the +&#8217;s to see possible answers (though I didn&#8217;t include all possible answers &#8211; so you may have thought of some solutions that aren&#8217;t listed). <\/p>\n<p>If you found yourself doing poorly, or just want to refresh your linux skill set, check out:<\/p>\n<p><a href=\"http:\/\/www.funtoo.org\/wiki\/Linux_Fundamentals,_Part_1\">http:\/\/www.funtoo.org\/wiki\/Linux_Fundamentals,_Part_1<\/a><\/p>\n<p>They have some of the best tutorials I&#8217;ve seen on Linux. However, if anyone knows of any other good tutorials let me know and I&#8217;ll add them here too.<\/p>\n<p>Notes:<\/p>\n<ul>\n<li>For more information on question 9, <a href=\"https:\/\/sites.google.com\/site\/steveyegge2\/five-essential-phone-screen-questions\">click here<\/a> and go to the section titled &#8220;Area Number Three: Scripting and Regular Expressions&#8221;.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Photo By mkrigsman If you&#8217;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&#8217;ve sometimes found myself wishing I knew certain commands or concepts a lot sooner. I&#8217;m no expert, but since I thought it &hellip; <a href=\"https:\/\/patorjk.com\/blog\/2011\/11\/28\/testing-your-linux-skills\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Testing your Linux skills<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-1334","post","type-post","status-publish","format-standard","hentry","category-development-thoughts"],"_links":{"self":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/1334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/comments?post=1334"}],"version-history":[{"count":65,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/1334\/revisions"}],"predecessor-version":[{"id":2727,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/1334\/revisions\/2727"}],"wp:attachment":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/media?parent=1334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/categories?post=1334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/tags?post=1334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}