Basic Linux Administration

Howdy everyone! If you know me, you know I love Raspberry Pi’s. Not the food, but the little wallet sized computers. I have a bunch of them all doing small things like Pi-Hole and even running local gameservers. Here at my home, Debian 11 and Ubuntu 22.04 LTS with a Pro subscription are my Operating Systems of choice. I am not a Linux Systems Admin but I often get to manage a large fleet of Red Hat Enterprise Linux (RHEL) servers. Most of them running containers on Podman.

Linux refers to the kernel. A kernel is the low-level code that manages memory, storage, and communication with the underlying PC hardware. There are countless ‘flavours’ of Linux also known as Distros’. Each with slightly different packages that are configured together to create an Operating System.

Package Managers - Using APT

Debian uses the apt package manager and Red Hat Enterprise Linux (RHEL) uses the yum package manager. They function the same way with slightly different syntax. Even with a Desktop Enviroment (DE), it is best practice to let your package manager handle everything storage related. Using your package manager, you streamline updating, patching, uninstalling, and storage clean up. Here are a few of my most used apt commands.

~ apt update
~ apt upgrade
~ apt install
~ apt remove
~ apt purge
~ apt autoremove
~ apt list --installed
~ apt list --upgradeable

Useful Terminal Commands

It seems to be a common misconception that the CLI is hard to use and time consuming. There are many shortcuts to the CLI just like within the Windows GUI. Below are a few commands I think everyone should know how and why to use…

  • touch - Create a new file.
  • cat - Display the content of a file.
  • cd ~ - Return to the users home directory.
  • pwd - Print the working directory.
  • which - Displays the $PATH to the requested execuateable command.
  • tail - Can be used to display the last X number of lines from a file. Similar to cat.
  • cd .. - Go back one directory.
  • sudo su - - Shell into the root user.

Anatomy of a Command

The following command will update the known packages and then install neofetch and speedtest-cli and the pydf.

sudo apt update && sudo apt install neofetch speedtest-cli pydf -y

sudo [Super User Do] apt (executes the package manager) update (checks the upstream repo for new package versions) && [AND THEN DO] install neofetch, speedtest-cli, and then pydf. -y [Yes flag].

Fun Fact - Ubuntu Desktop and Ubuntu Server are the same. The Desktop version simply has the required packages to display a full Desktop Enviroment (DE). They can both be converted into each other since the underlying Distro is the same.

File Structures

Fun Fact - Unlike Windows, Linux does not require file extentions such as .txt or .exe to operate. Another fun fact is that files starting with a period (.) are hidden files and directory.

The file path / is called “root”. It is the equivilent of “C:". Log files most often land in the “/var/log” directory.

The file path /etc/ typically contains host configuration files. Network interfaces, motd, and other items can be configured here. Similar to “C:\Windows\System32” within Windows.

The file path /home/ is the default home directory for user profiles. Much like “C:\Users" in Windows.

2024

Back to top ↑

2023

Mom Said Redefine Success

In High School I had one dream that stands out. Own a Porsche by the time I was 26. Looking back, I have no idea where this dream came from; because I was ra...

Back to top ↑

2022

Back to top ↑

2021

Back to top ↑