Choose.. X Home Exams Certifications

Linux Interview Questions

1 . What is Linux?


2 . What is the difference between UNIX and LINUX?


3 . What is BASH?


4 . What is Linux Kernel?


5 . What is LILO?


6 . What is a swap space?


7 . What is the advantage of open source?

  • 8 ) What are the basic components of Linux?

8 . Does it help for a Linux system to have multiple desktop environments installed?


9 . What is the basic difference between BASH and DOS?

  • The key differences between the BASH and DOS console lies in 3 areas:
    – BASH commands are case sensitive while DOS commands are not;

10 . What is the importance of the GNU project?


11 . Describe the root account.


12 . What is CLI?


13 . What is GUI?


14 . How do you open a command prompt when issuing a command?


15 . How can you find out how much memory Linux is using?


16 . What is typical size for a swap partition under a Linux system?


17 . What are symbolic links?


18 . Does the Ctrl+Alt+Del key combination work on Linux?


19 . How do you refer to the parallel port where devices such as printers are connected?


20 . Are drives such as harddrive and floppy drives represented with drive letters?

  • No. In Linux, each drive and device has different designations. For example, floppy drives are referred to as /dev/fd0 and /dev/fd1. IDE/EIDE hard drives are referred to as /dev/hda, /dev/hdb, /dev/hdc, and so forth.

21 . How do you change permissions under Linux?


22 . In Linux, what names are assigned to the different serial ports?

  • Serial ports are identified as /dev/ttyS0 to /dev/ttyS7. These are the equivalent names of COM1 to COM8 in Windows.

23 . How do you access partitions under Linux?

  • Linux assigns numbers at the end of the drive identifier. For example, if the first IDE hard drive had three primary partitions, they would be named/numbered, /dev/hda1, /dev/hda2 and /dev/hda3.

24 . What are hard links?

  • Hard links point directly to the physical file on disk, and not on the path name. This means that if you rename or move the original file, the link will not break, since the link is for the file itself, not the path where the file is located.

25 . What is the maximum length for a filename under Linux?

  • Any filename can have a maximum of 255 characters. This limit does not include the path name, so therefore the entire pathname and filename could well exceed 255 characters.

26 . What are filenames that are preceded by a dot?

  • In general, filenames that are preceded by a dot are hidden files. These files can be configuration files that hold important data or setup info. Setting these files as hidden makes it less likely to be accidentally deleted.

27 . Explain virtual desktop.

  • This serves as an alternative to minimizing and maximizing different windows on the current desktop. Using virtual desktops, each desktop is a clean slate where you can open one or more programs. Rather than minimizing/restoring all those programs as needed, you can simply shuffle between virtual desktops with programs intact in each one.

28 . How do you share a program across different virtual desktops under Linux?

  • To share a program across different virtual desktops, in the upper left-hand corner of a program window look for an icon that looks like a pushpin. Pressing this button will “pin” that application in place, making it appear in all virtual desktops, in the same position onscreen.

29 . What does a nameless (empty) directory represent?

  • This empty directory name serves as the nameless base of the Linux file system. This serves as an attachment for all other directories, files, drives and devices.

30 . What is the pwd command?

  • The pwd command is short for print working directory command. It’s counterpart in DOS is the cd command, and is used to display the current location in the directory tree.

31 . What are daemons?

  • Daemons are services that provide several functions that may not be available under the base operating system. Its main task is to listen for service request and at the same time to act on these requests. After the service is done, it is then disconnected and waits for further requests.

32 . How do you switch from one desktop environment to another, such as switching from KDE to Gnome?

  • Assuming you have these two environments installed, just log out from the graphical interface. Then at the Log in screen, type your login ID and password and choose which session type you wish to load. This choice will remain your default until you change it to something else.

33 . What are the kinds of permissions under Linux?

  • There are 3 kinds of permissions under Linux:
    – Read: users may read the files or list the directory
    – Write: users may write to the file of new files to the directory
    – Execute: users may run the file or lookup a specific file within a directory

34 . How does case sensitivity affect the way you use commands?

  • When we talk about case sensitivity, commands are considered identical only if every character is encoded as is, including lowercase and uppercase letters. This means that CD, cd and Cd are three different commands. Entering a command using uppercase letters, where it should be in lowercase, will produce different outputs.

35 . What are environmental variables?

  • Environmental variables are global settings that control the shell’s function as well as that of other Linux programs. Another common term for environmental variables is global shell variables.

36 . What are the different modes when using vi editor?

  • There are 3 modes under vi:
    – Command mode – this is the mode where you start in
    – Edit mode – this is the mode that allows you to do text editing
    – Ex mode – this is the mode wherein you interact with vi with instructions to process a file

37 . Is it possible to use shortcut for a long pathname?

  • Yes, there is. A feature known as filename expansion allows you do this using the TAB key. For example, if you have a path named /home/iceman/assignments directory, you would type as follows: /ho[tab]/ice[tab]/assi[tab] . This, however, assumes that the path is unique, and that the shell you’re using supports this feature.

38 . What is redirection?

  • Redirection is the process of directing data from one output to another. It can also be used to direct an output as an input to another process.

39 . What is grep command?

  • grep a search command that makes use of pattern-based searching. It makes use of options and parameters that is specified along the command line and applies this pattern into searching the required file output.



41 . What are the contents in /usr/local?


42 . How do you terminate an ongoing process?


43 . How do you insert comments in the command line prompt?


44 . What is command grouping and how does it work?


45 . How do you execute more than one command or program from a single command line entry?

  • You can combine several commands by separating each command or program using a semicolon symbol. For example, you can issue such a series of commands in a single entry:
  • MS DOS
    ls –l cd .. ls –a MYWORK which is equivalent to 3 commands: ls -l cd.. ls -a MYWORK
  • **Note that this will be executed one after the other, in the order specified.

46 . Write a command that will look for files with an extension “c”, and has the occurrence of the string “apple” in it.

  • Answer:
  • MS DOS
    Find ./ -name *.c” | xargs grep –i “apple”

47 . Write a command that will display all .txt files, including its individual permission.

  • Answer:
  • MS DOS
    ls -a -l *.txt

48 . Write a command that will do the following:
-look for all files in the current and subsequent directories with an extension c,v
-strip the,v from the result (you can use sed command)
-use the result and use a grep command to search for all occurrences of the word ORANGE in the files.

  • MS DOS
    Find ./ -name *.c,v” | sed ‘s/,v//g’ | xargs grep “ORANGE”

49 . What, if anything, is wrong with each of the following commands?
a) ls -l-s
b) cat file1, file2
c) ls – s Factdir

  • a) there should be space between the 2 options: ls -l -s
    b) do not use commas to separate arguments: cat file1 file2
    c) there should be no space between hyphen and option label: ls –s Factdir

50 . What is the command to calculate the size of a folder?

  • To calculate the size of a folder use the command du –sh folder1.