0% found this document useful (0 votes)
45 views16 pages

Linux CPU Process Management Q&A

Uploaded by

Sanath Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views16 pages

Linux CPU Process Management Q&A

Uploaded by

Sanath Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

CPU INTERVIEW QUESTIONS:

1. How to check CPU utilization.

Ans: We can use below any one of the commands to check CPU Utilization:

TOP ,
Iostat,
vmstat

[Link] Executing CPU command what and all things you can able to see ????

Ans: users details, Load Average, physical memory , swap memory, uptime status,
%CPU, % MEM, which process is consuming High Utilizaton Etc.

[Link] to find which process is consuming High Utilization.

Ans: Based on CPU & MEM and we can see below which process is consuming high
process.

4. How to terminate / Kill current running Process ?

Ans: kill -9 (PID )

[Link] to kill the current running Process?

Ans: Kill - 9

6. how you will find current process id ?

Ans: using Top command , we can see process and its id's

Also we can check using this command : ( ps -ef | grep Process name ( Splunk / java
).

7. What does Kil -9 stands for ??

Ans:forecfully terminating the process.

8. How to check server Load Average ?

Ans: Top.

9. If Server Load average is High how you will bring it up to normal level ??

Ans: We can reduce the cache memory, We can find which process consuming high
utilization based on that we can kill that respective process.
10. Difference between physical/Virtual and Swap Memory ???

Ans:

11. what is meant by Zombiee Process in Linux ??

Ans:

A zombie process is a process whose execution is completed but it still has an


entry in the process table.
Zombie processes usually occur for child processes, as the parent process still
needs to read its child’s exit status.
Once this is done using the wait system call, the zombie process is eliminated from
the process table. This is known as reaping the zombie process.

12. Types of Process:

Ans:

1. OS related Process.= Defaulty running process in OS

2. Application related Process.

13. Types of Process we can kill usually in Real Time Production Environment:

Ans: uSually we will kill Application process like : Java process, Jboss Process,
Splunk Etc.

[Link] Time High CPU Utilization Troubleshooting steps:

Answer:

1. All our servers are configured to server Monitoring Tools like Sitescope or any
other tools.
2. Every server having Threshold value like 85 % or 90 % based on company out of
100%.
3. When server Exceeds the threshold value like 90 % above, we will get CPU alert
to our ticketing tool.
4. Then we need to login to the server and check CPU uasage by executing this
command: TOP.
5. Here you can see how much CPU utilizing and which process consuming more space.
[Link] you see CPU is having 10 gb , in out 10 gb currently 450 Mb is available and
9.5gb used then that cases we need to reduce the space on CPU.
[Link] need to check which process consuming more utilization, Then we need to
observer 5-10 mins if still CPU doesn't reducing.
[Link] the more consuming process id and kill it : Kill pid To kill the process:
Kill (Process id) If you want to kill the all running process : kill 0
[Link] usually most of the times we will not kill the process, we need to inform to
L3 team they will kill the required process.

15. Real Time High DISK Utilization Troubleshooting steps:

Answer:

1. All our servers are configured to server Monitoring Tools like Sitescope or any
other tools.
2. Every server having Threshold value like 85 % or 90 % based on company out of
100%.
3. When server Exceeds the threshold value like 90 % above, we will get DISK alert
to our ticketing tool.
4. Then we need to login to the server and check DISK uasage by executing this
command: df / df -h.
[Link] you can see which filesystem utilizing more like 90 % or 95%, after enter
into directory delete the log files.
df -f
cd (Filesystem name ) >> ls >>Logs >>ls >> find the 60 days old log files >> Rm -f
(Logfilename ).
Incase if you are not able to find the old log files, Sent mail to Application L4
team they will help us to reduce space on Disk.

16. How to check Disk space in Linux server ??

Answer: df -h / df

Troubleshooting steps in server:


df -h >> Here it will show all directories disk space like /var, /temp, /user,
/Log, /application logs.
Then we need to observe which file system/Directory utilizing more space >> cd
directoryname >> cd Logs >> ls >> rm -f Logfilename.

17. How to check Memory Utilization in Linux ??

Answer: Free -m or Free -h

Free -m : it shows memory in Mb's


Free -g : it shows Memory in GB's

Troubleshooting steps in server:

Once we executed the Free -m command in Linux server, we can able to see total how
much Virtual Memory and physical Memory consuming space,available, used space.

Real Time High Memory Utilization Troubleshooting steps:

Answer:

1. All our servers are configured to server Monitoring Tools like Sitescope or any
other tools.
2. Every server having Threshold value like 85 % or 90 % based on company out of
100%.
3. When server Exceeds the threshold value like 90 % above, we will get Memory
alert to our ticketing tool.
4. Then we need to login to the server and check Memory uasage by executing this
command: Free -m
5. Here you can see how much total memory space, used space , Available space and
cache/buffer space.
[Link] you see memory is having 10 gb , in out 10 gb currently 450 Mb is available
then that cases we need to reduce the space on memory.
7. If you check Application/Dev Team, They will let you know the path were we can
remove the log files or cache files or else they will only clear the space.

18. Default Port number for Http in Linux ?


Answer; For HTTP default port number: 80
FTP: 21
HTTPS:443
LDAP: 389
SSH:22
SFTP:22
RDP: 3389
SQL SERVER: 1433
rsync: 53

19. How to Establish connection between two Linux servers ?

Answer:
# Open the SSH terminal on your machine and run the following command: ssh
your_username@host_ip_address .
# If the username on your local machine matches the one on the server you are
trying to connect to,
# can just type: ssh host_ip_address. ...
# Type in your password and hit Enter

20. What is meant by Grep Command ??

Answer: The grep command is used to search text or searches the given file for
lines containing a match to the given strings or words.
By default, grep displays the matching lines.

21. How to find Logs files in linux ?

Answer: cd /var/log

Some of the most important Linux system logs include:

/var/log/auth. ...
/var/log/kern. ...
/var/log/cron

22. How to provide Ownership with read & write permissions to respective user ?

Answer: chmod 777 foldername will give read, write, and execute permissions for
everyone.

Permissions:

Every file and directory in your UNIX/Linux system has following 3 permissions
defined for all the 3 owners discussed above.

[Link]: 4
[Link]: 2
[Link]: 1

OWNERSHIPS:

The 'chown' command can change the ownership of a file/directory. Use the following
commands: chown user file or chown user:group file
The 'chgrp' command can change the group ownership chrgrp group filename.
23. How to rename the file ?

Answer: mv command is used both to change the name of a file and to move a file
into a different directory.

mv oldfile newfile.

24. How to check OS versions ??

Answer: Type any one of the following command to find os name and version in Linux:
cat /etc/os-release. ...
Type the following command to find Linux kernel version: uname -r.

25. How to find in which network the server is associated ??

Answer: traceroute. ..
ssh. ...
telnet.

26. What is the Difference between Find and Locate ?

Answer: Both the locate and find commands will find a file, but they work in quite
different ways.
locate will work in an offline mode
find will work in an online/"in real time" mode.

27. Difference between VGS & LVS ??

Answer: Physical Volume (PV): Consists of Raw disks or RAID arrays or other storage
devices.
Volume Group (VG): Combines the physical volumes into storage groups.
Logical Volume (LV): VG's are divided into LV's and are mounted as
partitions.

28. How to check current running process in server ?

Answer: PS Command ( Process status ).

29. What is the command to install Zabix in server ??

Answer: Yum, Rpm or [Link] can use anyone of these commands .

sudo yum zabix


sudo Rpm Zabix

30. Types of Files systems in Linux ??

Answer: Linux supports 100 types of File systems.


Most widely using file systesm are as follows : ext2 , ext3 , ext4, XFS.

31. Types of SSL Certifications in servers ?

Answer: we have two categories of SSL certificates :


[Link] certificates
[Link] certificates.

Again in both Internal & External certificates having three sub categories:

[Link] Certificate
[Link] certificate
[Link] card certificate.

In all three types of certificate , we use to create Key File, CSK file, PFM file,
CER File,CRT file as per user/Client requirements.

[Link] is the command to calculate the size of a Folder ?

Answer: du -sh ( Filename) .

33. Different mode Types of Vi Editor ?

Answer: 1. command mode


[Link] mode
3. Edit Mode

[Link] Process Management ?

Answer: There are two types of calls:

1. process call: Fork, Execute, wait, Exit


[Link] call : getpid,getppid

35. what is the use of tar Command ??

Answer: Tar is using for extracting or creating an archive folder.

36. Minimum number of partitions are used in Linux ?

Answer: 2.

37. How to copy a file in Linux ?

Answer: CP <source file > < Destination file >.

38. How to terminate a current running process in Linux ??

Answer: PS - it shows current running process


Kill ( processid) - it kills the current process.
kill -9 PID

39. How to find difference in two configuration files ?

Answer: diff <abc filname > < cde filename >

40. Types of Linux Directories ?

Answer:
pwd,ls, cd, mkdir, rmdir.

41. Types of shells available in Linux ??

Answer: Bash shell, Korn shell, C shell.

42. Types of users in Linux ??

Answer: [Link] user


[Link] user
[Link] user.

43. Types of Linux servers platforms ?

Answer: [Link] server


[Link] server.
3. Cloud server.

[Link] between Physical server and virtual server ?

PHYSICAL SERVER VIRTUAL SERVER

[Link] need for licensing purchase 1. VM software licenses


[Link] servers and additional equipment 2.A single physical server can host
multiple VMs, thus saving space
take a lot of space.
3. Poor capacity optimization 3. Advanced capacity optimization is
enabled by load balancing
[Link] Cost Efficiency. 4. Low cost Efficiency.

[Link] of Linux Distributions ??

Answer: [Link]
[Link]
[Link]
[Link].
[Link]
[Link]

46. Redhat versions Details:

Ans: Redhat 6, Redhat 7, Redhat 8

* Latest Redhat version available in the market : 9.0


* Current Redhat versions we have in market: 8.6

47. Centos Version Details:

Ans: Centos 7 and Centos 8

48. Difference between Physical Memory and Virtual Memory ?

Answer:

PHYSICAL MEMORY VIRTUAL MEMORY


[Link] actual Memory 1. A physical Memory.
[Link] [Link].
[Link] the swapping technique 3. uses paging
[Link] the size of RAM Chip [Link] by the size of
HARD Disk.

49. What are the basic components of Linux?

Answer: Kernal, shell, GUI, System Utilities, Application Programs.

50. Types of ls command and details ?

Answer: $ ls Example/

There are different options that can be used with the ls command. These options
give additional information about the file/ folder. For example:

-l lists long format (shows the permissions of the file)


-a lists all files including hidden files
-i lists files with their inode number
-s lists files with their size
-S lists files with their size and sorts the list by file size
-t sorts the listed files by time and date

51. How would you delete a directory in Linux?

Answer:

There are two commands that can be used to delete a directory in Linux.

rmdir
$ rmdir <directory name>

rm -rf
$ rm -rf <directory name>

Note: The command rm -rf should be used carefully because it will delete all the
data without any warnings.

52. How to schedule a task in Linux ?

Answer: Cron and at.

CRON: The cron command is used to repeatedly schedule a task at a specific time.
The tasks are stored in a cron file and then executed using the cron command.

AT: The at command is used to schedule a task only once at the specified time.

[Link] to identify which shell you are using?

Answer: Open the terminal and run: $ echo $SHELL


54. How can you login to another system in your network from your system?

Answer: SSH can be used for this. The Syntax is as follows: ssh <username>@<ip
address>

55. How do you check if a particular service in running?

Answer: service <servicename> status

56. How do you check the status of all the services?

Answer: service --status-all

57. How do you start and stop a service?

To start:
Answer: service <servicename> start.

58. What is a Root Account?


Answer: A Root Account is a system administrator account which helps in applying
complete control over the system.
It helps in creating and maintaining various user accounts and thereby
assign them different kinds of permissions as per each account.
It occurs by default whenever LINUX is installed.

59. Differentiate between LINUX and UNIX?

Answer:

LINUX UNIX

[Link] is an open source software 1. UNIX is an operating


system which is basically used in
Intel, HP, internet
servers, etc.
and free operating system used for computer
hardware & software, game development, PCs, etc.

2. File support system includes Ext2, Ext3, Ext4, 2. File support system
includes jfs, gpfs, hfs, etc.
Jfs, Xfs, Btrfs, FAT, etc.

3. Examples: Red Hat, Fedora, Ubuntu, Debian, etc 3. Examples: Solaris,


All Linux

4. BASH SHELL 4. Bourne shell.

60. What is the maximum length for any file name under LINUX?

Answer: The maximum length for any file name under Linux is 255 characters.

61. Enlist some Linux to file content commands?


Answer:

head: Displays the beginning of the file


tail: Displays the last part of the file
cat: Concatenate files and print on the standard output.
more: Displays the content in pager form and is used to view the text in the
terminal window one page or screen at a time.
less: Displays the content in pager form and allows backward and single line
movement.

62. Enlist some Linux networking and troubleshooting commands?

Answer:

Hostname: To view the hostname (domain and IP address) of the machine and to set
the hostname.
Ping: To check if the remote server is reachable or not.
ifconfig: To display and manipulate route and network interfaces. It displays
network configuration. ‘ip’ is the replacement of ifconfig command.
netstat: It displays network connections, routing tables, interface statistics.
‘ss’ is the replacement of netstat command which is used to get more information.
Traceroute: It is a network troubleshooting utility that is used to find the number
of hops required for a particular packet to reach the destination.

63. differences between Linux and Windows.?

Answer:

Windows Linux

Microsoft Corporation Linus Torvalds, community.


C++, Assembly Assembly language, C
Graphical Operating system family Unix-like OS family
Proprietary commercial software GPL(GNU General Public License)v2
and others.
Windows shell Unix shell

Important points:

( Threshold values nothing but cutoff period )


( Utilization is nothing used space )
(Mostly server having 85% or 90% threshold value, it will not cross the those
values if it cross will recieve Auto Alerts ).

64; @USER & GROUP Administration part in LINUX:

# user accounts creations: sudo usseradd <username >

# Group accounts creations: sudo groupadd <groupname >

# lock user accounts: usermod -L <username >

# Unlock the user Accounts: usermod -u <Username>

# Assigning the password to the users: sudo passwd <Username>


# Deleting a user: userdel -r <username>.

65. # Server logs deletions:

Check the disk space from the command line. Use the du command to see which files
and directories consume the most space inside of the /var/log directory. ...
Select the files or directories that you want to clear.

command: rm -f <Logfilename>

66. Failed to contact alerts / Node down alerts:

Answer:

#Agents installations: /opt/ov/bin/opcagt -status.

# service restarts on server: /opt/ov/bin/opcagt -restart

# certifications installations: /opt/ov/bin/ovcert -list

# license installations: /opt/ov/bin/olicense -get -all

# policies installations: /opt/ov/bin/ovpolicy -list.

67. File permissions:

[Link] = read, write, excute


[Link] = read, write, excute
[Link] = read, write, excute

read = 4

write = 2

excute = 1

read + write + excute = 4+2+1 = 7.

68. How to check Inodes in Linux ?

Answer: Command to check inodes: (df -i )

69. How to Compress the files in linux ?


Ans: Using command ( Gzip file name )

70. How to uncompress the Files in lINux ?


Ans: Using command ( Gunzip Filename )

71. How to check server Private / ip address: ( hostname -I )

72. how to check server public ip address: ( curl [Link] )


73. How to check server host details : ( Hostname )

74. How to reboot the server : sudo init6

75. How to copy the files from one server to another server ?

Ans: SCP @destination ip address Destination FileLocation

[Link] to check Redhat release version details:?

Ans: cat /etc/redhat-release: To check RHEL Version.

77. How to change the ownership of the file?

Ans: using Chmod command ( chmod filename username )

[Link] to delete the file content without deleting the File ?

Ans: > [Link] : To make log file null value.

[Link] to check file size ?

Ans: du -sh (File name ): it shows file size.

80. How to check Whole directory size and its file sizes.?

Ans: du -sk *: it shows only directories and file sizes.

81. Where Default Log files are stored in Linux?

Ans: cd /var/log : it shows default log files.

82. How to check server uptime status or last reboot time ?

Ans: uptime: To check server uptime status.

83. How to see the file content ??

Ans : using Less or More Commands

84: How to check first 10 lines of the file in linux ?

Ans: using Head command.

85. How to check last 10 lines of the file in linux ?

Ans: Using Tail Command

86. How to copy the files in linux server ?

Ans: Using CP command ( cp filename1 filename 2 )


87. How many servers are managing in your team?

Ans: We are managing 30 K servers in Whole Account.

88. What is meant by Daemon service in Linux ?

Ans:

A daemon is a background job or process responsible for a certain task or set of


tasks.
This is a fundamental concept to the Unix OS. The Unix kernel consists of numerous
system daemons that are responsible for memory management,
file system management, printer jobs, network connections, and several other
services.

89. Can you enlist some commonly used network commands?


Ans: Some commonly used networking commands in Unix are:

telnet: This is used for remote login and for communication with another hostname.
ping: This is used for checking network connectivity.
hostname: This gives the IP address and domain name.
nslookup: This performs a DNS query.
xtraceroute: This is used to determine the number of hops and response time
required to reach the network host.
netstat: This provides information about system and ports, routing tables,
interface statistics, etc.
tcpdump: This provides info about both incoming and outgoing network traffic.

90. You have an IP address in your network, how will you find the hostname and vice
versa?

Ans: nslookup command is used to query internet domain name servers which can be
used to find hostname from an IP address and for reverse lookup also,

Similarly host command can also be used.

91. How to check Hidden Files in Linux ?

Ans: Command to check Hidden Files ( Ls -a )

92. What is the process to count the number of characters and lines in a file?

Answer: “wc – c filename” command is used to retrieve the number of characters in a


file and the “wc –l filename” command is used to retrieve the number of lines in a
file.

93. Explain Linux booting Process?

Ans:

Every time you power on your Linux PC, it goes through a series of stages before
finally displaying a login screen that prompts for your username or password.
Have you ever wondered what happens behind the scenes from the time you press the
power button until the Linux login prompt appears?
The following are the 6 high level stages of a typical Linux boot process:

1. BIOS
[Link]
[Link]
[Link]
[Link]
[Link]

94. Eplain Run Levels in Linux ?

Ans:

Runlevel 0 shuts down the system.


Runlevel 1 is a single-user mode, which is used for maintenance or administrative
tasks. You may also see this mode referred to as runlevel S (the S stands for
single-user).
Runlevel 2 is a multi-user mode. This runlevel does not use any networking
services.
Runlevel 3 is a multi-user mode with networking. This is the normal runlevel you
are used to if you use a system that doesn’t boot into a GUI (graphical user
interface).
Runlevel 4 is not used. The user can customize this runlevel for their own purposes
(which we will cover how to do later in the article).
Runlevel 5 is the same as runlevel 3, but it also starts a display manager. This is
the runlevel you are using if you use a system that boots into a GUI.
Runlevel 6 reboots the system.

95. Command mode:

gg To go to the beginning of the page


G To go to end of the page
w To move the cursor forward, word by word
b To move the cursor backward, word by word
nw To move the cursor forward to n words (5W)
nb To move the cursor backward to n words (5B)
u To undo last change (word)

U To undo the previous changes (entire line)


Ctrl+R To redo the changes
yy To copy a line
nyy To copy n lines (5yy or 4yy)
p To paste line below the cursor position
P To paste line above the cursor position
dw To delete the word letter by letter (like Backspace)
x To delete the world letter by letter (like DEL Key)
dd To delete entire line
ndd To delete n no. of lines from cursor position(5dd)
/ To search a word in the file

96: Extended Mode: ( Colon Mode) :

Extended Mode is used for save and quit or save without quit using “Esc” Key with
“:”

Esc+:w To Save the changes


Esc+:q To quit (Without saving)
Esc+:wq To save and quit
Esc+:w! To save forcefully
Esc+wq! To save and quit forcefully
Esc+:x To save and quit
Esc+:X To give password to the file and remove password
Esc+:20(n) To go to line no 20 or n
Esc+: se nu To set the line numbers to the file
Esc+:se nonu To Remove the set line numbers

97. what is meant by UMASK in Linux ?

Ans: When we create any file using touch, cat or vi commands they get created with
default file permissions as stored in umask(User file creation mask).
umask is a 4 digit octal number which tells Unix which of the three permissions are
to be denied rather than granted.
Umask will decide that what should be the default permissions for a file and
directory when it is created.
The default umask value is 0022
#umask

98, What is Ulimit command in Linux ?

Ans:

The ulimit command sets or reports user process resource limits. The default limits
are defined and applied when a new user is added to the system.
Limits are categorized as either soft or hard. With the ulimit command, you can
change your soft limits for the current shell environment, up to the maximum set by
the hard limits.
You must have root user authority to change resource hard limits

99. What is stickybit in Linux ?

Ans: In Unix-like operating systems, a sticky bit is a permission bit which is set
on a file or folder, thereby permitting only the owner or root user of the file or
folder to modify, rename or delete the concerned directory or file.

100. What is meant by Lilo stands for linux and its types ?

Ans: Lilo stands for ( The Linux Loader

[Link] between Soft Link & Hard Link ?

Ans:

Hard Link:

[Link] links are faster


2.A hard link acts as a copy (mirrored) of the selected file. It accesses the data
available in the original file.
[Link] the earlier selected file is deleted, the hard link to the file will still
contain the data of that file

Soft Link:

[Link] acts as a slower


2.A soft link (also known as Symbolic link) acts as a pointer or a reference to the
file name.
It does not access the data available in the original file. If the earlier file is
deleted, the soft link will be pointing to a file that does not exist anymore.

102. systemd vs init in linux ?

Ans: Init and Systemd are both init daemons but it is better to use the latter
since it is commonly used in recent Linux Distros.

Init uses service whereas Systemd uses systemctl to manage Linux services.

103. What is SE Linux ?

Ans:

Security-Enhanced Linux (SELinux) is a security architecture for Linux® systems


that allows administrators to have more control over who can access the system.

It was originally developed by the United States National Security Agency (NSA) as
a series of patches to the Linux kernel using Linux Security Modules (LSM).

104. Standard Streams in linux ?

Ans: There are 3 type of standard streams; standard input (stdin), standard output
(stdout) and standard error (stderror).

105. SAR logs in linux ?

Ans: The name "sar" stands for "system activity report," and it can display current
performance,

provide reports that are based on log files stored in your system's /var/log/sa (or
/var/log/sysstat) folder, or be set up to automatically produce daily reports.

106. NFS Port Number in linux ?

Ans: 2049

107.

You might also like