Linux Level 3: Software and Processes
Install software, monitor processes, and build an admin toolkit script.
Introduction
30 Second Summary
Every app on your phone was downloaded from a store, and if it freezes, you force-quit it. Linux gives you that same control from the terminal.
In this project, you will install and remove software from the terminal, monitor every running process on your system, and write a shell script that prints a system report with a single command. By the end, you will have a personal admin toolkit that proves you can manage a real Linux system.
What You'll Build
You will run a single script and watch your terminal print a formatted report. It shows your username, today's date, how many packages are installed, and the top 10 processes eating the most CPU.
By the end of this project, you'll have:
- Install and remove software from the terminal, verify exactly what is on your system at any time, and clean up leftover dependencies automatically.
- Monitor every running process in real time, sort by CPU or memory usage, and track down any specific program by name.
- Control processes from the terminal by starting, stopping, pausing, resuming, and force-quitting programs without touching the mouse or rebooting.
- Secret Mission: Build a complete admin toolkit with a sysinfo.sh script, proper file permissions, and team sharing with a new user account.
Are there any prerequisites?
This project builds on skills from Linux Level 1 and Linux Level 2. You should be comfortable with terminal navigation, file operations, sudo, permissions, and pipes before starting.
Before We Start
You are about to learn two of the most practical Linux skills: managing software and controlling processes. Before diving in, let's lock in what you're building and why it matters.
Warm Up and What Are Packages
Your Linux Mint system already has hundreds of programs installed, from the desktop environment to the terminal itself. Before you start adding new tools in the next step, you need to understand what these programs are and how Linux manages them.
In this step, you will warm up your terminal skills with a quick challenge from Levels 1 and 2. Then you will explore the world of Linux packages and learn how to keep your system's software catalog up to date.
In this step, get ready to:
- Run a warm-up challenge using commands from Levels 1 and 2.
- Learn what Linux packages are and discover how many are already on your system.
- Refresh your package list with sudo apt update.
Open Terminal and run a warm-up challenge
Time to test your skills from Levels 1 and 2. You will create a project folder, add a file inside it, and capture a directory listing to a report file.
- Open Terminal by clicking the terminal icon in the taskbar at the bottom of your screen. If you do not see a terminal icon there, click the Applications Menu in the bottom-left corner, navigate to System, and click Terminal.
- Create the linux-lab3 folder in your home directory and an empty notes.txt file inside it by running these commands:
mkdir ~/linux-lab3
touch ~/linux-lab3/notes.txt
- Confirm both were created by running:
ls ~/linux-lab3
You should see notes.txt listed in the output.
- Pipe a detailed listing into a report file by running this command:
ls -la ~/linux-lab3 | tee ~/linux-lab3/folder-report.txt
What does this command do?
- ls -la ~/linux-lab3 creates a detailed listing of the folder, showing permissions, owner, size, and timestamps.
- The | pipe sends that listing to tee, which writes it to folder-report.txt AND prints it on your screen at the same time.
- Verify the report was saved by running:
cat ~/linux-lab3/folder-report.txt
You should see the same detailed listing, including notes.txt and folder-report.txt with their permissions, sizes, and timestamps.
Not seeing the expected files?
- Make sure you ran mkdir ~/linux-lab3 before trying to create files inside it. The folder must exist first.
- Check for typos in the folder name. Linux paths are case-sensitive, so linux-lab3 and Linux-Lab3 are completely different folders.
- Why can't I see my files in linux-lab3?
Discover what packages are
Your Linux system did not come empty. It arrived with hundreds of programs already installed, from the desktop environment to the text editor to the terminal itself.
What is a package?
A package is a bundle of files that make up a program, similar to an app in an app store. It includes the program itself, plus instructions for where to put its files and what other packages it needs to work.
apt is the store manager. It fetches packages from official Linux Mint servers called repositories (also known as "mirrors") and handles installing, updating, and removing them for you.
Before you run the next command, take a guess. How many packages do you think your system already has installed? 10? 100? More?
- See how many packages are already installed on your system by running:
apt list --installed 2>/dev/null | wc -l
What does this command do?
- apt list --installed lists every package currently on your system.
- 2>/dev/null silences a warning message that apt prints when used in a pipeline. You learned this redirect syntax in Level 2.
- | wc -l counts the number of lines in the output, giving you the total package count.
You should see a number somewhere between 1,500 and 2,500. Your system came pre-installed with all of these packages.
Refresh the package list
Your system keeps a local catalog of available packages. Over time, new versions are released and new packages become available. You need to refresh this catalog before installing anything new.
- Update your package list by running:
sudo apt update
What does this command do?
- sudo apt update downloads the latest list of available packages from Linux Mint's online repositories.
- Each line in the output shows a repository being checked. You may see words like "Hit" (already up to date), "Get" (downloading new info), or "Ign" (skipped).
- This command does not install anything. It only refreshes the catalog so apt knows what software is available and what the latest versions are.
You should see several lines of output ending with a summary like "All packages are up to date" or a count of upgradeable packages.
Seeing an error with apt update?
- Unable to lock the dpkg frontend lock or Unable to acquire the dpkg frontend lock means another program is already using apt. Close Update Manager or Software Manager if either is open, then try again.
- Permission denied means you forgot sudo at the start of the command. Run sudo apt update instead of apt update.
- Why is my sudo apt update command failing?
Why does apt list work without sudo, but apt update needs it?
apt list --installed only reads information that is already on your system, so any user can run it. sudo apt update downloads new data from the internet and writes it to system files, so it needs administrator privileges.
Your terminal is warmed up and your package catalog is fresh. Next up, you will install your first new tools straight from the command line.
Install Software with apt
Your system already has hundreds of packages installed, but you need specific tools for this project. tree visualizes directory structures and htop monitors running processes in real time.
Right now, you do not know how to find or install them. In this step, you will learn the full workflow: searching for a package, inspecting it, installing it, and verifying it works.
In this step, get ready to:
- Search for and inspect packages before installing them.
- Install tree, htop, and sl using apt.
- Practice the full search-inspect-install-verify cycle independently.
Search for and install the tree and htop packages
Before installing anything, it is good practice to search for the package and inspect its details. This tells you the exact name, version, and size before you commit.
- Search for the tree package by running this command:
apt search tree
You should see a list of packages with "tree" in their name or description. Each result shows the package name on the left and a short description on the right.
- Inspect the tree package before installing by running:
apt show tree
What does apt show tell you?
This command displays detailed information about a single package. Look for these key details:
- Version tells you exactly which release you will get.
- Installed-Size shows how much disk space the package needs.
- Depends lists other packages it needs to work (its dependencies).
- Install tree by running this command:
sudo apt install tree
What is the Y/n prompt?
After running this command, apt may ask Do you want to continue? [Y/n]. This is a normal confirmation prompt, not an error. Type Y and press Enter, or just press Enter on its own since Y is the default.
- Test that tree is working by running:
tree ~/linux-lab3
You should see a tree diagram of your linux-lab3 directory showing notes.txt and folder-report.txt with lines connecting them.
Seeing E: Unable to locate package?
This error means the package name is misspelled or apt has not refreshed its list recently. Double-check the exact package name with apt search and make sure you ran sudo apt update in the previous step.
help me fix an Unable to locate package error when running sudo apt install
- Install htop the same way by running:
sudo apt install htop
- Verify the installation by running:
htop --version
You should see the htop version number printed in the terminal, confirming it is ready to use.
Install a fun package to practice the workflow
Now that you have the core tools installed, practice the same workflow with a fun package called sl. It is small, harmless, and gives you something entertaining to look at.
- Install sl by running:
sudo apt install sl
Before you run the next command, what do you think sl does? Take a guess, then try it.
- Run your new package by typing:
sl
A steam locomotive chugs across your terminal. This is sl ("steam locomotive"), a playful package originally created as a joke for people who mistype ls.
- Confirm sl appears in your installed packages by running:
apt list --installed | grep sl
What do the output columns mean?
The output looks something like sl/jammy,now 5.02-1 amd64 [installed]. Here is what each part means:
- sl/jammy is the package name and the repository it came from.
- 5.02-1 is the version number.
- amd64 is the CPU architecture it was built for.
- [installed] confirms the package is currently on your system.
Try the full search-install-verify cycle on your own
You have installed three packages by following instructions. Now practice the complete cycle on your own by choosing a package, searching for it, installing it, and verifying it works.
✔️ I'll give it a go!
Pick one of these fun packages to try:
- cowsay prints a message inside a speech bubble from an ASCII cow.
- figlet turns text into large ASCII art banners.
- cmatrix fills your terminal with Matrix-style falling characters.
Follow the four-step cycle: search for it with apt search, inspect it with apt show, install it with sudo apt install, then run it and verify with apt list --installed | grep <name>.
ⓧ Maybe a little help...
Here is the full walkthrough using cowsay as an example.
- Search for the package by running:
apt search cowsay
- Inspect it by running:
apt show cowsay
- Install it by running:
sudo apt install cowsay
- Try it out by running:
cowsay "Hello from Linux Mint"
- Verify it is installed by running:
apt list --installed | grep cowsay
You should see cowsay listed with [installed] at the end.
Package not working after install?
Make sure you typed the package name exactly as shown in the apt search results. Some packages have unexpected names. For example, the cmatrix package is lowercase with no spaces or hyphens.
help me troubleshoot why my installed package is not running
Before you move on, do you think tree --version and htop --version will still work if you run them again? Try both to confirm.
- Confirm all your core tools are still installed by running:
tree --version
htop --version
Both commands print their version numbers, confirming tree and htop are ready for the rest of the project.
You can now find, inspect, install, and verify any package on your system. Next up, you will learn how to cleanly remove packages you no longer need.
Remove Software Cleanly
In Step 2, you installed packages like tree, htop, and sl. That sl package was fun to watch, but you do not need a steam locomotive crossing your terminal every day.
Keeping unnecessary software on your system wastes disk space and clutters your package list. In this step, you will learn how to remove packages cleanly and sweep up any leftover dependencies that no longer serve a purpose.
In this step, get ready to:
- Remove an installed package with sudo apt remove.
- Clean up orphaned dependencies with sudo apt autoremove.
- Understand the difference between apt remove and apt purge.
Remove the sl package
Be careful with apt remove
apt remove permanently uninstalls software from your system. You can always reinstall later with sudo apt install, but the program stops working immediately.
When you run the command, apt will ask Do you want to continue? [Y/n]. Press Enter to accept.
- Remove sl from your system by running this command:
sudo apt remove sl
What does this command do?
- sudo grants admin permission to modify installed software.
- apt remove sl tells the package manager to uninstall the sl package and free up its disk space.
- Verify sl is gone by trying to run it:
sl
You should see a message containing command not found in the output. The steam locomotive is officially retired.
Package not removed?
If you see Package sl is not installed, so not removed, the package was already removed or was never installed. Double-check with apt list --installed | grep sl.
If you see Unable to lock the apt directory, another program is using apt. Close Software Manager, Update Manager, or Synaptic Package Manager and try again.
Why can't I remove the sl package with apt?
What is the difference between remove and purge?
apt remove deletes the program but keeps its configuration files in case you reinstall later. apt purge deletes the program and all its configuration files.
For most packages, apt remove is all you need. Use apt purge only when you want a completely clean slate with no leftover settings.
Clean up orphaned dependencies
When you install a package, apt sometimes pulls in extra helper packages called dependencies. When you remove the main package, those helpers might still be sitting on your system doing nothing.
- Clean up any leftover dependencies by running this command:
sudo apt autoremove
What does apt autoremove do?
apt tracks which packages were installed automatically as dependencies of other packages. autoremove finds the ones that no other installed package needs anymore and removes them.
If there were orphaned packages, you will see them listed and removed. If the system is already clean, you will see 0 to remove. Both outcomes mean your system is in good shape.
- Check the output in your terminal.
You should see either a list of packages being removed, or a message confirming there are 0 to remove.
Seeing an error with autoremove?
If you see Unable to lock the apt directory, close any other programs that might be using apt and try again. You can check for background apt processes with ps aux | grep apt.
Help me troubleshoot sudo apt autoremove on Linux Mint.
Practice removing your extra package
In Step 2, you had the option to install an extra fun package like cowsay, figlet, or cmatrix. If you did, now is the time to remove it and practice the full removal cycle on your own.
✔️ I installed an extra package
Replace cowsay in the commands below with the name of the package you installed (such as figlet or cmatrix).
- Remove the package by running:
sudo apt remove cowsay
- Press Enter to confirm when prompted.
- Verify the package is gone by trying to run it:
cowsay
You should see command not found.
- Clean up any leftover dependencies:
sudo apt autoremove
Your extra package and any orphaned dependencies are now removed.
ⓧ I skipped the mini-challenge
No action needed. Your system is already clean from the sl removal and the autoremove you just ran.
Before wrapping up, predict: if you run sudo apt autoremove one more time right now, how many packages do you think it will find to remove?
- Confirm your system is fully clean by running:
sudo apt autoremove
You should see 0 to remove. Every unnecessary package and orphaned dependency has been swept up.
Your system is clean and lean. Next up, you will peek under the hood and see every program running on your machine in real time.
See What's Running
Your system is clean and organized. You know how to find, install, and remove software packages without leaving clutter behind.
Right now, dozens of programs are running on your machine in the background, and you have no way to see what they are or check which ones are using the most memory. In this step, you will learn to list every running program, monitor them in real time, and hunt down any specific one by name.
In this step, get ready to:
- Use ps and ps aux to list running processes and understand what each column means.
- Take an interactive tour of htop to monitor processes in real time.
- Find a specific running application by combining ps with grep.
List running processes with ps
Every running program on your system is called a process. Each process gets a unique number called a PID (Process ID), like a desk number in an office that the operating system uses to keep track of who is sitting where.
- See the processes running in your current terminal session by running this command:
ps
You should see just 2-3 lines: the bash shell itself and the ps command you just ran. That is because ps on its own only shows processes inside this terminal session.
- Now see every process running on the entire system by running:
ps aux
Hundreds of lines scroll past your screen. Each line is one running process on your system.
What do these columns mean?
Each line in the ps aux output has several columns. Here are the five most important ones.
- USER shows who started the process.
- PID is the unique process number (the desk number).
- %CPU shows the percentage of CPU the process is using right now.
- %MEM shows the percentage of memory the process is consuming.
- COMMAND (the last column) shows the name of the program that is running.
Monitor processes in real time with htop
The ps aux command took a single snapshot, like a photo. Now try the real-time alternative that updates every second.
- Launch htop by running:
htop
The colored bars at the top show CPU and memory usage at a glance. The list below shows every running process, updating in real time.
- Click a column header or press F6 to sort by CPU or memory usage.
- Press / (forward slash) to search for a process by name.
- Press F5 to toggle tree view, which shows parent-child relationships between processes.
- Press q to quit htop and return to your terminal.
How is htop different from ps?
Think of ps as a photo. It captures a single moment and then it is done.
Think of htop as a live video feed. It updates every second, and you can sort, search, and browse without leaving the tool.
htop not found?
- If you see "command not found", install it by running sudo apt install htop and then try launching it again.
Help me troubleshoot why htop is not working on my system.
Hunt down a specific process with grep
You can see all processes now. But what happens when you need to find one specific program buried in a list of hundreds?
- Click the Applications menu at the top-left of your screen.
- Open Mousepad (the default text editor, found under Accessories).
- Leave Mousepad open and switch back to your terminal.
Before you run the next command, do you think you can spot Mousepad by scrolling through the full process list?
- Try to find Mousepad in the full process list by running:
ps aux
Hundreds of lines scroll past. Try scrolling up to find a line that says mousepad. It is buried somewhere in the middle, and finding it this way could take a while.
Scrolling through hundreds of lines to find one process is not practical. This is exactly the kind of problem that pipes from Level 2 solve.
- Filter the process list to only show Mousepad by running:
ps aux | grep mousepad
You should see one or two lines of output. The line showing mousepad in the COMMAND column is your match. The number in the second column is Mousepad's PID.
What just happened?
- ps aux lists every process, and the pipe (|) sends that entire list to grep.
- grep mousepad keeps only the lines containing the word "mousepad" and throws away everything else.
- The PID in the second column is the number you would use to control or stop Mousepad from the terminal. You will put that to use in the next step.
Something look off in the output?
- If you see a line with grep in it, that is normal. The grep mousepad command is itself a running process, so it shows up in its own search results. Ignore the line containing grep and look for the other line that shows mousepad in the COMMAND column.
- If Mousepad does not appear at all, make sure it is still open. Reopen it from the Applications menu and run ps aux | grep mousepad again.
Why is my process search not showing the result I expect?
You can now see every running process on your system and find any specific one by name. Next up, you will learn to control those processes: stopping, pausing, and force-quitting programs entirely from the terminal.
Control Processes
You can now spot any running program on your system and read its PID from the ps aux output. That is half the battle.
The other half is controlling those processes. When a program freezes and clicking the X button does nothing, you need a way to stop, pause, resume, and force-quit it entirely from the terminal.
In this step, get ready to:
- Start a background process and move it between foreground and background.
- Kill processes by PID with kill and by name with killall.
- Practice the full hunt-and-kill workflow independently.
Start a background process and manage it
Sometimes you need to run a long command but keep using your terminal at the same time. The & symbol at the end of a command sends it to the background, giving you your prompt back immediately.
- Start a long-running process in the background by running this command:
sleep 300 &
What does this command do?
- sleep 300 tells the system to wait for 300 seconds (5 minutes) before finishing. This simulates a long-running program.
- The & at the end sends the command to the background so you keep your terminal prompt.
Your terminal prints two things: a job number in square brackets (like [1]) and a PID (like 12345). These identify the process.
- Confirm the process is running in the background by running this command:
jobs
You should see your sleep process listed with a [1] job number and a Running status.
- Bring the background job to the foreground by running this command:
fg %1
Your terminal now appears to hang. That is expected. The sleep command is running in the foreground, so it has taken over your terminal.
- Press Ctrl+Z to suspend the process.
Your terminal prints Stopped and gives you your prompt back. The process is paused, not killed.
- Resume the suspended process in the background by running this command:
bg %1
The process is now running in the background again, and you have your terminal prompt.
What just happened?
You just performed the full lifecycle of a background job. & starts it in the background, jobs lists it, fg brings it forward, Ctrl+Z suspends it, and bg resumes it in the background.
These commands give you complete control over running programs without closing your terminal.
Job not showing up?
- If jobs shows nothing, the sleep process may have already finished or was started in a different terminal window. Run sleep 300 & again in the same terminal.
- If fg %1 says "no such job", the job number may be different. Check the output of jobs for the correct number in brackets.
Need more help? Help me troubleshoot why my background job is not appearing in the jobs list.
Kill a process by PID
The sleep process from the previous substep is still running in the background. Now you will learn how to stop it permanently.
- Find the PID of the sleep process by running this command:
ps aux | grep sleep
Look at the output. The second column is the PID. Note down that number.
Seeing grep in the results?
You may see a second line containing the word grep in it. That is normal. The grep command is itself a running process, so it shows up in the list. Ignore that line and focus on the one that says sleep.
- Kill the process by running this command (replace the PID with the number from the output above):
kill [[SLEEP_PID="the PID from the ps aux output"]]
- Verify the process is gone by running this command:
ps aux | grep sleep
The sleep process should no longer appear in the output. If you only see the grep line itself, that means sleep is gone.
Be careful with kill -9
The kill command sends SIGTERM (signal 15) by default. SIGTERM politely asks the program to stop and gives it a chance to save its work and clean up.
kill -9 sends SIGKILL (signal 9). This forces the program to stop immediately with no chance to save or clean up. It is like pulling the power plug on a computer.
Only use kill -9 as an absolute last resort, when a regular kill does not work after several seconds.
You can also kill processes by name instead of PID. The killall command stops all processes matching a given name. You will practice this in the next substep.
Process did not stop?
- "Operation not permitted" means you are trying to kill another user's process. You can only kill your own processes. Use sudo kill followed by the PID to kill another user's process.
- If the process will not die after running kill, the process may be ignoring SIGTERM. Wait 5 seconds and try again. If it still does not stop, use kill -9 followed by the PID as a last resort.
Still stuck? Help me figure out why my kill command is not working on a process.
Practice the hunt-and-kill workflow
Time to put it all together. You will start a new background process, hunt it down by PID, kill it, and verify it is gone. Then you will repeat the process using killall to kill by name instead.
- Start a new background process by running this command:
sleep 600 &
- Find its PID by running this command:
ps aux | grep sleep
Note down the PID from the second column of the output.
- Kill the process using its PID by running this command:
kill [[SLEEP_PID="the PID from the ps aux output"]]
- Verify it is gone by running this command:
ps aux | grep sleep
The sleep process should no longer appear. Only the grep line itself may remain.
Now try the same workflow, but kill by name instead of PID.
- Start another background process by running this command:
sleep 600 &
- This time, kill it by name instead of PID by running this command:
killall sleep
What does killall do?
killall sends SIGTERM to every process matching the name you give it. If you had five sleep processes running, killall sleep would stop all five at once.
Before you verify, what do you think ps aux | grep sleep will show now? Will the sleep process still be there?
- Verify the process is gone by running this command:
ps aux | grep sleep
No sleep process should appear. The killall command stopped it by name, so you did not even need to look up the PID.
Still seeing a sleep process?
- Make sure you typed killall sleep with the correct spelling. The name must match the process name exactly.
- If the process persists, try kill -9 followed by the PID as a last resort.
Need help? Help me figure out why killall is not stopping my sleep process in Linux Mint.
Secret mission
Final Mini-Project -- My Admin Toolkit
You have learned individual commands for packages and processes across five steps. Now combine them all into one reusable admin toolkit. Write a shell script that generates a formatted system report, set proper file permissions, and share the toolkit with a teammate account.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources, pause them to come back later, or delete them entirely. This project runs entirely on your local Linux Mint system, so there are no ongoing costs.
Resources you used:
- ~/linux-lab3 folder.
- ~/admin-toolkit folder (with sysinfo.sh and report.txt).
- tree package.
- htop package.
Keep everything running
No action needed. Choose this if you plan to keep practicing with your admin toolkit or want to reference your scripts later.
- Your ~/linux-lab3 and ~/admin-toolkit folders stay on disk for future reference.
- The tree and htop packages are lightweight system utilities worth keeping on any Linux system.
Pause - I'll come back to this later
This project has no running services or background processes. Your files and installed packages sit idle on disk and do not consume CPU or memory when not in use.
- No action is required. Everything is already idle by default.
- Your project files will be waiting in your home directory when you return.
Delete - I don't want to use this again
Remove all project folders and uninstall the packages you added during this project.
- Remove both project folders by running:
rm -rf ~/linux-lab3 ~/admin-toolkit
- Remove the tree and htop packages by running:
sudo apt remove tree htop
- Type Y and press Enter when prompted to confirm.
- Clean up any orphaned dependencies by running:
sudo apt autoremove
- Type Y and press Enter if prompted to confirm.
Nice Work!
Nice Work!
Nice work! You have just built a personal admin toolkit that proves you can manage software and processes on a real Linux system.
You've learned how to:
- Managed software entirely from the terminal using apt. You searched for packages, inspected them before installing, verified each installation, and cleanly removed software along with its orphaned dependencies using apt autoremove.
- Monitored every running process on your machine in real time with htop and listed all processes with ps aux. You hunted down specific programs by name by piping process output into grep.
- Controlled processes from the terminal. You started background jobs, moved them between foreground and background, and terminated programs with kill and killall. You also learned the difference between SIGTERM (polite stop) and SIGKILL (force stop).
- Secret Mission: Built a complete admin toolkit with a sysinfo.sh script that automates system reporting, set proper file permissions, shared it with a teammate account, and cleaned up afterward.
Ready to quiz yourself?