pidof Command in Linux with Examples Last Updated : 26 May, 2022 Comments Improve Suggest changes Like Article Like Report pidof command is used to find out the process IDs of a specific running program. It is basically an identification number that is automatically assigned to each process when it is created. Syntax: pidof [options] program1 program2 ... programNWorking with Pidof Command 1. To find pid of any process pidof bash Use the name of the program as input to the command and command produced bash process ID in the output. 2. To get only one pid of a program pidof -s bash By default, pidof displays all pids of named command or program. So to display only one process ID of the program we have to pass "-s" option with it. 3. To get pids of scripts pidof -x bash The pidof command does not display pids of shell/perl/python scripts. We use the "-x" option to find the process ids of shells running the named script called bash. 4. To limit output based on the root directory pidof -c bash If we want that pidof returns only process ids that are running with the same root directory, we use "-c" command-line option. Note: This option is ignored for non-root users, as they are unable to check the current root directory of processes they do not own. 5. To omit processes pidof -o 87223 bash If we want to ignore or omit processes with that process id, we can use pidof command to this. This is useful to ignore calling shell or shell script or specific pid. Here, it says we want to find all pids of bash and omit pid #87223. So, we use the given code for that. 6. To find pid of a program and kill it p=$(pidof chrome) kill $p In this, firstly we find all PIDs of chrome server and then kill it. Comment More infoAdvertise with us Next Article pidof Command in Linux with Examples khu5h1 Follow Improve Article Tags : Technical Scripter Linux-Unix linux-command Linux-system-commands Similar Reads more command in Linux with Examples The 'more' command in Linux is a useful tool for viewing text files in the command prompt, particularly when dealing with large files like log files. It displays the content one screen at a time, allowing users to scroll through the text easily. This command is especially handy for reviewing long ou 3 min read How to Mount File System in Linux | mount Command Working with file systems is a fundamental part of managing a Linux system, and knowing how to mount them is a skill every Linux user should have. Whether youâre connecting a USB drive, accessing a network share, or setting up a new partition, the mount command is your go-to tool for making file sys 6 min read mpstat Command in Linux with Examples mpstat is a powerful and versatile command-line tool within a Linux system that allows detailed reporting of various processor-related statistics. Indeed, part of the sysstat package, mpstat delivers comprehensive CPU utilization and performance data, thus becoming an essential utility for both syst 5 min read How to Move File in Linux | mv Command In UNIX-based operating systems like Linux and macOS, `mv` stands for "move". The mv command is a UNIX command for renaming and moving files and directories within a filesystem. Although desktop operating systems have graphical user interfaces for file operations, calling mv in the terminal, usually 7 min read Practical Uses of nc(netcat) command in Linux Netcat is one of the most powerful networking tools, security tools, and network monitoring tools. It is even considered a Swiss army knife of networking tools. It acts like a cat command over a network. It is generally used for the following reasons:Operation related to TCP, UDP, or UNIX-domain soc 7 min read Netstat command in Linux The netstat command is like a special tool in Linux that helps you understand and check things about how your computer connects to the internet. It can tell you about the connections your computer is making, the paths it uses to send information, and even some technical details like how many packets 7 min read Manage Network Connections From the Linux Command Line with nmcli Network connectivity is a critical aspect of modern computing, and Linux provides a robust command-line tool for managing network connections: nmcli. Network Manager Command-Line Interface (nmcli) is a powerful and versatile utility that allows users to control and configure network settings directl 5 min read Nslookup Command in Linux with Examples Nslookup (stands for âName Server Lookupâ) is a useful command for getting information from the DNS server. It is a network administration tool for querying the Domain Name System (DNS) to obtain domain name or IP address mapping or any other specific DNS record. It is also used to troubleshoot DNS- 6 min read od command in Linux with example The od (octal dump) command in Linux is a versatile tool used to display file contents in various formats, with the default being octal. This command is particularly useful for debugging scripts, examining binary files, or visualizing non-human-readable data like executable code. It allows users to 6 min read How to Change User Password in Linux | passwd Command Securing user accounts is a fundamental aspect of maintaining a robust and secure Linux system. One essential task is changing user passwords regularly to prevent unauthorized access. The passwdpasswd command in Linux provides a straightforward and effective way to modify user passwords. This articl 8 min read Like