Everyday Guidebooks
Cover of Linux for Beginners

Cybersecurity & IT

Linux for Beginners: Find and Manage Running Programs

A Hands-On Terminal Guide to Processes, Jobs, CPU, Memory, and Signals

by Todd Michael

Available now

A command that seems stuck, a computer that feels slow, or a screen full of unfamiliar process names can leave a new Linux user wondering what to do next. This focused guide to linux for beginners makes running programs easier to understand and manage from the terminal.

Learn to find processes with ps, top, pgrep, and related tools; read CPU and memory figures without jumping to conclusions; and move jobs between the foreground and background. Step-by-step examples show how process IDs, parent processes, and signals fit together, while safe practice exercises let you try commands before using them on important work.

You will also learn a measured approach to an unresponsive program: identify the right process, request a graceful stop, check the result, and escalate only when necessary. Whether you are building everyday terminal confidence or practicing for an entry-level Linux certification, this book gives you a focused set of skills you can use immediately.

Contents
  1. 1. Your Terminal Practice Environment
  2. 2. What Happens When a Program Runs
  3. 3. Finding Processes with ps
  4. 4. Searching and Following Process Relationships
  5. 5. Watching a Changing System
  6. 6. Making Sense of CPU Activity
  7. 7. Making Sense of Memory Use
  8. 8. Foreground Jobs and Terminal Control
  9. 9. Background Jobs and Shell Sessions
  10. 10. Signals: Requests to Running Processes
  11. 11. Stopping an Unresponsive Program Safely
  12. 12. Investigating Common Process Situations
  13. 13. Processes Beyond Your Interactive Shell
  14. 14. Capstone Labs and Skills Review
  15. Other Books by Todd Michael

Read a sample: 1. Your Terminal Practice Environment

A terminal can look unforgiving when you are new to Linux. It presents a prompt, waits for you to type, and often answers in a few terse lines—or with no visible message at all. The good news is that you do not need to understand the whole operating system before you begin. You need a place to practice, an ordinary user account, and a few habits that make your actions deliberate.

In this chapter, you will prepare that workspace and learn how to check a command before using it. The examples are intentionally modest: you will identify your current user and location, create a practice directory, and read help. These foundations will make the process-management exercises later in the book easier to follow and safer to repeat.

You can work through this book on a Linux computer, in a Linux virtual machine, or in a compatible Linux environment provided through another operating system. A virtual machine is a useful choice if you want a separate practice system: it runs Linux as a guest operating system on your existing computer. If you are using a shared computer or a remote server, make sure you have permission to practice there and follow the administrator’s rules.

A desktop installation usually provides a terminal application through its application menu. Open it, and you should see a window containing text and a prompt. On a server, you may reach a text-based login or connect through a remote terminal session instead. The appearance can vary considerably, but the basic interaction is the same: the shell displays a prompt, you enter a command, and the shell attempts to run it.

For the exercises, use an ordinary user account rather than logging in as the administrator account, traditionally named root. An ordinary account can inspect and manage many of its own activities while being restricted from changing protected parts of the system. Those restrictions are helpful guardrails, not an obstacle to learning.

You may encounter instructions elsewhere that begin with sudo. That command requests elevated privileges when the system is configured to allow them. You do not need it for the practice in this chapter. Later, if a command reports a permission problem, do not automatically add sudo and try again. First ask what the command is intended to do, which resource it targets, and whether you have authorization to act on it.

The terminal is the window or connection through which you type. The shell is the program that reads your commands and starts other programs. Many Linux systems use Bash for interactive work, although other shells are available.

A prompt might look something like this:

text morgan@practice:~$

In this example, morgan is the user name, practice is the computer name, and ~ represents the user’s home directory. The dollar sign commonly marks a prompt for an ordinary user. The exact text, colors, and symbols are configurable, so your prompt may look different.

You may also see a prompt ending in #, which commonly indicates a root shell. Prompt symbols are not a reliable identity check on their own, however; they can be customized. To check the account associated with your current session, enter:

bash whoami

Press Enter after the command. On the example system, the result might be:

text morgan

Throughout this book, command examples show what you should type, without a leading prompt. Output appears separately when it is useful. Do not type the example user name or computer name unless an exercise specifically asks you to; your system will have its own values.

If whoami reports root, switch to an ordinary account before continuing. In a managed environment, ask the administrator how to obtain an appropriate practice account. If you deliberately opened an elevated shell, leave it according to your system’s instructions and verify your identity again in the ordinary shell.

The shell is ready for another command when its prompt returns. Some commands finish almost immediately. Others keep running or wait for input. Later chapters explore how to recognize and control those situations; for now, allow each command to finish before entering the next one.

A shell has a current working directory: the location it uses as the starting point for many file operations. Display yours with:

bash pwd

The name stands for “print working directory.” You might see:

text /home/morgan

Your result will probably contain a different user name or a different path. A path beginning with / describes a location from the root of the filesystem. The filesystem root, written as /, is a location; it is not the same thing as the root user account.

Now list the names in your current directory:

bash ls

You might see familiar directories, such as Documents or Downloads, or you might see no output. An empty display does not necessarily mean something went wrong: it can simply mean there are no visible entries to list.

Commands and names in Linux are generally case-sensitive. Type pwd, not PWD, and pay attention to capitalization in directory names. Spaces also matter because the shell uses them to separate parts of a command. If you receive an error, compare what you typed with the example before assuming the system is broken.

To return to your home directory at any time, use:

bash cd

The cd command changes the shell’s working directory. On success it normally prints nothing. Run pwd again to see where you are. That small…

More Cybersecurity & IT

Cover of The White Hat Bible, Volume 1The White Hat Bible, Volume 1Available nowCover of The White Hat Bible, Volume 2The White Hat Bible, Volume 2Available nowCover of The White Hat Bible, Volume 3The White Hat Bible, Volume 3Available nowCover of The White Hat Bible, Volume 4The White Hat Bible, Volume 4Available nowThe White Hat Bible, Volume 5Available nowCover of The White Hat Pocket GuideThe White Hat Pocket GuideAvailable now

About Todd Michael

Todd Michael is an American author and the founder of ToddMichael.tv. He writes practical, plain-English books on money, health, preparedness, technology, games, humor and more.

About the author Todd Michael · Todd Michael’s author site

Part of the ToddMichael.tv network.