Unix-Utilities

Unix Dienstprogramme

  ·  5 min read

Unix-Utilities sind ein gut definierter Satz von Befehlen (portable Shell-Skripte, evtl. POSIX spezifiziert). Der Begriff umfasst nicht standardmässige CLI-Befehle (Unix/Linux). 1 2 3 4

Linux Shortcut Keys / Commands

Basic Navigation

  • cd .. move up one directory
  • cd / go to root directory
  • cd ~ go to home directory
  • cd change directory
  • clear clear the terminal screen
  • history show command history
  • ls -a list all files including hidden
  • ls -l list in long format
  • ls list files and directories
  • pwd print working directory

File & Directory Management

  • ~/ represent contents in the home directory from the working directory
  • ar create library archives, and add or extract files
  • basename display portions of pathnames and filenames
  • cat filename display file contents
  • cat concatenate and display files
  • cd ../.. switch to a directory two levels higher
  • cd .. switch to a directory one levels higher
  • cd . represent the current directory
  • cd change working directory
  • chgrp change the group ownership of a file
  • chmod 755 filename Change file permissions
  • chmod u+x filename Make file executable for user
  • chmod change the permissions mode of a file
  • chown user:group filename Change file owner and group
  • cmp perform a byte-by-byte comparison of two files
  • comm selects or rejects lines common to two sorted files
  • compress compress files (see uncompress also)
  • cp -r source_dir destination copy directory recursively
  • cp source destination copy file
  • cp copy files
  • cpio copy file archives in and out
  • csh a shell with a C-like syntax and advanced interactive features
  • cut write out selected bytes, characters, or fields from each line of a file
  • cut -d: -f1 /etc/passwd system users login accounts
  • df report free disk space on file systems
  • diff display line-by-line differences between pairs of text files
  • du display the number of disk blocks used per directory or file
  • expand expand TAB characters to SPACE characters (see unexpand)
  • file determine the type of a file by examining its contents
  • find find files by name, or by other characteristics
  • ftp file transfer program
  • grep search a file for a string or regular expression
  • head filename show first 10 lines of a file
  • head display first few lines of specified files
  • install install files
  • less filename view file contents one page at a time
  • ln make hard or symbolic links to files
  • mkdir dirname create a new directory
  • mkdir make a directory
  • more browse or page through a text file
  • mv oldname newname rename or move a file
  • mv move or rename files
  • nano [Verzeichnis/Datei] - Nano editor
  • od octal, decimal, hexadecimal, and ascii dump
  • page browse or page through a text file
  • paste joins lines from one or more files
  • pwd display the pathname of the current working directory
  • rcp remote file copy
  • rev reverse the order of characters in each line
  • rm -r dirname delete a directory recursively
  • rm filename delete a file
  • rm remove files or directories
  • rmdir dirname remove an empty directory
  • rmdir remove directories
  • size display the size of an object file
  • sort sort and collate lines
  • spell report spelling errors
  • split split a file into pieces
  • strings find printable strings in an object file or binary
  • strip remove symbols and relocation bits from an object file
  • tail -f filename monitor file in real-time
  • tail filename show last 10 lines of a file
  • tail display the last part of a file
  • tar create tape archives, and add or extract files
  • tee replicate the standard output
  • tftp trivial file transfer program
  • touch filename create a new empty file
  • touch update the access and modification times of a file
  • uncompress uncompress files (see compress also)
  • unexpand restore TAB characters from SPACE characters (see expand)
  • uniq remove or report adjacent duplicate lines
  • wc display a count of lines, words and characters
  • where display Binär-, Quell- und Man-Dateien
  • whereis [options] [-BMS directory... -f] name... Binär-, Quell- und Man-Dateien (details) 5 6
  • zcat display compressed files

System Information

  • df -h Show disk space usage
  • du -sh * Show directory sizes
  • free -h Show memory usage
  • hostname Show or set system hostname
  • htop Interactive process viewer
  • lsblk Show block devices
  • lscpu Display CPU information
  • top Display running processes
  • uname -a Show all system information
  • uptime Show system running time

Process Management

  • bg Resume job in background
  • fg Bring job to foreground
  • jobs List background jobs
  • kill PID Kill a process by ID
  • killall processname Kill process by name
  • ps aux Detailed process list
  • ps Show active processes

Networking Commands

  • curl url Transfer data from or to a server
  • ifconfig Show network interfaces
  • ip addr show Display IP addresses
  • netstat -tuln Show active ports
  • ping host Test connectivity
  • scp file user@host:/path Copy file to remote server
  • ss -tuln Show listening sockets
  • ssh user@host Connect to remote machine via SSH
  • wget url Download file from web

Package Management (Ubuntu/Debian)

  • dpkg -l List installed packages
  • sudo apt autoremove Remove unused dependencies
  • sudo apt install packagename Install a package
  • sudo apt remove packagename Remove a package
  • sudo apt update Update package list
  • sudo apt upgrade Upgrade all packages

Package Management (RHEL/CentOS)

  • sudo dnf install packagename Install using DNF (newer versions)
  • sudo yum install packagename Install package
  • sudo yum remove packagename Remove package
  • sudo yum update Update packages

File Compression & Archiving

  • gunzip filename.gz Decompress file
  • gzip filename Compress file
  • tar -cvf archive.tar directory Create tar archive
  • tar -xvf archive.tar Extract tar archive
  • unzip archive.zip Extract zip file
  • zip archive.zip file1 file2 Create zip file

User Management

  • awk -F: '{ print $1}' /etc/passwd system users first field only
  • id Show user and group info
  • less /etc/passwd 👉🏻 Users in Linux
  • logout Log out current session
  • su username Switch user
  • sudo adduser username Add a new user
  • sudo deluser username Remove user
  • sudo passwd username Change user password
  • who Show logged-in users
  • whoami Display current username

System Shutdown & Reboot

  • poweroff Power off system
  • reboot Restart the system
  • sudo shutdown -r now Reboot immediately
  • sudo shutdown now Shut down immediately

Search & Find

  • find /path -name filename Search for file by name
  • grep -r 'pattern' /path Search recursively in directory
  • grep 'pattern' file Search text inside file
  • locate filename Quickly find files by name
  • updatedb Update locate database

Texteditor Nano

Linux beherrschen (Beginner bis Pro):