Skip to content

Linux Commands

The new category shorts will be a compact blogpost about the essential information about a topic.

In further posts i will explain some basic information about Linux and his history, but this post will only contain some basic commands. Keep in mind that there are a lot of different shells, I’m using usually the default one: bash (Bourne-Again-Shell).

Command Description
pwd prints the working directory
hostname prints hostname of the working computer
logname prints username
cat prints content of a file
ls prints content of folder
cd move within folder
mkdir creates folder
rmdir removes folder
rm removes files
touch create files
cp copies a file/folder
mv moves a file/folder
sudo uses the superuser (admin) -> usually used in front of another command
sudo su enables admin session within the terminal (use with care!)
useradd <user> add new user
userdel <user> removes user
passwd <user> changes password for a user
su <user> changes user
addgroup <group> add new group
usermod -a -G <group> <user> adds user to group
groupdel <group> removes group
chmod <permission> <file/folder> changes permissions of a file/folder
chown <user> <file/folder> changes owner of a file/folder
apt update updates local repository list (shows apps which could be updated)
apt upgrade install available updates
apt install <packagename> installs new application
apt remove <packagename> uninstalls application
nano <file> text editor
vim <file> text editor
head <file> prints first 10 lines of file
less <file> prints last 10 lines of file
more <file> prints file content, shows more by pressing space
ifconfig prints network settings
df prints disk usage
htop resource monitor
systemctl manage services
kill terminates process
dig prints dns information
help <cmd> shows information about a specific command

Cheers!