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 is my Operating Systems of choice. While I am not a Linux SysAdmin; I often get to manage a large fleet of Red Hat Enterprise Linux (RHEL) servers. Most of them running containers on Podman. Anyways, lets get started!

Linux really just 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 when configured together create a cohesive Operating System.

The Larger Differences

I assume you are familiar with Windows 7 or 10.

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 Command Line Interface is hard to use and time consuming. However there are many shortcuts just like 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.

The ~ always represents the logged in users Home Directory. This folder is read protected from other users. Treat it like your Windows User profile folder. This is where Windows would store your “Documents”, “Pictures”, “Downloads”…. You get the idea.

Then the . (period) represents “here” or the current working directory.

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

Javascript Cat!

how-to add oneko.js to the minimal-mistakes jekyll template.

Back to top ↑

2023

Ditching WordPress

Method of Procedure for migrating from WordPress to plain HTML.

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 ↑