⚡
usefultools.dev
🐧

Linux-Befehle-Spickzettel

NEU

Linux-Befehle-Spickzettel für das Terminal: Dateien, grep, find, Rechte, Prozesse, Festplatte, Netzwerk, tar, Benutzer und apt oder dnf. Mit Suchfilter und Kopieren per Klick. Die Befehle sind auf Englisch.

Läuft zu 100 % in deinem Browser — deine Eingaben werden nie hochgeladen oder auf unseren Servern gespeichert.

105 Einträge in 12 Abschnitten

Navigation

  • pwd

    Print the current directory.

  • ls -lah

    List files with details, hidden files and human-readable sizes.

  • cd <dir>

    Change directory.

  • cd ~

    Go to your home directory.

  • cd -

    Go back to the previous directory.

  • cd ..

    Go up one directory.

Files & folders

  • touch <file>

    Create an empty file or update its modified time.

  • mkdir -p a/b/c

    Create a folder and any missing parent folders.

  • cp <src> <dest>

    Copy a file.

  • cp -r <dir> <dest>

    Copy a folder with its contents.

  • mv <src> <dest>

    Move or rename a file or folder.

  • rm <file>

    Delete a file.

  • rm -r <dir>

    Delete a folder and everything in it. There is no trash, so double-check the path.

  • ln -s <target> <link>

    Create a symbolic link.

  • file <name>

    Show what type of file something is.

View & search

  • cat <file>

    Print a file.

  • less <file>

    Page through a file (q to quit, / to search).

  • head -n 20 <file>

    Show the first 20 lines.

  • tail -n 20 <file>

    Show the last 20 lines.

  • tail -f <file>

    Follow a file as new lines are added, handy for logs.

  • wc -l <file>

    Count lines in a file.

  • grep "text" <file>

    Print lines that contain text.

  • grep -rn "text" .

    Search recursively and show line numbers.

  • grep -i "text" <file>

    Search ignoring case.

  • find . -name "*.log"

    Find files by name under the current folder.

  • find . -type f -mtime -1

    Find files modified in the last 24 hours.

  • awk '{print $1}' <file>

    Print the first column of each line.

  • sed 's/old/new/g' <file>

    Replace text and print the result (the file is not changed).

  • sed -i 's/old/new/g' <file>

    Replace text in the file itself (GNU sed).

  • sort <file> | uniq -c

    Count how often each distinct line appears.

Permissions

Numbers: r=4, w=2, x=1, added per owner, group, others.

  • chmod 644 <file>

    Owner can read and write, everyone else can only read.

  • chmod 755 <file>

    Owner can read, write and run; others can read and run.

  • chmod +x <file>

    Make a file executable.

  • chmod u+rw,go-w <file>

    Symbolic form: add read/write for owner, remove write for group and others.

  • chown user:group <file>

    Change the owner and group of a file.

  • chown -R user:group <dir>

    Change owner and group recursively.

  • ls -l

    Show permissions as strings like -rwxr-xr-x.

Processes

  • ps aux

    List all running processes.

  • ps aux | grep <name>

    Find a process by name.

  • top

    Live view of processes and resource use.

  • htop

    Friendlier live process viewer (often needs to be installed).

  • kill <pid>

    Ask a process to stop (sends SIGTERM).

  • kill -9 <pid>

    Force a process to stop (SIGKILL). Use only if a normal kill fails.

  • pkill <name>

    Stop processes by name.

  • command &

    Run a command in the background.

  • jobs

    List background jobs of the current shell.

  • nohup <command> &

    Keep a command running after you close the terminal.

Disk

  • df -h

    Show free and used space for each mounted disk.

  • du -sh <dir>

    Show the total size of a folder.

  • du -sh * | sort -h

    Size of each item here, sorted from smallest to largest.

  • lsblk

    List disks and partitions.

  • mount

    Show mounted file systems.

  • free -h

    Show used and free memory.

Network

  • ping -c 4 <host>

    Send 4 echo requests to check a host is reachable.

  • curl -I <url>

    Fetch only the response headers of a URL.

  • curl -O <url>

    Download a file and keep its name.

  • wget <url>

    Download a file.

  • ip addr

    Show network interfaces and IP addresses.

  • ss -tulpn

    List listening TCP and UDP ports with the owning process (may need sudo).

  • dig <domain>

    Look up DNS records for a domain.

  • traceroute <host>

    Show the route packets take to a host.

  • ssh user@host

    Open a secure shell on a remote machine.

  • scp <file> user@host:/path

    Copy a file to a remote machine over SSH.

Archive & compress

  • tar -czf archive.tar.gz <dir>

    Create a gzip-compressed tar archive.

  • tar -xzf archive.tar.gz

    Extract a .tar.gz archive here.

  • tar -xzf archive.tar.gz -C <dir>

    Extract into a specific folder.

  • tar -tf archive.tar.gz

    List the contents of an archive without extracting.

  • zip -r archive.zip <dir>

    Create a zip file from a folder.

  • unzip archive.zip

    Extract a zip file.

  • gzip <file>

    Compress a file to file.gz (the original is replaced).

