Showing posts with label #solved. Show all posts
Showing posts with label #solved. Show all posts

Monday, June 30, 2014

[Solved] Linux Commands Challenge : 007

Fancy your Linux Administration skills ? Take this challenge and answer these simple 5 questions related to everyday tasks of Linux Administration.

Winner : Congratulations to Sankar P for getting the highest number [ 2 ] of correct solutions.


  1. How do you restore GRUB bootloader to MBR of your primary hard disk ?
      • grub-install /dev/sda

  2. What does initrd contain ?
      • It contains the initial RAM disk, i.e., the initial root file system that is mounted prior to locating the real root file system

  3. How do you unpack the contents of an RPM without installing it ?
      • rpm2cpio | copi -id

  4. What is the maximum number of primary partitions you can have on a hard disk ?
      • 4

  5. How to boot into single user mode using the GRUB boot loader ?
      • After selecting the kernel you are interested to boot into, edit the kernel command line and add “S” to the end of the kernel command

Monday, June 16, 2014

[Solved] Linux Commands Challenge : 005

Fancy your Linux skills ? Take this challenge and answer these simple 5 questions on Linux commands.

Update : Added Solutions



  1. What does the command units do ?
      • It is a program to convert quantities expressed in one scale to another. Ex : meters to miles

  2. What happens if I apply the sticky bit to a directory ?
      • You make the files in that directory “sticky”. In the sense, users cannot delete the files in that directory. Only the root user can delete the files. Ex : /tmp directory

  3. How do you print the reverse of your username on Linux ?
      • whoami | rev

  4. How do you find out the most commonly used command by a given user ?
      • hash | sort -r | head

  5. What is the difference in the output of these two commands : echo * and ls -R ?
      • echo * : Lists all the files in the current directory and all its sub directories ls -R : Lists all the files and folders in the current directory and all its sub directories

Monday, June 2, 2014

[Solved] Linux Commands Challenge : 004

Fancy your Linux skills ? Take this challenge and answer what these 5 commonly used abbreviations of Linux stand for

Winner : Congratulations to Sankar P for getting the highest number [ 4 ] of correct solutions.


  1. What does the Linux command TAR stand for ?
      • Tape ARchive

  2. What does the Linux command GREP stand for ?
      • Global ( search for ) Regular Expressions and Print

  3. What does the Linux command CHMOD stand for ?
      • CHange MODe

  4. What does the Linux command BC stand for ?
      • Basic Calculator

  5. What does the Linux command AWK stand for ?
      • Aho, Weinberger and Kernighan. It is named after the names of its authors : Al Aho, Peter Weinberger and Brian Kernighan

Monday, May 26, 2014

[Solved] Linux Commands Challenge : 003

Fancy your Linux skills ? Take this challenge and answer these simple 5 questions on Linux Shell Scripting.

Update : Added solutions


  1. What command(s) would you use to extract the 3 words in the string “The boy laughed” ?
      • There are many variants for this. One of the solutions is as follows :
      • echo $string | cut -d” “ -f1 ; echo $string | cut -d” “ -f2 ; echo $string | cut -d” “ -f3
      • Do let me know about other possible ways to solve this through your comments to this post

  2. What command(s) would you use to fetch only the 6th and 7th lines of a text file : poem.txt
      • This also has many variants. One of the solutions is as follows :
      • head -n 7 poem.txt | tail -2
      • Do let me know about other possible ways to solve this through your comments to this post

  3. What command(s) would you use to delete all empty/blank lines in a file : data.txt
      • grep -v ‘^$’ data.txt

  4. What does the following sed command do ? : sed -n ‘/[0-9]/p’ data.txt
      • Prints only those lines that have a numerical in them.

  5. What command(s) would you use to count the number of files ending with .log in /var/log directory and also have the word “error” in their contents ?
      • grep -l error /var/log/*.log