Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Name the command used to review boot messages.

Answer»

The COMMAND that is used to review BOOT MESSAGES is the “DMESG” command.

2.

What do you mean by unmask?

Answer»

Umask, also KNOWN as user file-creation mask, is a Linux COMMAND that allows you to set up DEFAULT permissions for new files and folders that you create. In Linux OS, umask command is used to set default file and folder permission. It is also used by other commands in Linux like mkdir, tee, touch, etc. that create files and directories. 

Syntax: umask [-p] [-S] [mask]  

Where,  
[mask]: It REPRESENTS the permission MASKS that you are applying. 
[-S]: It displays the current mask as a symbolic value. 
[-p]: It displays the current mask along with umask command thus allowing it to be copied and pasted as a future input.  

3.

What are Linux directory commands?

Answer»

There are basically five Linux directory commands that are used to WORK with FILES and directories as given below: 

  • PWD: It stands for “print working directory”. This COMMAND is generally used to DISPLAY the path of the present or current working directory. 
    Syntax: $ pwd 
  • cd: It stands for “change directory”. This command is generally used to change the present working directory to the directory that we want to work on. 
    Syntax: $ cd <path to new directory> 
  • Is: It stands for “list”. This command is generally used to show the full list of content of files and directories in the present working directory. 
    Syntax: $ ls 
  • mkdir: It stands for “make directory”. This command generally allows users to create directories in Linux.  
    Syntax: $ mkdir <name (and path if required) of new directory> 
  • rmdir: It stands for “remove directory”. This command is used to remove/delete each directory that is specified on the command line. 
    Syntax: $ rmdir <name (and path if required) of directory> 
4.

What is pipe?

Answer»

In Linux, a pipe is basically a form of REDIRECTION that is used to send the output of one COMMAND to another command for further processing. It simply takes the output from one command and USES it as an input for another. It provides asynchronous execution of commands with help of BUFFERED I/O routines. 

5.

Which command is used to check the memory status?

Answer»

The command used mostly to check memory status in Linux is “free”. Other commands that can be used are given below: 

  • “cat” command: It can be used to show or display Linux memory INFORMATION. (cat/proc/meminfo)
  • VMSTAT” command: It can be used to report STATISTICS of virtual memory. 
  • “top” command: It can be used to check the usage of memory. 
  • “htop” command: It can be used to find the memory LOAD of each PROCESS
6.

Name the command that is used to check all the listening ports and services of your machine.

Answer»

# NETSTAT -ntlp

7.

What is the pwd command?

Answer»

PWDCOMMAND is basically a command that is USED to PRINT the complete path of the current working directory starting from the root (/). Here, “pwd” stands for Print Working Directory. It is considered one of the most basic and most used commands in Linux. This command is usually a built-in SHELL command and is also available in different shells such as bash, ksh, zsh, bourne shell, etc.

8.

Explain working of env command.

Answer»

“env” command is basically a shell command that is used to print a list of current environmental variables. Here, “env” stands for the environment. It can also run another process in another environment without any modification of the current environment. It ALLOWS you to run programs in a modified environment. It is generally used by shell SCRIPTS to launch the correct interpreter. It can also be useful for checking if wrong environment variables prevent the APPLICATION from starting during TROUBLESHOOTING.  

Example: 

$env
PHYTHON_PIP_VERSION=9.0L1
HOME=/root
DB_NAME=test
PATH=/usr/local/bin:/usr/local/sbin
LAND=C.UTF=8
PYTHON_VERSION=3.4.6
PWD=/
DB_URI=mongodb://database:27017/test

9.

What is the function of grep command?

Answer»

GREP (Global regular expression print) is a COMMAND that is USED to the global search for a string of characters in a specified file. The text search PATTERN is generally KNOWN as a regular expression. It simply makes use of pattern-based searching.  

Syntax: grep [options] pattern [files] 
Example: $ grep -c "linux" interview.txt   

The above command will usually print the total count of the word “Linux” in the file “interview.txt”. 

10.

Which command is used to count the number of characters in a file?

Answer»

The command that is used to COUNT the NUMBER of CHARACTERS in a file in LINUX is “wc”. Here “wc” stands for word count. It is used to count the number of LINES, words, and characters in a text file. 

11.

Which command is used to check the size of file or directory?

Answer»

The command USED to check the size of the file or DIRECTORY is “du”. Here “du” stands for disk usage that is used to check information of disk usage of files and directories on a machine. It is also used to DISPLAY files and directory SIZES in a RECURSIVE manner. 

Example:  
$ du -sh /var/log/*
1.8M /var/log/anaconda
384K /var/log/audit
4.0K /var/log/boot.log
0 /var/log/chrony
4.0K /var/log/cron
4.0K /var/log/maillog
64K /var/log/messages 

12.

Which command is used to check the default run level?

Answer»

The COMMAND USED to check the DEFAULT run level is “/etc/inittab”. 

13.

What is the ping command?

Answer»

Linux ping (Packet Internet Groper) command is a command that is used to check connection status between source and destination. In simple words, this command is used to check whether a network is available and if the HOST is reachable. It can also be used to troubleshoot different connectivity issues, VERIFY connectivity at an IP -level to a SECOND TCP/IP device, and NAME resolution. One can use this command to test both the computer name and IP address of the computer. 

14.

What is netstat command?

Answer»

netstat (Network statics) command is generally a networking tool being used for troubleshooting and configuration and used to display all network connections on a system. It simply PROVIDES a way to check WHETHER various aspects of TCP/IP are WORKING and what connections are PRESENT