• +91 9723535972
  • info@interviewmaterial.com

Linux Interview Questions and Answers

Related Subjects

Linux Interview Questions and Answers

Question - 71 : - What is the 'ls' command and what it does?

Answer - 71 : -

It is one of the basic commands in Linux. It is used to list all the files and directories in the file system.zom

Syntax: 

ls [OPTIONS] [FILES]
We can use it without passing the arguments, then it will list all the files in the current working directory. Files will be displayed in alphabetical order. 

Is
To list the specific directory files use the directory name in the syntax, follow as shown in the below syntax.

ls /etc
We can also pass multiple directories names in the syntax, but separated by space. 

ls /etc /var /etc/passwd

Question - 72 : - How to lock a user account in Linux?

Answer - 72 : -

Locking user account is done for the security purpose so that unauthorized users cannot log in. So, we have a few ways to lock the user account. Some of them are below. 

  • Lock or disable the password using passwd command.
  • Expire the user account using usermod command or chage command.
  • Changing the shell using nologin command ( /sbin/nologin ).

Question - 73 : - How to share a directory using NFS?

Answer - 73 : -

To share a directory using NFS, first edit the configuration file and ‘/etc/exports’ and add an entry like directory name ‘/’. Now restart the NFS service.

Question - 74 : - How to change the default run level in Linux?

Answer - 74 : -

To change the default run level in Linux use the init command. 

Question - 75 : - Where the kernel modules are located?

Answer - 75 : -

lib/modules/kernel-version/, this directory stores all the information about the compiled drives under the Linux system. Using lsmod command also we can see the installed kernel modules. 

Question - 76 : - How to check which ports are listening in my Linux Server?

Answer - 76 : -

We have two commands to check which ports are in listening in Linux Server. Following are the two commands 

# netstat --listen
# netstat -l

Question - 77 : - Explain about chmod command?

Answer - 77 : -

This command is used to change the permission of files and directories. It’s an important command so, I'll explain it briefly. Therefore, on the whole, there are three ty0pe of permission, read, write and execute and are represented by numbers as shown below.

4 - read permission
2 - write permission
1- execute permission
syntax:

$ chmod options permissions file name  

$ chmod [OPTION]... MODE[,MODE]... FILE...

$ chmod [OPTION]... OCTAL-MODE FILE...

$ chmod [OPTION]... --reference=RFILE FILE…

Question - 78 : - Explain about chown command?

Answer - 78 : -

Chown command: The command “chown” stands for change file owner and Group. This command is used to change the ownership of one or more files or folders for a specified user or group. 

syntax:

$ chown [OPTION]… [OWNER][:[GROUP]] FILE…
                                Or

  $ chown [OPTION]… –reference=RFILE FILE…

Question - 79 : - What is the cp command in Linux?

Answer - 79 : -

cp command: cp command is used to copy files and directories. It is also used to backup files or directories.

Syntax:

$ cp filename

Question - 80 : - Explain rmdir command in Linux?

Answer - 80 : -

The rmdir is used to remove each directory specified on the command line. 

Syntax: 

rmdir [-p] [-v | –verbose] [–ignore-fail-on-non-empty] directories


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners