Top (GNU Coreutils 9.0)
From Get docs
Coreutils/docs/latest/index
GNU Coreutils 9.0
Short Table of Contents
- 1 Introduction
- 2 Common options
- 3 Output of entire files
- 4 Formatting file contents
- 5 Output of parts of files
- 6 Summarizing files
- 7 Operating on sorted files
- 8 Operating on fields
- 9 Operating on characters
- 10 Directory listing
- 11 Basic operations
- 12 Special file types
- 13 Changing file attributes
- 14 File space usage
- 15 Printing text
- 16 Conditions
- 17 Redirection
- 18 File name manipulation
- 19 Working context
- 20 User information
- 21 System context
- 22 SELinux context
- 23 Modified command invocation
- 24 Process control
- 25 Delaying
- 26 Numeric operations
- 27 File permissions
- 28 File timestamps
- 29 Date input formats
- 30 Version sort ordering
- 31 Opening the Software Toolbox
- Appendix A GNU Free Documentation License
- Index
Table of Contents
- 1 Introduction
- 2 Common options
- 2.1 Exit status
- 2.2 Backup options
- 2.3 Block size
- 2.4 Floating point numbers
- 2.5 Signal specifications
- 2.6 chown, chgrp, chroot, id: Disambiguating user names and IDs
- 2.7 Sources of random data
- 2.8 Target directory
- 2.9 Trailing slashes
- 2.10 Traversing symlinks
- 2.11 Treating
/specially - 2.12 Special built-in utilities
- 2.13 Standards conformance
- 2.14
coreutils: Multi-call program
- 3 Output of entire files
- 3.1
cat: Concatenate and write files - 3.2
tac: Concatenate and write files in reverse - 3.3
nl: Number lines and write files - 3.4
od: Write files in octal or other formats - 3.5
base32: Transform data into printable data - 3.6
base64: Transform data into printable data - 3.7
basenc: Transform data into printable data
- 3.1
- 4 Formatting file contents
- 5 Output of parts of files
- 6 Summarizing files
- 7 Operating on sorted files
- 8 Operating on fields
- 9 Operating on characters
- 10 Directory listing
- 11 Basic operations
- 12 Special file types
- 12.1
link: Make a hard link via the link syscall - 12.2
ln: Make links between files - 12.3
mkdir: Make directories - 12.4
mkfifo: Make FIFOs (named pipes) - 12.5
mknod: Make block or character special files - 12.6
readlink: Print value of a symlink or canonical file name - 12.7
rmdir: Remove empty directories - 12.8
unlink: Remove files via the unlink syscall
- 12.1
- 13 Changing file attributes
- 14 File space usage
- 15 Printing text
- 16 Conditions
- 17 Redirection
- 18 File name manipulation
- 19 Working context
- 20 User information
- 21 System context
- 22 SELinux context
- 23 Modified command invocation
- 23.1
chroot: Run a command with a different root directory - 23.2
env: Run a command in a modified environment - 23.3
nice: Run a command with modified niceness - 23.4
nohup: Run a command immune to hangups - 23.5
stdbuf: Run a command with modified I/O stream buffering - 23.6
timeout: Run a command with a time limit
- 23.1
- 24 Process control
- 25 Delaying
- 26 Numeric operations
- 27 File permissions
- 28 File timestamps
- 29 Date input formats
- 29.1 General date syntax
- 29.2 Calendar date items
- 29.3 Time of day items
- 29.4 Time zone items
- 29.5 Combined date and time of day items
- 29.6 Day of week items
- 29.7 Relative items in date strings
- 29.8 Pure numbers in date strings
- 29.9 Seconds since the Epoch
- 29.10 Specifying time zone rules
- 29.11 Authors of
parse_datetime
- 30 Version sort ordering
- 31 Opening the Software Toolbox
- Appendix A GNU Free Documentation License
- Index
Next: Introduction, Up: (dir) [Contents][Index]
GNU Coreutils
This manual documents version 9.0 of the GNU core utilities, including the standard programs for text and file manipulation.
Copyright © 1994–2021 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
| • Introduction | Caveats, overview, and authors | |
| • Common options | Common options | |
| • Output of entire files | cat tac nl od base32 base64 basenc | |
| • Formatting file contents | fmt pr fold | |
| • Output of parts of files | head tail split csplit | |
| • Summarizing files | wc sum cksum b2sum md5sum sha1sum sha2 | |
| • Operating on sorted files | sort shuf uniq comm ptx tsort | |
| • Operating on fields | cut paste join | |
| • Operating on characters | tr expand unexpand | |
| • Directory listing | ls dir vdir dircolors | |
| • Basic operations | cp dd install mv rm shred | |
| • Special file types | mkdir rmdir unlink mkfifo mknod ln link readlink | |
| • Changing file attributes | chgrp chmod chown touch | |
| • File space usage | df du stat sync truncate | |
| • Printing text | echo printf yes | |
| • Conditions | false true test expr | |
| • Redirection | tee | |
| • File name manipulation | dirname basename pathchk mktemp realpath | |
| • Working context | pwd stty printenv tty | |
| • User information | id logname whoami groups users who | |
| • System context | date arch nproc uname hostname hostid uptime | |
| • SELinux context | chcon runcon | |
| • Modified command invocation | chroot env nice nohup stdbuf timeout | |
| • Process control | kill | |
| • Delaying | sleep | |
| • Numeric operations | factor numfmt seq | |
| • File permissions | Access modes | |
| • File timestamps | File timestamp issues | |
| • Date input formats | Specifying date strings | |
| • Version sort ordering | Details on version-sort algorithm | |
| • Opening the software toolbox | The software tools philosophy | |
| • GNU Free Documentation License | Copying and sharing this manual | |
| • Concept index | General index | |
— The Detailed Node Listing — Common Options |
||
| • Exit status | Indicating program success or failure | |
| • Backup options | Backup options | |
| • Block size | Block size | |
| • Floating point | Floating point number representation | |
| • Signal specifications | Specifying signals | |
| • Disambiguating names and IDs | chgrp, chown, chroot, id: user and group syntax | |
| • Random sources | Sources of random data | |
| • Target directory | Target directory | |
| • Trailing slashes | Trailing slashes | |
| • Traversing symlinks | Traversing symlinks to directories | |
| • Treating / specially | Treating / specially | |
| • Standards conformance | Standards conformance | |
| • Multi-call invocation | Multi-call program invocation | |
Output of entire files |
||
| • cat invocation | Concatenate and write files | |
| • tac invocation | Concatenate and write files in reverse | |
| • nl invocation | Number lines and write files | |
| • od invocation | Write files in octal or other formats | |
| • base32 invocation | Transform data into printable data | |
| • base64 invocation | Transform data into printable data | |
| • basenc invocation | Transform data into printable data | |
Formatting file contents |
||
| • fmt invocation | Reformat paragraph text | |
| • pr invocation | Paginate or columnate files for printing | |
| • fold invocation | Wrap input lines to fit in specified width | |
Output of parts of files |
||
| • head invocation | Output the first part of files | |
| • tail invocation | Output the last part of files | |
| • split invocation | Split a file into fixed-size pieces | |
| • csplit invocation | Split a file into context-determined pieces | |
Summarizing files |
||
| • wc invocation | Print newline, word, and byte counts | |
| • sum invocation | Print checksum and block counts | |
| • cksum invocation | Print CRC checksum and byte counts | |
| • b2sum invocation | Print or check BLAKE2 digests | |
| • md5sum invocation | Print or check MD5 digests | |
| • sha1sum invocation | Print or check SHA-1 digests | |
| • sha2 utilities | Print or check SHA-2 digests | |
Operating on sorted files |
||
| • sort invocation | Sort text files | |
| • shuf invocation | Shuffle text files | |
| • uniq invocation | Uniquify files | |
| • comm invocation | Compare two sorted files line by line | |
| • ptx invocation | Produce a permuted index of file contents | |
| • tsort invocation | Topological sort | |
ptx: Produce permuted indexes |
||
| • General options in ptx | Options which affect general program behavior | |
| • Charset selection in ptx | Underlying character set considerations | |
| • Input processing in ptx | Input fields, contexts, and keyword selection | |
| • Output formatting in ptx | Types of output format, and sizing the fields | |
| • Compatibility in ptx | The GNU extensions to ptx
| |
Operating on fields |
||
| • cut invocation | Print selected parts of lines | |
| • paste invocation | Merge lines of files | |
| • join invocation | Join lines on a common field | |
Operating on characters |
||
| • tr invocation | Translate, squeeze, and/or delete characters | |
| • expand invocation | Convert tabs to spaces | |
| • unexpand invocation | Convert spaces to tabs | |
tr: Translate, squeeze, and/or delete characters |
||
| • Character sets | Specifying sets of characters | |
| • Translating | Changing one set of characters to another | |
| • Squeezing and deleting | Removing characters | |
Directory listing |
||
| • ls invocation | List directory contents | |
| • dir invocation | Briefly list directory contents | |
| • vdir invocation | Verbosely list directory contents | |
| • dircolors invocation | Color setup for ls
| |
ls: List directory contents |
||
| • Which files are listed | Which files are listed | |
| • What information is listed | What information is listed | |
| • Sorting the output | Sorting the output | |
| • General output formatting | General output formatting | |
| • Formatting the file names | Formatting the file names | |
Basic operations |
||
| • cp invocation | Copy files and directories | |
| • dd invocation | Convert and copy a file | |
| • install invocation | Copy files and set attributes | |
| • mv invocation | Move (rename) files | |
| • rm invocation | Remove files or directories | |
| • shred invocation | Remove files more securely | |
Special file types |
||
| • link invocation | Make a hard link via the link syscall | |
| • ln invocation | Make links between files | |
| • mkdir invocation | Make directories | |
| • mkfifo invocation | Make FIFOs (named pipes) | |
| • mknod invocation | Make block or character special files | |
| • readlink invocation | Print value of a symlink or canonical file name | |
| • rmdir invocation | Remove empty directories | |
| • unlink invocation | Remove files via unlink syscall | |
Changing file attributes |
||
| • chown invocation | Change file owner and group | |
| • chgrp invocation | Change group ownership | |
| • chmod invocation | Change access permissions | |
| • touch invocation | Change file timestamps | |
File space usage |
||
| • df invocation | Report file system space usage | |
| • du invocation | Estimate file space usage | |
| • stat invocation | Report file or file system status | |
| • sync invocation | Synchronize cached writes to persistent storage | |
| • truncate invocation | Shrink or extend the size of a file | |
Printing text |
||
| • echo invocation | Print a line of text | |
| • printf invocation | Format and print data | |
| • yes invocation | Print a string until interrupted | |
Conditions |
||
| • false invocation | Do nothing, unsuccessfully | |
| • true invocation | Do nothing, successfully | |
| • test invocation | Check file types and compare values | |
| • expr invocation | Evaluate expressions | |
test: Check file types and compare values |
||
| • File type tests | File type tests | |
| • Access permission tests | Access permission tests | |
| • File characteristic tests | File characteristic tests | |
| • String tests | String tests | |
| • Numeric tests | Numeric tests | |
expr: Evaluate expression |
||
| • String expressions | + : match substr index length | |
| • Numeric expressions | + - * / % | |
| • Relations for expr | & < <= = == != >= > | |
| • Examples of expr | Examples of using expr
| |
Redirection |
||
| • tee invocation | Redirect output to multiple files or processes | |
File name manipulation |
||
| • basename invocation | Strip directory and suffix from a file name | |
| • dirname invocation | Strip last file name component | |
| • pathchk invocation | Check file name validity and portability | |
| • mktemp invocation | Create temporary file or directory | |
| • realpath invocation | Print resolved file names | |
Working context |
||
| • pwd invocation | Print working directory | |
| • stty invocation | Print or change terminal characteristics | |
| • printenv invocation | Print all or some environment variables | |
| • tty invocation | Print file name of terminal on standard input | |
stty: Print or change terminal characteristics |
||
| • Control | Control settings | |
| • Input | Input settings | |
| • Output | Output settings | |
| • Local | Local settings | |
| • Combination | Combination settings | |
| • Characters | Special characters | |
| • Special | Special settings | |
User information |
||
| • id invocation | Print user identity | |
| • logname invocation | Print current login name | |
| • whoami invocation | Print effective user ID | |
| • groups invocation | Print group names a user is in | |
| • users invocation | Print login names of users currently logged in | |
| • who invocation | Print who is currently logged in | |
System context |
||
| • arch invocation | Print machine hardware name | |
| • date invocation | Print or set system date and time | |
| • nproc invocation | Print the number of processors | |
| • uname invocation | Print system information | |
| • hostname invocation | Print or set system name | |
| • hostid invocation | Print numeric host identifier | |
| • uptime invocation | Print system uptime and load | |
date: Print or set system date and time |
||
| • Time conversion specifiers | %[HIklMNpPrRsSTXzZ] | |
| • Date conversion specifiers | %[aAbBcCdDeFgGhjmuUVwWxyY] | |
| • Literal conversion specifiers | %[%nt] | |
| • Padding and other flags | Pad with zeros, spaces, etc. | |
| • Setting the time | Changing the system clock | |
| • Options for date | Instead of the current time | |
| • Date input formats | Specifying date strings | |
| • Examples of date | Examples | |
SELinux context |
||
| • chcon invocation | Change SELinux context of file | |
| • runcon invocation | Run a command in specified SELinux context | |
Modified command invocation |
||
| • chroot invocation | Run a command with a different root directory | |
| • env invocation | Run a command in a modified environment | |
| • nice invocation | Run a command with modified niceness | |
| • nohup invocation | Run a command immune to hangups | |
| • stdbuf invocation | Run a command with modified I/O buffering | |
| • timeout invocation | Run a command with a time limit | |
Process control |
||
| • kill invocation | Sending a signal to processes. | |
Delaying |
||
| • sleep invocation | Delay for a specified time | |
Numeric operations |
||
| • factor invocation | Print prime factors | |
| • numfmt invocation | Reformat numbers | |
| • seq invocation | Print numeric sequences | |
File timestamps |
||
| • File timestamps | File timestamp issues | |
File permissions |
||
| • Mode Structure | Structure of file mode bits | |
| • Symbolic Modes | Mnemonic representation of file mode bits | |
| • Numeric Modes | File mode bits as octal numbers | |
| • Directory Setuid and Setgid | Set-user-ID and set-group-ID on directories | |
Date input formats |
||
| • General date syntax | Common rules | |
| • Calendar date items | 21 Jul 2020 | |
| • Time of day items | 9:20pm | |
| • Time zone items | UTC, -0700, +0900, … | |
| • Combined date and time of day items | 2020-07-21T20:02:00,000000-0400 | |
| • Day of week items | Monday and others | |
| • Relative items in date strings | next tuesday, 2 years ago | |
| • Pure numbers in date strings | 20200721, 1440 | |
| • Seconds since the Epoch | @1595289600 | |
| • Specifying time zone rules | TZ="America/New_York", TZ="UTC0" | |
| • Authors of parse_datetime | Bellovin, Eggert, Salz, Berets, et al. | |
Version sorting order |
||
| • Version sort overview | ||
| • Implementation Details | ||
| • Differences from the official Debian Algorithm | ||
| • Advanced Topics | ||
Opening the software toolbox |
||
| • Toolbox introduction | Toolbox introduction | |
| • I/O redirection | I/O redirection | |
| • The who command | The who command
| |
| • The cut command | The cut command
| |
| • The sort command | The sort command
| |
| • The uniq command | The uniq command
| |
| • Putting the tools together | Putting the tools together | |
Copying This Manual |
||
| • GNU Free Documentation License | Copying and sharing this manual | |
Next: Introduction, Up: (dir) [Contents][Index]