18.01.2020 Views

Working with Linux

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ps aux: This prints all processes with PID

| grep nautilus: Find the ones matching nautilus

| grep -v grep: Inverts grep to exclude the grep process

| awk '{print $2}': Selects the second word in the line, which is the PID

| xargs kill: Here xargs is used to distribute each PID to a kill command. It is especially

used for commands that do not read arguments from standard input.

Now we've killed nautilus. This was purely a demonstrative example. There are other ways of

doing this.

Let's open nautilus again and send it to the background by hitting Ctrl + Z followed by the bg

command.

Now let's run the following command:

pgrep nautilus

To see all the pids of nautilus and to send the kill signal to all those processes, use the following

command line:

pkill nautilus

Now it's time for some networking! You probably know the ifconfig command, which is used to

print information about the network interfaces. To get the IP address of a specific interface (in our

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!