Basic linux commands interview questions

1)Give me 15 commands which you use frequently

Depends on the environment you work. Some examples are

mkdir — For creating folders( use -p option to create multiple folders at a time)
ls –List folders/files( check what ls -1 do)

top — To monitor system activities

lsof –To check whats happening on the server and which process open which file.

netstat -tcp –Gives you complete picture about network connection details.

vnstat –Gives you Network band width statics

sh –For running shell scripts

history –For monitoring the commands executed by users

cd –For changing directories

vi-For editing configuration files.

chmod –To change permissions of folders and files.

mount –For mounting formatted partitions.

service –For start/restart/stop a service.

chkconfig –For permanent on/off a service.

fdisk -l –To list all the partitions

This is my own list, you can have your list.

2)Give me some commands for user management.

last, chage, chsh, lsof, chown, chmod, useradd, userdel, newusers.

3)Give me syntax checking commands for following services

DNS, SAMBA, Apache etc

4)What is the command to do password less logins to other machines.

expect and ssh-keygen

5)Give me some security monitoring related commands.

lsof, netstat, top, ps -ef, tail, last, tcpdump, sestatus, history, w.

6)What is the difference between man, info, whatis commands and a –help option for a command?

whatis gives you one line answer.

–help option for a command gives you one line answers for each option supported by a command

man command gives you medium size info.

info command gives full details about a commands, lots and lots of information about a command.

Please share your interview questions with us, we post them here so that others can get help from this.

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.
  • Somnath

    pls provide help to configure mail notification alert  in nagios. I configured nagios 3.1.0 on rhel 5.1 with web interface.

  • Suresh

    thanks … dude 

  • Anantg21

    why lost+found directory is created after a fresh installation and what information it contains ? Please let me know about this directory..
    By: Anant

  • Surendra

    This folder contains the files with no links and files to be required. This folder is present in a folder which is mounted on a partition. In other words we can for each partition we have this folder so that any file to be recovered is kept in this folder. fsck command is used to recover these files.

  • lokendra singh

    ur blog is really good for the people who are beginner
    great job

  • jaswant

    Your all post is very help fule.

    i am posting my some interview question.

    1. what is zombi process.
    2. what is runlevel

  • Kapil

    Zombie : it is a state of process which is been killed by kill (pid ) command but there is something which is still there in the server. 

    Runlevel : for redhat server there are six runlevels 0,1,2,3,4,5. every runlevel consists some lib files or services. you can see them in /etc/inittab file. at the time of booting the boot initrd went to the runlevel for booting the server as per the runlevel value set in inittab file