01 - Mithun Technologies-Linux-Interview-Questions&Answers - 2021
01 - Mithun Technologies-Linux-Interview-Questions&Answers - 2021
01 - Mithun Technologies-Linux-Interview-Questions&Answers - 2021
QUESTIONS
Mithun Technologies, +91 99809 23226, devopstrainingblr@gmail.com
1) What command is used to count the total number of lines, words, and characters
contained in a file?
A. countw
B. wcount
C. wc
D. count p
B. rm
C. delete
D. erase
B. remove
C. rd
D. rmdir
Ans)
B. y
C. a
D. z
Ans)
5)Which of the following command can you execute to count the number of lines in a file?
A. lc
B. wc - l
C. cl
D. count
Ans)
B. mail
C. mesg
D. write
B. ps
C. du
D. pid
B. dir
C. lp
D. ls
Ans) ls
Ans)who
15. What command is used to get the ip address of all interfaces on a server?
Ans)
18. What command(s) shows you disk partitions and percentage of disk space
used?
Ans)
19. What command shows you how long it has been since the server was
rebooted?
Ans)
20. What command shows you what directory you are in?
Ans)
23. What command shows you CPU and memory utilization for running
processes?
Ans)
24. What command allows you to open and view a file one page at a time?
Ans)
Test - 2
1) What can you type at a command line to determine which shell you are using?
Ans)
2) What is RPM?
Ans)
3) What is apt-get?
Ans)
6) What is the command to display the user information like (users login name, real
name, terminal name,shell)
Ans)
8) What is the command to display the jobs that you are running in the background
and in the foreground?
Ans)
10) What is the command which will gives the description about any command?
Ans)
Test 3
What is mkdir command and what is the -v, -p and -m options with mkdir command?
Ans)
What is cd -?
Ans)
What is cd ~?
Ans)
What is cd?
Ans)
How to search the files with various conditions like empty files, based on size...?
Ans)
What is Umask?
Ans) Default file and directory permissions.
when you select single partition for single folder for backup on your server.
Ans)
/etc/resolve.config
Explain and if we not declared here what will happen?
Ans)
How you will find out memory details and explain about swap memory?
Ans)
Write a command for 5 days older files with extension of .log , those files want to move it
different directory?
Ans)
Booting process? Explain about run levels? what is default run levels?
Ans)
What is NFS?
Ans)
I have a file in some location. How to find that file. in that file how to display the
What is SSL?
Ans)
What is GRUB?
Ans)
Explain soft link and hard link? What is the difference? When you use?
Ans)
How will you find out what are the files using by particular process?
Ans)
Ans) D
Using command substitution, how would you display the value of the present working
directory?
A) echo $(pwd)
B) echo pwd
C) $pwd
D) pwd|echo
Ans) A
Explanation: The echo command can be used to display the contents of variables. The present
working directory is held in the pwd variable. echo $(pwd) will display the contents of the pwd
variable. Other commands that would work are echo $ PWD and echo “$PWD”.
Reference: http://www.bolthole.com/solaris/ksh-beforeyoustart.html
Incorrect Answers:
Which file contains the default environment variables when using the bash shell?
A) ~/.profile
B) /bash
C) /etc/profile
D) ~/bash
Ans) C
Explanation:
The /etc/profile file contains the system default environment variables for the bash shell.
What is Crontab?
Ans)
Otherethan LILO , we have LOADLIN (LOAD LINux) and GRUB (GRand Unified Bootloader).
Ans)
Which of the following is the BEST way to set up SSH(Secure Shell) for communicating
between Systems without needing passwords?
Ans)
Given a file, replace all occurrence of word "mithun" with "manan" from 5th line till end in
only those lines that contains word "ruthvik"
Ans)
Given file is mithuntechnologies.txt
sed -n `5,$p` mithuntechnologies.txt | sed '/ ruthvik/s/ mithun/manan/
1) In Ubuntu server I have fired a command “cat /etc/lsb-release”, what it will gives me?
Ans) It will give the version of the software and release name like below.
uname -a : it will print all information like kernel-name, kernel-release, node hostname…etc
3) Let say that I have one shell script, I wanted to be executed whenever the system boot
time, it should not be executing at any other time, it exacted only boot time. In this scenario
what will do?
Ans)
4) What is the difference between bash_profile and bashrc file in user home directory?
Ans)
#cat /etc/shadow
10) What configuration we have to set to do for normal user and root user differentiation?
Ans)
11) There is some settings which makes doesn’t show some advanced commands to
normal user? What are those settings?
Ans)
16)How to check one software where is installed in Linux machine? Suppose take Jenkins.
Ans)
17)How to set the path which is accessible by the all the users?
Ans)
#cat /proc/loadavg
#w
#uptime
#top
load average 3.00 in prod server, but things are running fine? What is this?
Ans) On multi-processor system, the load is relative to the number of processor cores available. The
"100% utilization" mark is 1.00 on a single-core system, 2.00, on a dual-core, 4.00 on a quad-core,
etc.
A load of 1.00 is 100% CPU utilization on single-core box. On a dual-core box, a load of 2.00 is 100%
CPU utilization.
25)What is Inode?
Ans) Inode is a data structure that contains information of a file.
The inode contains a list of all the blocks in which a file is stored, the owner information
for that file, permissions, and all other attributes that are set for the file. In a sense, you
could say that a file really is the inode, and names are attached to these inodes to make
it easier for humans to work with them.
To set the sticky bit for file or directory will follow like below.
chmod +o file/directory
example:
chmod o+devops.txt
chmod 1777 devops.txt
After setting Sticky Bit to a file/folder, if you see ‘T’ in the file permission area that indicates the
file/folder does not have executable permissions for others on that particular file/folder.
A process starts its life in an R "running" state and finishes after its parent reaps it from the Z "zombie"
state.
With help of top or ps command we can find the process is in which state.
28)What is process?
Ans) A process is an instance of a program that is being executed. Processes are also frequently
referred to as tasks. OR A process is the execution context of a running program.
29)What is thread?
Ans) Threads are "light weight processes" (LWPs).
31)How to find the empty directories in the current directory and need to delete?
Ans) find . -type d -empty -delete
33)How to find the empty lines in particular file and need to remove?
Ans) With help of sed command.
37)what is chmod?
Ans) chmod (change mode) is used to set the permissions for files and directories.
A background process will not stay alive after the shell session is closed. SIGHUP terminates all
running processes. By default anyway. If your command is long-running or runs indefinitely you
need to prefix it with nohup so it remains running after you disconnect from the session, as follows.
Network layer firewalls define packet filtering rule sets, which provide highly efficient security
mechanisms.
Virtual memory is a combination of RAM and disk space that running processes can use. Swap
space is the portion of virtual memory that is on the hard disk, used when RAM is full.
What is the difference between hardlinks and symlinks? What happens when you remove
the source to a symlink/hardlink?
Ans)
Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is free
space.
Ans)
Describe a scenario when deleting a file, but 'df' not showing the space being freed.
Ans)
What happens to a child process that dies and has no parent process to wait for it and what’s
bad about this?
Ans)
What key combination can you press to suspend a running job and place it in the
background?
Ans) ctrl + z
You can suspend a currently running job by using the Ctrl + z keystroke. This will stop the job,
but it won’t end it. The job will be available to be resumed. Note: you can only stop jobs that were
started in your current shell.
Which of these tools can provide the most information about DNS queries?
A. dig
B. nslookup
C. host
D. named-checkconf
E. named-checkzone
Ans) A
https://vceguide.com/which-file-contains-a-list-of-filesystems-that-can-be-currently-mounted-
on-the-system/
How to create users in linux and how to give sudo permissions to user?
Ans) Using useradd command we can create a user.
Using visudo command we can give sudo access.. add user into /etc/sudoers file to provide the
sudo access.
Write a script/command to find the files with more than 1gb size.
Ans)
find <path for directory> -size +1G -type f
What command is used to check the number of files, disk space and each user’s defined quota?
Ans)
How you can run a Linux program in the background simultaneously when you start your Linux
Server?
Ans)