My Linux Interview Experience with a Company- Written Test Questions: Part 1

In Unix everything is a ________

Ans: File2.

2. What is the command to make a file executable?

Ans: Chmod +x filename

3. What is the name of the file that contains hostname?

Ans: /etc/hosts

4. What is the FTP mode for transferring text files?

Ans:  There are two common modes for transferring files via FTP, ascii and binary.

  • Ascii mode transfers files as ‘text’.   Examples of ascii files would be .txt, .asp, .html, and .php files…
  • Binary mode transfers files as raw data.    Examples of binary files would be .wav, .jpg, .gif, and mp3 files…
  • The file transfer type is ASCII by default.

5. What is the IP Address in Virtual Box VM if network adapter is in NAT mode?

Ans: In NAT mode it gets the IP Address from Virtual LAN of Virtual BOX.

6. What is the command to create a symbolic link?

Ans: ln -s <source-path> <destination-path>

7. What is the difference between ext2 and ext3?

ext2, ext3 and ext4 are all filesystems created for Linux. This article explains the following:

  • High level difference between these filesystems.
  • How to create these filesystems.
  • How to convert from one filesystem type to another.

Ext2

  • Ext2 stands for second extended file system.
  • It was introduced in 1993. Developed by Rémy Card.
  • This was developed to overcome the limitation of the original ext file system.
  • Ext2 does not have journaling feature.
  • On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of journaling.
  • Maximum individual file size can be from 16 GB to 2 TB
  • Overall ext2 file system size can be from 2 TB to 32 TB

Ext3

  • Ext3 stands for third extended file system.
  • It was introduced in 2001. Developed by Stephen Tweedie.
  • Starting from Linux Kernel 2.4.15 ext3 was available.
  • The main benefit of ext3 is that it allows journaling.
  • Journaling has a dedicated area in the file system, where all the changes are tracked. When the system crashes, the possibility of file system corruption is less because of journaling.
  • Maximum individual file size can be from 16 GB to 2 TB
  • Overall ext3 file system size can be from 2 TB to 32 TB
  • There are three types of journaling available in ext3 file system.
    • Journal – Metadata and content are saved in the journal.
    • Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing the content to disk. This is the default.
    • Writeback – Only metadata is saved in the journal. Metadata might be journaled either before or after the content is written to the disk.
  • You can convert a ext2 file system to ext3 file system directly (without backup/restore).

8. What is the command to download webpages from command prompt?

Ans: wget

9. What is the command to list hidden files in a directory?

Ans: ls -a

10. How do you find the shell you are running?

Ans: echo $SHELL

11. What happens when you enter the command “cd -“?

Ans: It shows the path of our previous working directory

12. Expand NAT?

Ans: Network Address Translation

13. What is the filename that contains ssh public keys?

Ans: id_rsa.pub [in Centos6/RHEL6]

14. What is ClamAV?

Ans: Its an Anti-Virus for Unix Based OS, but specially designed and used for scanning in Email Servers

15. What is Shebang?

Ans: #!/bin/bash

16. What is Virt-Manager?

Ans: The virt-manager application is a desktop user interface for managing virtual machines through libvirt. It primarily targets KVM VMs, but also manages Xen and LXC (linux containers).

17. Write the command to mount an NTFS partition in Linux?

Ans: mount -t ntfs /dev/sdb1 /mnt/ntfs {If the flavour of Linux supports NTFS}

For Cent OS:

#yum install epel-release

#yum install ntfs-3g

#mkdir /mnt/win

#mount -t ntfs-3g /dev/sdb1 /mnt/win

#mount -t ntfs-3g /dev/sdb1 /mnt/win

#vi /etc/fstab

/dev/sdb1 /mnt/win ntfs-3g defaults 0 0

18.What is the command to find the default gateway in Linux?

Ans: route -n {or} netstat -r

19. What is the command to list the server processes listening on TCP ports?

Ans: netstat -tulpn

20. What is init S or init 1?

Ans: init 1 or Runlevel 1 corresponds to Single User Mode which is used for troubleshooting

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s