Parts of the command line
The linux command line is not one singular thing, it consists of many parts. Each having a specific important purpose. Each of these parts is modular and can be swapped out to fit your needs.
The Terminal:
The terminal (often called terminal emulator), is a front end interface that allows you to interact with the shell of the system.
At its core its just a window in which you input text which gets passed down to the shell and then displays the output of the shell.
The terminal emulator does not understand commands, it just passes input to the shell and renders output.
Common terminal emulators include: Konsole
, Kitty
, Gnome Terminal
, and Ghostty
.
The Shell:
The shell is a program that interprets commands and then runs the right programs.
It is like the bridge between the user and the kernel. its the most basic form of interacting with your system.
The most commonly used shell programs are: Bash
, Zsh
, Powershell
.
The Binaries:
The shell itself doesnt execute anything, it just interprets a command and then executes the correct binary programs with the correct arguments.
Each command is just calling one or more of those binary programs.
So the commands like: cd
, ls
, cat
.
Are basically just names of executable binaries.
All major Linux distro’s come with a standard set of these commands (binaries).
Most of these binaries are part one of the following projects: gnu-coreutils
, util-linux
, procps-ng
, iproute2
, iputils
. and then there are a number of binaries that are their own projects.
But you can be sure that all major Linux distros come with the binaries of those 5 projects, so if you learn those you are set.
Commonly used commands
Command | Project | Description |
---|---|---|
ls | gnu | List files and directories |
cd | bash | Change the current directory |
pwd | gnu | Print current working directory |
cp | gnu | Copy files or directories |
mv | gnu | Move or rename files/directories |
rm | gnu | Remove files or directories |
mkdir | gnu | Create directories |
rmdir | gnu | Remove empty directories |
touch | gnu | Create empty file or update timestamp |
cat | gnu | Display or concatenate file contents |
echo | bash | Print text to stdout |
chmod | gnu | Change file permissions |
chown | gnu | Change file owner and group |
find | gnu | Search for files in directories |
grep | gnu | Search text in files using patterns |
ps | procps-ng | Show currently running processes |
kill | gnu | Terminate a process by PID |
uname | gnu | Show system and kernel information |
uptime | procps-ng | Show system uptime and load |
who | util-linux | Show who is logged in |
whoami | gnu | Show current user |
id | gnu | Show user and group IDs |
groups | gnu | List groups for a user |
tar | gnu | Archive or extract files |
gzip | gnu | Compress files |
gunzip | gnu | Decompress gzip files |
ping | iputils | Test network connectivity |
ip | iproute2 | Show or configure network interfaces |
which | other | Locate a command in PATH |
whereis | util-linux | Locate binaries, source, and manuals |
type | bash | Show command type information |
basename | gnu | Strip directory path from filename |
dirname | gnu | Strip filename to show directory path |
xargs | gnu | Build and execute commands from input |
env | gnu | Show or set environment variables |
export | gnu | Set environment variables for child processes |
mount | util-linux | Mount disks or drive |
unmount | util-linux | Unmount disks or drive |
fdisk | util-linux | Manages disks or drives |
curl | other | Downloads files from the web |
wget | other | Downloads files from the web |
su | util-linux | Switch to root user |
sudo | other | Execute command as root user |
shutdown | util-linux | Shut down the system |
reboot | util-linux | Reboot the system |
clear | gnu | Clears the terminal output |
Basics of bash and scripting
comming soon…
Posix and compatibility
comming soon…