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

Monday, August 4, 2014

[Solved] Linux Programming Challenge : 001

Fancy your Linux Programming skills ? Take this challenge and answer these simple 5 questions related to Linux System and Linux Programming.

Update : Solutions added



  1. If getppid() returns the parent process id, what does getepid() return ?
      • Effective user id

  2. Which daemon is used to update log files on a Linux system ?
      • syslogd

  3. Which is the only directory [ filesystem ] on a Linux machine that does not exist on the hard disk ?
      • The proc filesystem that resides at /proc

  4. Will a hardlink have an inode number different from the inode of the file it links to ? Or is this the case with a soft link ?
      • Hardlink and the file it links to use the same inode number
      • Softlink and the file it links to use different inode numbers

  5. What is the default file permission of all newly created files when the umask is 0755 ?
      • 022 [ only group users and others can write to this file !!! ]

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 23, 2014

[Solved] Linux Commands Challenge : 006

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

Update : Added solutions


  1. What does the shell environment variable IFS stand for ?
      • Internal Field Separator

  2. What does APT in apt-get command stand for ?
      • Advanced Packaging Tool

  3. Often Linux distributions are accompanied with a EULA. What does EULA stand for ?
      • End User License Agreement

  4. What does CUPS stand for in Linux ?
      • Common Unix Printing System

  5. What does DMZ in context with Linux Security stand for ?
      • DeMilitarised Zone

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

Monday, May 19, 2014

[Solved] Linux Commands Challenge : 002

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

Update : Added Solutions


  1. How can variables defined in one Bash Shell script be made visible in its child Bash Shell script ?
      • You need to export the variable in the parent Bash Shell Script, for the variables to be visible in its child Bash Shell script.

  2. How can one find out the type of the Shell he/she is using ?
      • echo $SHELL

  3. Name the C function call that can be used in a C program to fetch the value of a Shell Environment variable
      • getenv()

  4. One can use "printenv" command to list all the Global Environment variables, but what command can we use to list the Local Environment Variables ?
      • You can use "set". But, it list all the environment variables, global and local. You will have to write a Shell Script to prune out Global environment variables from the output of "set" to derive the final list of Local Environment variables. Local environment variables are the variables that are local to the current shell.

  5. How can you find out the current Bash Shell's parent process id ?
      • echo $PPID

Monday, May 12, 2014

[Solved] Linux Commands Challenge : 001

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

Update : Added Solutions

Winner : Congratulations to Laxmeesha TV for getting the highest number [ 3 ] of correct solutions.


  1. Which Linux command would you use to replace all the occurrences of "Computer Science" in the file "subjects.list" with “CS”. Make sure you create a backup of the original file as well.
      • sed -i “.bkp” s/“Computer Science”/CS/g subjects.list

  2. What is the command to list all the hidden files of the present working directory ?
      • ls -la

  3. What is the command to list only the first two lines of subjects.list file ?
      • head -2 subjects.list

  4. Print the contents of subjects.list file in reverse order. [ Hint : Cats have tails ]
      • cat subjects.list | tail -r

  5. Which Bash command would you issue on a Linux machine to create a coredump of a running program. [ Hint : The flight was aborted due to bad weather ]
      • kill -6