Linux Commands
This page contains a list of Linux commands compiled from the various manuals.
Coreutils
Output of entire files
- cat: Concatenate and write files
- tac: Concatenate and write files in reverse
- nl: Number lines and write files
- od: Write files in octal or other formats
- base64: Transform data into printable data
Formatting file contents
- fmt: Reformat paragraph text
- pr: Paginate or columnate files for printing
- fold: Wrap input lines to fit in specified width
Output of parts of files
- head: Output the first part of files
- tail: Output the last part of files
- split: Split a file into fixed-size pieces
- csplit: Split a file into context-determined pieces
Summarizing files
- wc: Print newline, word, and byte counts
- sum: Print checksum and block counts
- cksum: Print CRC checksum and byte counts
- md5sum: Print or check MD5 digests
- sha1sum: Print or check SHA-1 digests
- sha224sum, sha256sum, sha384sum, and sha512sum: Print or check SHA-2 digests
Operating on sorted files
- sort: Sort text files
- shuf: Shuffling text
- uniq: Uniquify files
- comm: Compare two sorted files line by line
- tsort: Topological sort
- ptx: Produce permuted indexes
Operating on fields within a line
- cut: Print selected parts of lines
- paste: Merge lines of files
- join: Join lines on a common field
Operating on characters
- tr: Translate, squeeze, and/or delete characters
- expand: Convert tabs to spaces
- unexpand: Convert spaces to tabs
Directory listing
- ls: List directory contents
- dir: Briefly list directory contents
- vdir: Verbosely list directory contents
- dircolors: Color setup for ls
Basic operations
- cp: Copy files and directories
- dd: Convert and copy a file
- install: Copy files and set attributes
- mv: Move (rename) files
- rm: Remove files or directories
- shred: Remove files more securely
Special file types
- link: Make a hard link via the link syscall
- ln: Make links between files
- mkdir: Make directories
- mkfifo: Make FIFOs (named pipes)
- mknod: Make block or character special files
- readlink: Print the referent of a symbolic link
- rmdir: Remove empty directories
- unlink: Remove files via the unlink syscall
Changing file attributes
- chown: Change file owner and group
- chgrp: Change group ownership
- chmod: Change access permissions
- touch: Change file timestamps
Disk usage
- df: Report file system disk space usage
- du: Estimate file space usage
- stat: Report file or file system status
- sync: Synchronize data on disk with memory
Printing text
- echo: Print a line of text
- printf: Format and print data
- yes: Print a string until interrupted
Conditions
- false: Do nothing, unsuccessfully
- true: Do nothing, successfully
- test: Check file types and compare values
- expr: Evaluate expressions
Redirection
- tee: Redirect output to multiple files or processes
File name manipulation
- basename: Strip directory and suffix from a file name
- dirname: Strip non-directory suffix from a file name
- pathchk: Check file name portability
Working context
- pwd: Print working directory
- stty: Print or change terminal characteristics
- printenv: Print all or some environment variables
- tty: Print file name of terminal on standard input
User information
- id: Print user identity
- logname: Print current login name
- whoami: Print effective user ID
- groups: Print group names a user is in
- users: Print login names of users currently logged in
- who: Print who is currently logged in
System context
- date: Print or set system date and time
- arch: Print machine hardware name
- uname: Print system information
- hostname: Print or set system name
- hostid: Print numeric host identifier
Modified command invocation
- chroot: Run a command with a different root directory
- env: Run a command in a modified environment
- nice: Run a command with modified niceness
- nohup: Run a command immune to hangups
- su: Run a command with substitute user and group ID
Process control
- kill: Send a signal to processes
Delaying
- sleep: Delay for a specified time
Numeric operations
- factor: Print prime factors
- seq: Print numeric sequences
Diffutils
- cmp: Compare two files byte by byte
- diff: Find differences between two files
- diff3: Compare three files line by line
- sdiff: Side-by-side merge of file differences