Gnu/coreutils/index
GNU Coreutils
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 Disk 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
- 6.1
wc
: Print newline, word, and byte counts - 6.2
sum
: Print checksum and block counts - 6.3
cksum
: Print CRC checksum and byte counts - 6.4
b2sum
: Print or check BLAKE2 digests - 6.5
md5sum
: Print or check MD5 digests - 6.6
sha1sum
: Print or check SHA-1 digests - 6.7 sha2 utilities: Print or check SHA-2 digests
- 6.1
- 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 Disk 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 8.32 of the GNU core utilities, including the standard programs for text and file manipulation.
Copyright © 1994-2020 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”.
Caveats, overview, and authors
Common options
cat tac nl od base32 base64 basenc
fmt pr fold
head tail split csplit
wc sum cksum b2sum md5sum sha1sum sha2
sort shuf uniq comm ptx tsort
cut paste join
tr expand unexpand
ls dir vdir dircolors
cp dd install mv rm shred
mkdir rmdir unlink mkfifo mknod ln link readlink
chgrp chmod chown touch
df du stat sync truncate
echo printf yes
false true test expr
tee
dirname basename pathchk mktemp realpath
pwd stty printenv tty
id logname whoami groups users who
date arch nproc uname hostname hostid uptime
chcon runcon
chroot env nice nohup stdbuf timeout
kill
• Delaying
sleep
factor numfmt seq
Access modes
File timestamp issues
Specifying date strings
Details on version-sort algorithm
• Opening the software toolbox
The software tools philosophy
• GNU Free Documentation License
Copying and sharing this manual
General index
— The Detailed Node Listing — Common Options
Indicating program success or failure
Backup options
Block size
Floating point number representation
Specifying signals
• Disambiguating names and IDs
chgrp, chown, chroot, id: user and group syntax
Sources of random data
Target directory
Trailing slashes
Traversing symlinks to directories
Treating / specially
Standards conformance
Multi-call program invocation
Output of entire files
Concatenate and write files
Concatenate and write files in reverse
Number lines and write files
Write files in octal or other formats
Transform data into printable data
Transform data into printable data
Transform data into printable data
Formatting file contents
Reformat paragraph text
Paginate or columnate files for printing
Wrap input lines to fit in specified width
Output of parts of files
Output the first part of files
Output the last part of files
Split a file into fixed-size pieces
Split a file into context-determined pieces
Summarizing files
Print newline, word, and byte counts
Print checksum and block counts
Print CRC checksum and byte counts
Print or check BLAKE2 digests
Print or check MD5 digests
Print or check SHA-1 digests
Print or check SHA-2 digests
Operating on sorted files
Sort text files
Shuffle text files
Uniquify files
Compare two sorted files line by line
Produce a permuted index of file contents
Topological sort
ptx: Produce permuted indexes
Options which affect general program behavior
Underlying character set considerations
Input fields, contexts, and keyword selection
Types of output format, and sizing the fields
The GNU extensions to ptx
Operating on fields
Print selected parts of lines
Merge lines of files
Join lines on a common field
Operating on characters
Translate, squeeze, and/or delete characters
Convert tabs to spaces
Convert spaces to tabs
tr: Translate, squeeze, and/or delete characters
Specifying sets of characters
Changing one set of characters to another
Removing characters
Directory listing
List directory contents
Briefly list directory contents
Verbosely list directory contents
Color setup for ls
ls: List directory contents
Which files are listed
What information is listed
Sorting the output
General output formatting
Formatting the file names
Basic operations
Copy files and directories
Convert and copy a file
Copy files and set attributes
Move (rename) files
Remove files or directories
Remove files more securely
Special file types
Make a hard link via the link syscall
Make links between files
Make directories
Make FIFOs (named pipes)
Make block or character special files
Print value of a symlink or canonical file name
Remove empty directories
Remove files via unlink syscall
Changing file attributes
Change file owner and group
Change group ownership
Change access permissions
Change file timestamps
Disk usage
Report file system disk space usage
Estimate file space usage
Report file or file system status
Synchronize cached writes to persistent storage
Shrink or extend the size of a file
Printing text
Print a line of text
Format and print data
Print a string until interrupted
Conditions
Do nothing, unsuccessfully
Do nothing, successfully
Check file types and compare values
Evaluate expressions
test: Check file types and compare values
File type tests
Access permission tests
File characteristic tests
String tests
Numeric tests
expr: Evaluate expression
+ : match substr index length
+ - * / %
| & < <= = == != >= >
Examples of using expr
Redirection
Redirect output to multiple files or processes
File name manipulation
Strip directory and suffix from a file name
Strip last file name component
Check file name validity and portability
Create temporary file or directory
Print resolved file names
Working context
Print working directory
Print or change terminal characteristics
Print all or some environment variables
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 settings
Special characters
• Special
Special settings
User information
Print user identity
Print current login name
Print effective user ID
Print group names a user is in
Print login names of users currently logged in
Print who is currently logged in
System context
Print machine hardware name
Print or set system date and time
Print the number of processors
Print system information
Print or set system name
Print numeric host identifier
Print system uptime and load
date: Print or set system date and time
%[HIklMNpPrRsSTXzZ]
%[aAbBcCdDeFgGhjmuUVwWxyY]
• Literal conversion specifiers
%[%nt]
Pad with zeros, spaces, etc.
Changing the system clock
Instead of the current time
Specifying date strings
Examples
SELinux context
Change SELinux context of file
Run a command in specified SELinux context
Modified command invocation
Run a command with a different root directory
Run a command in a modified environment
Run a command with modified niceness
Run a command immune to hangups
Run a command with modified I/O buffering
Run a command with a time limit
Process control
Sending a signal to processes.
Delaying
Delay for a specified time
Numeric operations
Print prime factors
Reformat numbers
Print numeric sequences
File timestamps
File timestamp issues
File permissions
Structure of file mode bits
Mnemonic representation of file mode bits
File mode bits as octal numbers
Set-user-ID and set-group-ID on directories
Date input formats
Common rules
19 Dec 1994
9:20pm
EST, PDT, UTC, …
• Combined date and time of day items
1972-09-24T20:02:00,000000-0500
Monday and others
• Relative items in date strings
next tuesday, 2 years ago
• Pure numbers in date strings
19931219, 1440
@1078100502
TZ="America/New_York", TZ="UTC0"
Bellovin, Eggert, Salz, Berets, et al.
Version sorting order
• Differences from the official Debian Algorithm
Opening the software toolbox
Toolbox introduction
I/O redirection
The who
command
The cut
command
The sort
command
The uniq
command
Putting the tools together
Copying This Manual
• GNU Free Documentation License
Copying and sharing this manual
Next: Introduction, Up: (dir) [Contents][Index]