Linux Interview Questions and Answers
Question - 21 : - How do you change permissions under Linux?
Answer - 21 : - Assuming you are the system administrator or the owner of a file or directory, you can grant permission using the chmod command. Use + symbol to add permission or – symbol to deny permission, along with any of the following letters: u (user), g (group), o (others), a (all), r (read), w (write) and x (execute). For example, the command chmod go+rw FILE1.TXT grants read and write access to the file FILE1.TXT, which is assigned to groups and others.
Question - 22 : - In Linux, what names are assigned to the different serial ports?
Answer - 22 : - Serial ports are identified as /dev/ttyS0 to /dev/ttyS7. These are the equivalent names of COM1 to COM8 in Windows.
Question - 23 : - How do you access partitions under Linux?
Answer - 23 : - 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.
Question - 24 : - What are hard links?
Answer - 24 : - Hard links point directly to the physical file on disk, and not on the pathname. 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.
Question - 25 : - What is the maximum length for a filename under Linux?
Answer - 25 : - 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.
Question - 26 : - What are filenames that are preceded by a dot?
Answer - 26 : - 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.
Question - 27 : - Explain virtual desktop.
Answer - 27 : - This serves as an alternative to minimizing and maximizing different windows on the current desktop. Using virtual desktops can clear the desktop when 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.
Question - 28 : - How do you share a program across different virtual desktops under Linux?
Answer - 28 : - 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.
Question - 29 : - What does a nameless (empty) directory represent?
Answer - 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.
Question - 30 : - What is the pwd command?
Answer - 30 : - The pwd command is short for print working directory command.
Example:
pwd