Recent

20 Linux Interview Questions and Answers for Beginners

20 Linux Interview Questions and Answers
Hello friends, This Linux Interview questions and answers will help somebody for gaining knowledge and for Interview preparations.

20 Linux Interview Questions and Answers

1. how to find a single word text from a file and replace with new text using vi / vim editor?
:%s/oldword/newword/g

2. Write a command to find all the files which have been accessed within the last 30 days
find / -type f -atime -30

This command will find all the files under root, which is ‘/’, with file type is file. ‘-atime -30′ will give all the files accessed less than 30 days ago. And the output will put into a file call December.files.

3. Explain the difference between SIGTERM and SIGKILL 
SIGTERM asks the application to terminate in a polite way, it warns about the pending closure and asks the app to finish whatever it is doing. SIGKILL will kill the process no matter what. This is telling the application that it will be shut down no matter what.

4. What does apachectl graceful do?
It sends a SIGUSR1 for a restart, and starts the apache server if it’s not running.

5. What is CVS? List some useful CVS commands?
CVS is Concurrent Version System. It is the front end to the RCS revision control system which extends the notion of revision control from a collection of files in a single directory to a hierarchical collection of directories consisting of revision controlled files. These directories and files can be combined together to form a software release.
There are some useful commands that are being used very often. They are,

  1. cvs checkout 
  2. cvs update 
  3. cvs add 
  4. cvs remove 
  5. cvs commit
6. What is Semaphore? What is deadlock?
Semaphore is a synchronization tool to solve critical-section problem, can be used to control access to the critical section for a process or thread. The main disadvantage (same of mutual-exclusion) is require busy waiting. It will create problems in a multiprogramming system, where a single CPU is shared among many processes.

Busy waiting wastes CPU cycles.

Deadlock is a situation when two or more processes are waiting indefinitely for an event that can be caused by only one of the waiting processes. The implementation of a semaphore with a waiting queue may result in this situation.

7. What is the main advantage of creating links to a file instead of copies of the file?
The main advantage is not really that it saves disk space (though it does that too) but, rather, that a change of permissions on the file is applied to all the link access points. The link will show permissions of lrwxrwxrwx but that is for the link itself and not the access to the file to which the link points. Thus if you want to change the permissions for a command, such as su, you only have to do it on the original. With copies you have to find all of the copies and change permission on each of the copies.

Read also other Linux Interview Questions and Answers

8. Give two UNIX kernel parameters that effect an Oracle install.
SHMMAX & SHMMNI

9. What is the difference between binaries in /bin, and /usr/bin?
/bin - would contains the binaries frequently used by the normal user (as well as system administrator)
/usr/bin - would contains the binaries rarely used by the normal user (as wel as system administrator)

10. How are devices represented in Linux?
All devices are represented by files called special files that are located in/dev directory.

11. Discuss the mount and unmount system calls  
The privileged mount system call is used to attach a file system to a directory of another file system; the unmount system call detaches a file system.

12. Explain fork() system call
The `fork()' used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent.

13. Explain Boot sequence summary in short? 
  1. BIOS [When booting from a hard disk, the PC system BIOS loads and executes the boot loader code in the MBR]
  2. Master Boot Record (MBR)  (The very first sector of the hard disk is reserved for the same purpose and is called the master boot record (MBR).]
  3. LILO or GRUB
  4. Kernel
  5. init
  6. Run Levels

Also refer more interview questions and answers,
Veritas Cluster Interview Questions and Answers
Linux Interview Questions and Answers
Openstack Interview Questions and Answers
Vmware Interview Questions and Answers
Cluster Interview Questions and Answers
HR Interview Questions and Answers

14.  Explain the different RAID LEVELS?
There are number of different RAID levels:

Level 0 -- Striped Disk Array without Fault Tolerance: Provides data striping (spreading out blocks of each file across multiple disk drives) but no redundancy. This improves performance but does not deliver fault tolerance. If one drive fails then all data in the array is lost.

Level 1 -- Mirroring and Duplexing: Provides disk mirroring. Level 1 provides twice the read transaction rate of single disks and the same write transaction rate as single disks.

Level 2 -- Error-Correcting Coding: Not a typical implementation and rarely used, Level 2 stripes data at the bit level rather than the block level.

Level 3 -- Bit-Interleaved Parity: Provides byte-level striping with a dedicated parity disk. Level 3, which cannot service simultaneous multiple requests, also is rarely used.

Level 4 -- Dedicated Parity Drive: A commonly used implementation of RAID, Level 4 provides block-level striping (like Level 0) with a parity disk. If a data disk fails, the parity data is used to create a replacement disk. A disadvantage to Level 4 is that the parity disk can create write bottlenecks.

Level 5 -- Block Interleaved Distributed Parity: Provides data striping at the byte level and also stripe error correction information. This results in excellent performance and good fault tolerance. Level 5 is one of the most popular implementations of RAID.

Level 6 -- Independent Data Disks with Double Parity: Provides block-level striping with parity data distributed across all disks.

Level 0+1 – A Mirror of Stripes: Not one of the original RAID levels, two RAID 0 stripes are created, and a RAID 1 mirror is created over them. Used for both replicating and sharing data among disks.

Level 10 – A Stripe of Mirrors: Not one of the original RAID levels, multiple RAID 1 mirrors are created, and a RAID 0 stripe is created over these.

Level 7: A trademark of Storage Computer Corporation that adds caching to Levels 3 or 4.

15. How to disable the quotas at kernel level? 
Goto etc/fstab, remove the quota tag, remount (mount /home -o remount) for /home.

16. How to disable the ping? 
echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all

This disables ping responses.
To make this permanent set the following into /etc/sysctl.conf (if you have such a file)
net.ipv4.conf.icmp_echo_ignore_all = 1

17. How to enable IP-Forwarding ? 
echo 1 > /proc/sys/net/ipv4/ip_forward

To enable permanently, edit /etc/sysconfig/network and change or add the following line:
FORWARD_IPV4 = YES  or FORWARD_IPV4=true

18. How to find  the block size? 
Using dumpe2fs <device> or tune2fs –l <device>

19. How to convert ext3 to ext2?  
tune2fs –j <device>

20. What is IP masquerading ? 
In computer networking, network address translation (NAT, also known as network masquerading or IP-masquerading) is a technique in which the source and/or destination addresses of IP packets are rewritten as they pass through a router or firewall.
linux interview questions, linux questions and answers, linux interview questions and answers, linux basics interview questions, linux l3 interview questions, linux interview questions and answers pdf, interview questions on linux, linux interview questions for freshers, Basic linux interview questions

Basic interview questions of linux, linux interview questions for beginners, Most commonly asked linux interview questions, linux Technical Questions, linux cloud interview questions, linux admin interview questions, linux job interview questions, interview questions
20 Linux Interview Questions and Answers for Beginners thumbnail Reviewed by Selva Kumar on 13:00 Rating: 5

No comments:

All Rights Reserved by Learn IT Guide © 2015 - 2025.

Contact Form

Name

Email *

Message *

Powered by Blogger.