Users & sudo

  • whoami

    Print your user name.

  • id

    Show your user id and groups.

  • sudo <command>

    Run a command as the administrator (root).

  • su - <user>

    Switch to another user with their environment.

  • sudo adduser <name>

    Create a user (Debian and Ubuntu).

  • sudo usermod -aG <group> <user>

    Add a user to a group without removing existing groups.

  • passwd

    Change your password.

System info

  • uname -a

    Show kernel and system information.

  • cat /etc/os-release

    Show the Linux distribution name and version.

  • uptime

    Show how long the system has been running and the load.

  • date

    Print the current date and time.

  • lscpu

    Show CPU details.

  • env

    List environment variables.

  • history

    List commands you ran before.

  • man <command>

    Open the manual page of a command.

Package managers

  • sudo apt update

    Refresh the package list (Debian, Ubuntu).

  • sudo apt upgrade

    Install available updates (Debian, Ubuntu).

  • sudo apt install <package>

    Install a package with apt.

  • sudo apt remove <package>

    Remove a package with apt.

  • apt search <term>

    Search packages with apt.

  • sudo dnf install <package>

    Install a package with dnf (Fedora, RHEL, Rocky, Alma).

  • sudo dnf remove <package>

    Remove a package with dnf.

  • sudo dnf upgrade

    Update all packages with dnf.

  • dnf search <term>

    Search packages with dnf.

Pipes & redirection

  • cmd1 | cmd2

    Send the output of cmd1 into cmd2.

  • cmd > file

    Write output to a file, replacing it.

  • cmd >> file

    Append output to a file.

  • cmd < file

    Read input from a file.

  • cmd 2> errors.txt

    Write only error messages to a file.

  • cmd > out.txt 2>&1

    Write both normal output and errors to one file.

  • cmd > /dev/null 2>&1

    Throw away all output.

  • cmd1 && cmd2

    Run cmd2 only if cmd1 succeeded.

  • cmd1 || cmd2

    Run cmd2 only if cmd1 failed.

  • cmd | tee file

    Show output and save it to a file at the same time.

  • xargs

    Turn input lines into arguments, e.g. find . -name "*.tmp" | xargs rm.

⚡

Schnelle Beispiele

Typische Eingaben und die Ergebnisse, die dieses Tool liefert.

Logs
Eine Logdatei live verfolgen
tail -f <file>
Rechte
Eine Datei ausführbar machen
chmod +x <file>
Festplatte
Ordnergrößen, kleinste zuerst
du -sh * | sort -h
Archiv
Ein gzip-komprimiertes tar-Archiv erstellen
tar -czf archive.tar.gz <dir>
📖

Überblick

Die Linux-Kommandozeile ist mächtig, aber die richtigen Optionen vergisst man leicht. Dieser Linux-Befehle-Spickzettel listet die Alltagsbefehle für Navigation, Dateien, Anzeigen und Durchsuchen von Text mit grep, find, awk und sed, Rechte, Prozesse, Festplatte, Netzwerk, Archive, Benutzer und Systeminformationen auf.

Er behandelt außerdem die Paketmanager apt und dnf sowie die Pipe- und Umleitungsoperatoren, mit denen du Befehle verketten kannst. Befehle, die Daten löschen, etwa rm -r und kill -9, werden klar beschrieben, damit du vor dem Ausführen weißt, was sie tun.

Befehle, Optionen und ihre kurzen Beschreibungen werden auf Englisch angezeigt, wie im Terminal; übersetzt sind nur die Oberfläche und der Seitentext. Grenze die Liste mit dem Filter ein, kopiere einen Befehl und ersetze Platzhalter wie <file>. Alles läuft in deinem Browser und nichts, was du eingibst, wird irgendwohin gesendet.

Warum dieses Tool?

  • Die richtigen Optionen in Sekunden finden
  • Deckt Dateien, Netzwerk, Festplatte und Prozesse ab
  • apt und dnf nebeneinander
  • Einfache Erklärungen ohne Fachchinesisch
  • Jeden Befehl mit einem Klick kopieren
⭐

Funktionen

📂

Dateien und Navigation

ls, cd, cp, mv, rm, ln und mkdir -p mit gängigen Optionen.

🔎

Suche und Text

grep, find, awk, sed, sort und uniq, um mit Ausgaben zu arbeiten.

🔐

Rechte

chmod-Zahlen und symbolische Formen sowie chown.

🌐

Netzwerkwerkzeuge

curl, wget, ip, ss, dig, ssh und scp.

📦

apt und dnf

Pakete in beiden Familien installieren, entfernen, aktualisieren und suchen.

🔗

Pipes und Umleitung

Operatoren wie |, >, >>, 2>&1, && und tee.

🛠️

So funktioniert’s

1

Abschnitt wählen

Scrolle zu Files, Processes, Network oder dem gewünschten Thema (die Abschnittstitel sind auf Englisch).

2

Oder filtern

Tippe ein Wort wie „port“ oder „tar“ in das Feld „Diesen Spickzettel filtern“.

3

Lesen, was er tut

Lies die einzeilige Beschreibung auf Englisch, besonders bei Befehlen, die Daten löschen.

4

Kopieren und anpassen

Klicke auf Kopieren, füge den Befehl im Terminal ein und ersetze Platzhalter wie <file>.

🤔

Häufig gestellte Fragen