LINUX COMMAND REFERENCE
Commands for managing servers
Files, networking, processes and services: 127 commands with syntax, options and examples for SSH sessions.
These examples use Linux and Bash. Available utilities and options vary by distribution. Commands run on the server you connect to.
Choose a command for the task
Use this command reference when administering a Linux server over SSH. Each guide explains syntax, shows concrete examples, describes their results and answers troubleshooting questions. Choose a task below, then read the selected guide before running its examples.
All commands (127)
No matches. Try another name or select all categories.
Viewing and processing text18
Inspect logs and transform text without opening a full editor. Choose literal matching, field extraction or stream processing according to the input format; keep transformed output separate until it is verified.
awkProcess text by columns and patterns
Syntax and examplescatOutput or merge files
Syntax and examplescutCut fields or character ranges
Syntax and examplesdiffCompare files line by line
Syntax and examplesgrepSearch strings by pattern
Syntax and examplesheadShow start of file
Syntax and exampleslessView text page by page
Syntax and examplesmoreSimple page-by-page text browsing
Syntax and examplesnlOutput file with line numbers
Syntax and examplespasteConcatenate lines from multiple files
Syntax and examplessedEdit text flow according to rules
Syntax and examplessortSort rows
Syntax and examplestailShow end of file and monitor logs
Syntax and examplesteeWrite the output to a file and leave it in the terminal
Syntax and examplestrReplace or remove characters
Syntax and examplesuniqRemove or count duplicate lines
Syntax and exampleswcCount lines, words and bytes
Syntax and examplesxargsPass a list of arguments to another command
Syntax and examplesPermissions, users and access14
Diagnose access using identity, ownership and permission information. Grant only the access required for the operation; account changes and recursive permission changes can affect active services.
chgrpChange file group
Syntax and exampleschmodChange file permissions
Syntax and exampleschownChange file owner
Syntax and examplesgroupsShow user groups
Syntax and examplesidShow UID, GID and groups
Syntax and examplespasswdChange user password
Syntax and examplessuSwitch to another user
Syntax and examplessudoRun command with elevated permissions
Syntax and examplesumaskSet default permissions for new files
Syntax and examplesuseraddCreate a user
Syntax and examplesuserdelDelete user
Syntax and examplesusermodChange user settings
Syntax and exampleswhoShow logged in users
Syntax and exampleswhoamiShow current user
Syntax and examplesProcesses and tasks15
Identify the relevant process or shell job before changing its state. Use graceful termination where appropriate, and distinguish shell job control from services managed by the system.
atSchedule a one-time command run
Syntax and examplesbgContinue task in background
Syntax and examplescrontabManage schedule cron
Syntax and examplesfgBring background task back to foreground
Syntax and exampleshtopInteractively view processes and load
Syntax and examplesjobsShow jobs in the current shell session
Syntax and exampleskillSend a signal to a process
Syntax and exampleskillallTerminate processes by name
Syntax and examplesniceStart process with priority
Syntax and examplesnohupLeave the process running after exiting shell
Syntax and examplespgrepFind PID by process name
Syntax and examplespkillSend a signal to processes using a template
Syntax and examplespsShow list of processes
Syntax and examplesreniceChange the priority of a running process
Syntax and examplestopMonitor processes and load
Syntax and examplesDisks and file system11
Check capacity, inode use, device identity and mount relationships before storage maintenance. The listing examples are starting points for diagnosis, not instructions to format an unfamiliar device.
blkidShow UUID and file system types
Syntax and examplesdfShow free space on file systems
Syntax and examplesduEstimate the size of files and directories
Syntax and examplesfdiskManage disk partitions
Syntax and examplesfsckCheck and repair the file system
Syntax and exampleslsblkShow block devices
Syntax and exampleslsofShow open files and sockets
Syntax and examplesmountMount file system
Syntax and examplespartedManage disk partitions
Syntax and examplessyncFlush write buffers to disk
Syntax and examplesumountUnmount a filesystem
Syntax and examplesNetwork and remote access17
Check DNS resolution, routing, transport and authentication in order. A successful ping or open port does not prove that an SSH login or file transfer will succeed.
curlSend HTTP requests and download data
Syntax and examplesdigQuery DNS records
Syntax and exampleshostRun a simple DNS query
Syntax and exampleshostnameShow or change hostname
Syntax and examplesipManage network interfaces and routes
Syntax and examplesmtrDiagnosing a route with packet loss
Syntax and examplesncWork with TCP/UDP connections
Syntax and examplesnslookupQuery DNS interactively
Syntax and examplespingCheck host availability
Syntax and examplesrsyncSync files locally or via SSH
Syntax and examplesscpCopy files over SSH
Syntax and examplessftpTransfer files over SFTP
Syntax and examplesssShow network connections and ports
Syntax and examplessshConnect to a remote server
Syntax and examplesssh-keygenCreate and manage SSH-options
Syntax and examplestracerouteShow route to node
Syntax and exampleswgetDownload files by HTTP, HTTPS or FTP
Syntax and examplesArchives and compression6
Choose between compressing one stream and packaging a directory tree. Inspect the contents of unfamiliar archives and check extraction size and overwrite behaviour before writing into an important directory.
bzip2Compress file using bzip2 algorithm
Syntax and examplesgzipCompress file using gzip algorithm
Syntax and examplestarCreate and extract tar archives
Syntax and examplesunzipUnpack zip-archive
Syntax and examplesxzCompress file using xz algorithm
Syntax and exampleszipCreate zip-archive
Syntax and examplesPackages and services8
Inspect the distribution, package source and service state before changing software. Repository metadata, installed packages, service enablement and current runtime state are distinct pieces of information.
aptManage packages in Debian/Ubuntu
Syntax and examplesdnfManage packages in Fedora/RHEL
Syntax and examplesdpkgWork with deb packages directly
Syntax and examplesjournalctlView systemd logs
Syntax and examplesrpmWork with rpm packages directly
Syntax and examplessnapManage snap packages
Syntax and examplessystemctlManage systemd services
Syntax and examplesyumManage packages in old RHEL/CentOS
Syntax and examplesMonitoring and diagnostics5
Compare repeated measurements and their scope before concluding that a server lacks resources. CPU load, memory accounting and disk latency need different interpretations.
Shell and environment11
Understand which shell and process receive a setting. Variables, aliases and the working directory can belong to one session. Files executed with the source command run as shell code with the account permissions.
aliasCreate a short name for the command
Syntax and examplesenvShow or run command with environment
Syntax and examplesexportExport environment variable
Syntax and exampleshistoryShow command history
Syntax and examplesmanOpen command documentation
Syntax and examplesprintfFormatted text output
Syntax and examplesreadRead user input in shell script
Syntax and examplessourceExecute file in current shell session
Syntax and examplestestCheck the condition in the shell script
Syntax and examplestypeShow command type
Syntax and exampleswhichFind the command executable
Syntax and examplesGit, containers and DevOps6
Inspect repository state, container context and build instructions before taking action. Preserve uncommitted work and check the selected host or daemon so operations reach the intended environment.
dockerManage Docker containers
Syntax and examplesdocker composeManage multi-container projects
Syntax and examplesgitWork with Git repositories
Syntax and examplesmakeRun Makefile tasks
Syntax and examplesscreenWork with terminal sessions
Syntax and examplestmuxManage terminal sessions and panels
Syntax and examplesBefore running a command on your server
- Connect to the intended host and verify its host key fingerprint. Check the account and current directory before using relative paths.
- Replace sample paths, account names and hosts with your own values. Check that required tools are available on the remote
Linuxsystem. - Start with inspection or a dry run where supported. Keep backups before changing files, account settings or storage.