GNU fileutils

A set of file utilities

for version {No value for ‘VERSION’}, {No value for ‘UPDATED’}

David MacKenzie et al.

Copyright © 1994, 95, 96 Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1 Introduction

This manual is incomplete: No attempt is made to explain basic file concepts in a way suitable for novices. Thus, if you are interested, please get involved in improving this manual. The entire GNU community will benefit.

The GNU file utilities are mostly compatible with the POSIX.2 standard.

Please report bugs to ‘bug-gnu-utils@prep.ai.mit.edu’. Remember to include the version number, machine architecture, input files, and any other information needed to reproduce the bug: your input, what you expected, what you got, and why it is wrong. Diffs are welcome, but please include a description of the problem as well, since this is sometimes difficult to infer. See Bugs in GNU CC.

This manual is based on the Unix man pages in the distribution, which were originally written by David MacKenzie and updated by Jim Meyering. {No value for ‘Francois’} Pinard did the initial conversion to Texinfo format. Karl Berry did the indexing, some reorganization, and editing of the results. Richard Stallman contributed his usual invaluable insights to the overall process.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2 Common options

Certain options are available in all of these programs (in fact, every GNU program should accept them). Rather than writing identical descriptions for each of the programs, they are described here.

--help

Print a usage message listing all available options, then exit successfully.

--version

Print the version number, then exit successfully.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Backup options

Some GNU programs (at least cp, install, ln, and mv) optionally make backups of files before writing new versions. These options control the details of these backups. The options are also briefly mentioned in the descriptions of the particular programs.

-b
--backup

Make backups of files that are about to be overwritten or removed. Without this option, the original versions are destroyed.

-S suffix
--suffix=suffix

Append suffix to each backup file made with ‘-b’. If this option is not specified, the value of the SIMPLE_BACKUP_SUFFIX environment variable is used. And if SIMPLE_BACKUP_SUFFIX is not set, the default is ‘~’, just as in Emacs.

-V method
--version-control=method

Use method to determine the type of backups made with ‘-b’. If this option is not specified, the value of the VERSION_CONTROL environment variable is used. And if VERSION_CONTROL is not set, the default backup type is ‘existing’.

This option corresponds to the Emacs variable ‘version-control’; the same values for method are accepted as in Emacs. This options also more descriptive name. The valid methods (unique abbreviations are accepted):

t
numbered

Always make numbered backups.

nil
existing

Make numbered backups of files that already have them, simple backups of the others.

never
simple

Always make simple backups.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3 File permissions


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4 Directory listing

This chapter describes the ls command and its variants dir and vdir, which list information about files.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 ls: List directory contents

The ls program lists information about files (of any type, including directories). Options and file arguments can be intermixed arbitrarily, as usual.

For non-option command-line arguments that are directories, by default ls lists the contents of directories, not recursively, and omitting files with names beginning with .. For other non-option arguments, by default ls lists just the file name. If no non-option arguments are specified, ls lists the contents of the current directory.

By default, the output is sorted alphabetically. If standard output is a terminal, the output is in columns (sorted vertically); otherwise, they are listed one per line.

Because ls is such a fundamental program, it has accumulated many options over the years. They are described in the subsections below; within each section, options are listed alphabetically (ignoring case). The division of options into the subsections is not absolute, since some options affect more than one aspect of ls’s operation.

The ‘-g’ option is accepted but ignored, for compatibility with Unix. Also see Common options.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1.1 Which files are listed

These options determine which files ls lists information for. By default, any files and the contents of any directories on the command line are shown.

-a
--all

List all files in directories, including files that start with ‘.’.

-A
--almost-all

List all files in directories except for ‘.’ and ‘..’.

-B
--ignore-backups

Do not list files that end with ‘~’, unless they are given on the command line.

-d
--directory

List just the names of directories, as with other types of files, rather than listing their contents.

-I
--ignore

Do not list files whose names match the shell pattern (not regular expression) pattern unless they are given on the command line. As in the shell, an initial ‘.’ in a file name does not match a wildcard at the start of pattern.

-L
--dereference

List the files linked to by symbolic links instead of listing the contents of the links.

-R
--recursive

List the contents of all directories recursively.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1.2 What information is listed

These options affect the information that ls displays. By default, only file names are shown.

-D
--dired

With the long listing (‘-l’) format, print an additional line after the main output:

//DIRED// beg1 end1 beg2 end2 …

The begN and endN are unsigned integers which record the byte position of the beginning and end of each file name in the output. This makes it easy for Emacs to find the names, even when they contain unusual characters such as space or newline, without fancy searching.

If directories are being listed recursively (-R), output a similar line after each subdirectory:

//SUBDIRED// beg1 end1 …
-G
--no-group

Inhibit display of group information in a long format directory listing. (This is the default in some non-GNU versions of ls, so we provide this option for compatibility.)

-i
--inode

Print the inode number (also called the file serial number and index number) of each file to the left of the file name. (This number uniquely identifies each file within a particular filesystem.)

-l
--format=long
--format=verbose

In addition to the name of each file, print the file type, permissions, number of hard links, owner name, group name, size in bytes, and timestamp (by default, the modification time). For files with a time more than six months old or more than one hour into the future, the timestamp contains the year instead of the time of day.

For each directory that is listed, preface the files with a line ‘total blocks’, where blocks is the total disk space used by all files in that directory. By default, 1024-byte blocks are used; if the environment variable POSIXLY_CORRECT is set, 512-byte blocks are used (unless the ‘-k’ option is given). The blocks computed counts each hard link separately; this is arguably a deficiency.

The permissions listed are similar to symbolic mode specifications (@pxref{Symbolic Modes}). But ls combines multiple bits into the third character of each set of permissions as follows:

s

If the setuid or setgid bit and the corresponding executable bit are both set.

S

If the setuid or setgid bit is set but the corresponding executable bit is not set.

t

If the sticky bit and the other-executable bit are both set.

T

If the sticky bit is set but the other-executable bit is not set.

x

If the executable bit is set and none of the above apply.

-

Otherwise.

-o

Produce long format directory listings, but don’t display group information. It is equivalent to using ‘--format=long’ with ‘--no-group’ . This option is provided for compatibility with other versions of ls.

-s
--size

Print the size of each file in 1024-byte blocks to the left of the file name. If the environment variable POSIXLY_CORRECT is set, 512-byte blocks are used instead, unless the ‘-k’ option is given (see section General output formatting).

For files that are NFS-mounted from an HP-UX system to a BSD system, this option reports sizes that are half the correct values. On HP-UX systems, it reports sizes that are twice the correct values for files that are NFS-mounted from BSD systems. This is due to a flaw in HP-UX; it also affects the HP-UX ls program.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1.3 Sorting the output

These options change the order in which ls sorts the information it outputs. By default, sorting is done by character code (e.g., ASCII order).

-c
--time=ctime
--time=status

Sort according to the status change time (the ‘ctime’ in the inode). If the long listing format (‘-l’) is being used, print the status change time instead of the modification time.

-f

Primarily, like ‘-U’—do not sort; list the files in whatever order they are stored in the directory. But also enable ‘-a’ (list all files) and disable ‘-l’, ‘--color’, and ‘-s’ (if they were specified before the ‘-f’).

-r
--reverse

Reverse whatever the sorting method is—e.g., list files in reverse alphabetical order, youngest first, smallest first, or whatever.

-S
--sort=size

Sort by file size, largest first.

-t
--sort=time

Sort by modification time (the ‘mtime’ in the inode), newest first.

-u
--time=atime
--time=access
--time=use

Sort by access time (the ‘atime’ in the inode). If the long listing format is being used, print the last access time.

-U
--sort=none

Do not sort; list the files in whatever order they are stored in the directory. (Do not do any of the other unrelated things that ‘-f’ does.) This is especially useful when listing very large directories, since not doing any sorting can be noticeably faster.

-X
--sort=extension

Sort directory contents alphabetically by file extension (characters after the last ‘.’); files with no extension are sorted first.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1.4 General output formatting

These options affect the appearance of the overall output.

-1
--format=single-column

List one file per line. This is the default for ls when standard output is not a terminal.

-C
--format=vertical

List files in columns, sorted vertically. This is the default for ls if standard output is a terminal. It is always the default for the dir and d programs.

--color [=when]

Specify whether to use color for distinguishing file types. when may be omitted, or one of:

Specifying ‘--color’ and no when is equivalent to ‘--color=always’.

-F
--classify

Append a character to each file name indicating the file type. Also, for regular files that are executable, append ‘*’. The file type indicators are ‘/’ for directories, ‘@’ for symbolic links, ‘|’ for FIFOs, ‘=’ for sockets, and nothing for regular files.

--full-time

List times in full, rather than using the standard abbreviation heuristics. The format is the same as date’s default; it’s not possible to change this, but you can extract out the date string with cut and then pass the result to date -d. See date invocation in Shell utilities.

This is most useful because the time output includes the seconds. (Unix filesystems store file timestamps only to the nearest second, so this option shows all the information there is.) For example, this can help when you have a Makefile that is not regenerating files properly.

-k
--kilobytes

If file sizes are being listed, print them in kilobytes. This overrides the environment variable POSIXLY_CORRECT.

-m
--format=commas

List files horizontally, with as many as will fit on each line, separated by ‘, ’ (a comma and a space).

-n
--numeric-uid-gid

List the numeric UID and GID instead of the names.

-p

Append a character to each file name indicating the file type. This is like ‘-F’, except that executables are not marked.

-x format
--format=across
--format=horizontal

List the files in columns, sorted horizontally.

-T cols
--tabsize=cols

Assume that each tabstop is cols columns wide. The default is 8. ls uses tabs where possible in the output, for efficiency. If cols is zero, do not use tabs at all.

-w
--width=cols

Assume the screen is cols columns wide. The default is taken from the terminal settings if possible; otherwise the environment variable COLUMNS is used if it is set; otherwise the default is 80.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1.5 Formatting the file names

These options change how file names themselves are printed.

-b
--escape

Quote nongraphic characters in file names using alphabetic and octal backslash sequences like those used in C.

-N
--literal

Do not quote file names.

-q
--hide-control-chars

Print question marks instead of nongraphic characters in file names. This is the default.

-Q
--quote-name

Enclose file names in double quotes and quote nongraphic characters as in C.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2 dir: Briefly list directory contents

dir (also installed as d) is equivalent to ls -C; that is, files are by default listed in columns, sorted vertically.

See section ls.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3 vdir: Verbosely list directory contents

vdir (also installed as v)is equivalent to ls -l; that is, files are by default listed in long format.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 dircolors: Color setup for ls

dircolors outputs a sequence of shell commands to set up the terminal for color output from ls (and dir, etc.). Typical usage:

eval `dircolors [option]… [file]`

If file is specified, dircolors reads it to determine which colors to use for which file types and extensions. Otherwise, a precompiled database is used. For details on the format of these files, run ‘dircolors --print-data-base’.

The output is a shell command to set the LS_COLOR environment variable. You can specify the shell syntax to use on the command line, or dircolors will guess it from the value of the SHELL environment variable.

The program accepts the following options. Also see Common options.

-b
--sh
--bourne-shell

Output Bourne shell commands. This is the default if the SHELL environment variable is set and does not end with ‘csh’ or ‘tcsh’.

-c
--csh
--c-shell

Output C shell commands. This is the default if SHELL ends with csh or tcsh.

-p
--print-data-base

Print the (compiled-in) default color configuration database. This output is itself a valid configuration file, and is fairly descriptive of the possibilities.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5 Basic operations

This chapter describes the commands for basic file manipulation: copying, moving (renaming), and deleting (removing).


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 cp: Copy files and directories

cp copies files (or, optionally, directories). The copy is completely independent of the original. You can either copy one file to another, or copy arbitrarily many files to a destination directory. Synopsis:

cp [option]… source dest
cp [option]… sourcedirectory

If the last argument names an existing directory, cp copies each source file into that directory (retaining the same name). Otherwise, if only two files are given, it copies the first onto the second. It is an error if the last argument is not a directory and more than two non-option arguments are given.

Generally, files are written just as they are read. For exceptions, see the ‘--sparse’ option below.

By default, cp does not copy directories (see ‘-r’ below).

cp generally refuses to copy a file onto itself, with the following exception: if ‘--force --backup’ is specified with source and dest identical, and referring to a regular file, cp will make a backup file, either regular or numbered, as specified in the usual ways (see section Backup options). This is useful when you simply want to make a backup of an existing file before changing it.

The program accepts the following options. Also see Common options.

-a
--archive

Preserve as much as possible of the structure and attributes of the original files in the copy (but do not preserve directory structure). Equivalent to ‘-dpR’.

-b
--backup

Make backups of files that are about to be overwritten or removed. See section Backup options.

-d
--no-dereference

Copy symbolic links as symbolic links rather than copying the files that they point to, and preserve hard links between source files in the copies.

-f
--force

Remove existing destination files.

-i
--interactive

Prompt whether to overwrite existing regular destination files.

-l
--link

Make hard links instead of copies of non-directories.

-p
--preserve

Preserve the original files’ owner, group, permissions, and timestamps.

-P
--parents

Form the name of each destination file by appending to the target directory a slash and the specified name of the source file. The last argument given to cp must be the name of an existing directory. For example, the command:

cp --parents a/b/c existing_dir

copies the file ‘a/b/c’ to ‘existing_dir/a/b/c’, creating any missing intermediate directories.

-r

Copy directories recursively, copying any non-directories and non-symbolic links (that is, FIFOs and special files) as if they were regular files. This means trying to read the data in each source file and writing it to the destination. Thus, with this option, cp may well hang indefinitely reading a FIFO, unless something else happens to be writing it.

-R
--recursive

Copy directories recursively, preserving non-directories (see ‘-r’ just above).

--sparse=when

A sparse file contains holes—a sequence of zero bytes that does not occupy any physical disk blocks; the ‘read’ system call reads these as zeroes. This can both save considerable disk space and increase speed, since many binary files contain lots of consecutive zero bytes. By default, cp detects holes in input source files via a crude heuristic and makes the corresponding output file sparse as well.

The when value can be one of the following:

auto

The default behavior: the output file is sparse if the input file is sparse.

always

Always make the output file sparse. This is useful when the input file resides on a filesystem that does not support sparse files (the most notable example is ‘efs’ filesystems in SGI IRIX 5.3 and earlier), but the output file is on another type of filesystem.

never

Never make the output file sparse. If you find an application for this option, let us know.

-s
--symbolic-link

Make symbolic links instead of copies of non-directories. All source file names must be absolute (starting with ‘/’) unless the destination files are in the current directory. This option merely results in an error message on systems that do not support symbolic links.

-S suffix
--suffix=suffix

Append suffix to each backup file made with ‘-b’. See section Backup options.

-u
--update

Do not copy a nondirectory that has an existing destination with the same or newer modification time.

-v
--verbose

Print the name of each file before copying it.

-V method
--version-control=method

Change the type of backups made with ‘-b’. The method argument can be ‘numbered’ (or ‘t’), ‘existing’ (or ‘nil’), or ‘never’ (or ‘simple’). See section Backup options.

-x
--one-file-system

Skip subdirectories that are on different filesystems from the one that the copy started on.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2 dd: Convert and copy a file

dd copies a file (from standard input to standard output, by default) with a changeable I/O blocksize, while optionally performing conversions on it. Synopsis:

dd [option]…

The program accepts the following options. Also see Common options.

The numeric-valued options below (bytes and blocks) can be followed by a multiplier: ‘b’=512, ‘c’=1, ‘k’=1024, ‘w’=2, ‘xm’=m.

if=file

Read from file instead of standard input.

of=file

Write to file instead of standard output. Unless ‘conv=notrunc’ is given, dd truncates file to zero bytes (or the size specified with ‘seek=’).

ibs=bytes

Read bytes bytes at a time.

obs=bytes

Write bytes bytes at a time.

bs=bytes

Both read and write bytes bytes at a time. This overrides ‘ibs’ and ‘obs’.

cbs=bytes

Convert bytes bytes at a time.

skip=blocks

Skip blocksibs’-byte blocks in the input file before copying.

seek=blocks

Skip blocksobs’-byte blocks in the output file before copying.

count=blocks

Copy blocksobs’-byte blocks from the input file, instead of everything until the end of the file.

conv=conversion[,conversion]…

Convert the file as specified by the conversion argument(s). (No spaces around any comma(s).)

Conversions:

ascii

Convert EBCDIC to ASCII.

ebcdic

Convert ASCII to EBCDIC.

ibm

Convert ASCII to alternate EBCDIC.

block

For each line in the input, output ‘cbs’ bytes, replacing the input newline with a space and padding with spaces as necessary.

unblock

Replace trailing spaces in each ‘cbs’-sized input block with a newline.

lcase

Change uppercase letters to lowercase.

ucase

Change lowercase letters to uppercase.

swab

Swap every pair of input bytes. GNU dd, unlike others, works when an odd number of bytes are read—the last byte is simply copied (since there is nothing to swap it with).

noerror

Continue after read errors.

notrunc

Do not truncate the output file.

sync

Pad every input block to size of ‘ibs’ with trailing zero bytes.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.3 install: Copy files and set attributes

install copies files while setting their permission modes and, if possible, their owner and group. Synopses:

install [option]… source dest
install [option]… sourcedirectory
install -d [option]… directory

In the first of these, the source file is copied to the dest target file. In the second, each of the source files are copied to the destination directory. In the last, each directory (and any missing parent directories) is created.

install is similar to cp, but allows you to control the attributes of destination files. It is typically used in Makefiles to copy programs into their destination directories. It refuses to copy files onto themselves.

The program accepts the following options. Also see Common options.

-b
--backup

Make backups of files that are about to be overwritten or removed. See section Backup options.

-c

Ignored; for compatibility with old Unix versions of install.

-d
--directory

Create each given directory and any missing parent directories, setting the owner, group and mode as given on the command line or to the defaults. It also gives any parent directories it creates those attributes. (This is different from the SunOS 4.x install, which gives directories that it creates the default attributes.)

-g group
--group=group

Set the group ownership of installed files or directories to group. The default is the process’s current group. group may be either a group name or a numeric group id.

-m mode
--mode=mode

Set the permissions for the installed file or directory to mode, which can be either an octal number, or a symbolic mode as in chmod, with 0 as the point of departure (see section File permissions). The default mode is 0755—read, write, and execute for the owner, and read and execute for group and other.

-o owner
--owner=owner

If install has appropriate privileges (is run as root), set the ownership of installed files or directories to owner. The default is root. owner may be either a user name or a numeric user ID.

-s
--strip

Strip the symbol tables from installed binary executables.

-S suffix
--suffix=suffix

Append suffix to each backup file made with ‘-b’. See section Backup options.

-V method
--version-control=method

Change the type of backups made with ‘-b’. The method argument can be ‘numbered’ (or ‘t’), ‘existing’ (or ‘nil’), or ‘never’ (or ‘simple’). See section Backup options.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4 mv: Move (rename) files

mv moves or renames files (or directories). Synopsis:

mv [option]… source dest
mv [option]… sourcedirectory

If the last argument names an existing directory, mv moves each other given file into a file with the same name in that directory. Otherwise, if only two files are given, it renames the first as the second. It is an error if the last argument is not a directory and more than two files are given.

mv can move only regular files across filesystems.

If a destination file exists but is normally unwritable, standard input is a terminal, and the ‘-f’ or ‘--force’ option is not given, mv prompts the user for whether to replace the file. (You might own the file, or have write permission on its directory.) If the response does not begin with ‘y’ or ‘Y’, the file is skipped.

The program accepts the following options. Also see Common options.

-b
--backup

Make backups of files that are about to be overwritten or removed. See section Backup options.

-f
--force

Remove existing destination files and never prompt the user.

-i
--interactive

Prompt whether to overwrite each existing destination file, regardless of its permissions. If the response does not begin with ‘y’ or ‘Y’, the file is skipped.

-u
--update

Do not move a nondirectory that has an existing destination with the same or newer modification time.

-v
--verbose

Print the name of each file before moving it.

-S suffix
--suffix=suffix

Append suffix to each backup file made with ‘-b’. See section Backup options.

-V method
--version-control=method

Change the type of backups made with ‘-b’. The method argument can be ‘numbered’ (or ‘t’), ‘existing’ (or ‘nil’), or ‘never’ (or ‘simple’). See section Backup options.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.5 rm: Remove files or directories

rm removes each given file. By default, it does not remove directories. Synopsis:

rm [option]… [file]…

If a file is unwritable, standard input is a terminal, and the ‘-f’ or ‘--force’ option is not given, or the ‘-i’ or ‘--interactive’ option is given, rm prompts the user for whether to remove the file. If the response does not begin with ‘y’ or ‘Y’, the file is skipped.

The program accepts the following options. Also see Common options.

-d
--directory

Remove directories with unlink instead of rmdir, and don’t require a directory to be empty before trying to unlink it. Only works if you have appropriate privileges. Because unlinking a directory causes any files in the deleted directory to become unreferenced, it is wise to fsck the filesystem after doing this.

-f
--force

Ignore nonexistent files and never prompt the user.

-i
--interactive

Prompt whether to remove each file. If the response does not begin with ‘y’ or ‘Y’, the file is skipped.

-r
-R
--recursive

Remove the contents of directories recursively.

-v
--verbose

Print the name of each file before removing it.

One common question is how to remove files whose names being with a ‘-’. GNU rm, like every program that uses the getopt function to parse its arguments, lets you use the ‘--’ option to indicate that all following arguments are non-options. To remove a file called ‘-f’ in the current directory, you could type either:

rm -- -f

or:

rm ./-f

The Unix rm program’s use of a single ‘-’ for this purpose predates the development of the getopt standard syntax.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6 Special file types

This chapter describes commands which create special types of files (and rmdir, which removes directories, one special file type).

Although Unix-like operating systems have markedly fewer special file types than others, not everything can be treated only as the undifferentiated byte stream of normal files. For example, when a file is created or removed, the system must record this information, which it does in a directory—a special type of file. Although you can read directories as normal files, if you’re curious, in order for the system to do its job it must impose a structure, a certain order, on the bytes of the file. Thus it is a “special” type of file.

Besides directories, other special file types include named pipes (FIFOs), symbolic links, sockets, and so-called special files.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 ln: Make links between files

ln makes links between files. By default, it makes hard links; with the ‘-s’ option, it makes symbolic (or soft) links. Synopses:

ln [option]… source [dest]
ln [option]… sourcedirectory

If the last argument names an existing directory, ln links each source file into a file with the same name in that directory. (But see the description of the ‘--no-dereference’ option below.) If only one file is given, it links that file into the current directory. Otherwise, if only two files are given, it links the first onto the second. It is an error if the last argument is not a directory and more than two files are given. By default, it does not remove existing files.

A hard link is another name for an existing file; the link and the original are indistinguishable. (Technically speaking, they share the same inode, and the inode contains all the information about a file—indeed, it is not incorrect to say that the inode is the file.) On all existing implementations, you cannot make a hard links to directories, and hard links cannot cross filesystem boundaries. (These restrictions are not mandated by POSIX, however.)

Symbolic links (symlinks for short), on the other hand, are a special file type (which not all kernels support; in particular, system V release 3 (and older) systems lack symlinks) in which the link file actually refers to a different file, by name. When most operations (opening, reading, writing, and so on) are passed the symbolic link file, the kernel automatically dereferences the link and operates on the target of the link. But some operations (e.g., removing) work on the link file itself, rather than on its target. See Symbolic Links in GNU C library.

The program accepts the following options. Also see Common options.

-b
--backup

Make backups of files that are about to be overwritten or removed. See section Backup options.

-d
-F
--directory

Allow the super-user to make hard links to directories.

-f
--force

Remove existing destination files.

-i
--interactive

Prompt whether to remove existing destination files.

-n
--no-dereference

When given an explicit destination that is a symlink to a directory, treat that destination as if it were a normal file.

When the destination is an actual directory (not a symlink to one), there is no ambiguity. The link is created in that directory. But when the specified destination is a symlink to a directory, there are two ways to treat the user’s request. ln can treat the destination just as it would a normal directory and create the link in it. On the other hand, the destination can be viewed as a non-directory—as the symlink itself. In that case, ln must delete or backup that symlink before creating the new link. The default is to treat a destination that is a symlink to a directory just like a directory.

-s
--symbolic

Make symbolic links instead of hard links. This option merely produces an error message on systems that do not support symbolic links.

-v
--verbose

Print the name of each file before linking it.

-S suffix
--suffix=suffix

Append suffix to each backup file made with ‘-b’. See section Backup options.

-V method
--version-control=method

Change the type of backups made with ‘-b’. The method argument can be ‘numbered’ (or ‘t’), ‘existing’ (or ‘nil’), or ‘never’ (or ‘simple’). See section Backup options.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 mkdir: Make directories

mkdir creates directories with the specified names. Synopsis:

mkdir [option]… name

It is not an error if a name is already a directory; mkdir simply proceeds. But if a name is an existing file and is anything but a directory, mkdir complains.

The program accepts the following options. Also see Common options.

-m mode
--mode=mode

Set the mode of created directories to mode, which is symbolic as in chmod and uses 0777 (read, write and execute allowed for everyone) minus the bits set in the umask for the point of the departure. See section File permissions.

-p
--parents

Make any missing parent directories for each argument. The mode for parent directories is set to the umask modified by ‘u+wx’. Ignore arguments corresponding to existing directories.

--verbose

Print a message for each created directory. This is most useful with ‘--parents’.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.3 mkfifo: Make FIFOs (named pipes)

mkfifo creates FIFOs (also called named pipes) with the specified names. Synopsis:

mkfifo [option] name

A FIFO is a special file type that permits independent processes to communicate. One process opens the FIFO file for writing, and another for reading, after which data can flow as with the usual anonymous pipe in shells or elsewhere.

The program accepts the following option. Also see Common options.

-m mode
--mode=mode

Set the mode of created FIFOs to mode, which is symbolic as in chmod and uses 0666 (read and write allowed for everyone) minus the bits set in the umask for the point of departure. See section File permissions.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4 mknod: Make block or character special files

mknod creates a FIFO, character special file, or block special file with the specified name. Synopsis:

mknod [option]… name type [major minor]

Unlike the phrase “special file type” above, the term special file has a technical meaning on Unix: something that can generate or receive data. Usually this corresponds to a physical piece of hardware, e.g., a printer or a disk. (These files are typically created at system-configuration time.) The mknod command is what creates files of this type. Such devices can be read either a character at a time or a “block” (many characters) at a time, hence we say there are block special files and character special files.

The arguments after name specify the type of file to make:

p

for a FIFO

b

for a block (buffered) special file

c

for a character (buffered) special file

u

for a character (unbuffered) special file

When making a block or character special file, the major and minor device numbers must be given after the file type.

The program accepts the following option. Also see Common options.

-m mode
--mode=mode

Set the mode of created files to mode, which is symbolic as in chmod and uses 0666 minus the bits set in the umask as the point of departure. See section File permissions.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5 rmdir: Remove empty directories

rmdir removes empty directories. Synopsis:

rmdir [option]… directory

If any directory argument does not refer to an existing empty directory, it is an error.

The program accepts the following option. Also see Common options.

-p
--parents

Remove any parent directories that become empty after an argument directory is removed.

See section rm: Remove files or directories, for how to remove non-empty directories (recursively).


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7 Changing file attributes

A file is not merely its contents, a name, and a file type (see section Special file types). A file also has an owner (a userid), a group (a group id), permissions (what the owner can do with the file, what people in the group can do, and what everyone else can do), various timestamps, and other information. Collectively, we call these a file’s attributes.

These commands change file attributes.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1 chown: Change file owner and group

chown changes the user and/or group ownership of each given file. Synopsis:

chown [option]… new-owner file

The first non-option argument, new-owner, specifies the new owner and/or group, as follows (with no embedded white space):

[owner] [ [:.] [group] ]

Specifically:

owner

If only an owner (a user name or numeric user id) is given, that user is made the owner of each given file, and the files’ group is not changed.

owner‘.’group
owner‘:’group

If the owner is followed by a colon or dot and a group (a group name or numeric group id), with no spaces between them, the group ownership of the files is changed as well (to group).

owner‘.
owner‘:

If a colon or dot but no group name follows owner, that user is made the owner of the files and the group of the files is changed to owner’s login group.

.’group
:’group

If the colon or dot and following group are given, but the owner is omitted, only the group of the files is changed; in this case, chown performs the same function as chgrp.

The program accepts the following options. Also see Common options.

-c
--changes

Verbosely describe the action for each file whose ownership actually changes.

-f
--silent
--quiet

Do not print error messages about files whose ownership cannot be changed.

-f
--no-dereference

Act on symbolic links themselves instead of what they point to. Only available if the lchown system call is provided.

-v
--verbose

Verbosely describe the action (or non-action) taken for every file.

-R
--recursive

Recursively change ownership of directories and their contents.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2 chgrp: Change group ownership

chgrp changes the group ownership of each given file to group, which can be either a group name or a numeric group id. Synopsis:

chgrp [option]… group file

The program accepts the following options. Also see Common options.

-c
--changes

Verbosely describe the action for each file whose group actually changes.

-f
--silent
--quiet

Do not print error messages about files whose group cannot be changed.

-f
--no-dereference

Act on symbolic links themselves instead of what they point to. Only available if the lchown system call is provided.

-v
--verbose

Verbosely describe the action or non-action taken for every file.

-R
--recursive

Recursively change the group ownership of directories and their contents.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 chmod: Change access permissions

chmod changes the access permissions of the named files. Synopsis:

chmod [option]… mode file

chmod never changes the permissions of symbolic links, since the chmod system call cannot change their permissions. This is not a problem since the permissions of symbolic links are never used. However, for each symbolic link listed on the command line, chmod changes the permissions of the pointed-to file. In contrast, chmod ignores symbolic links encountered during recursive directory traversals.

The first non-option argument, mode, specifies the new permissions. See the section below for details.

The program accepts the following options. Also see Common options.

-c
--changes

Verbosely describe the action for each file whose permissions actually changes.

-f
--silent
--quiet

Do not print error messages about files whose permissions cannot be changed.

-v
--verbose

Verbosely describe the action or non-action taken for every file.

-R
--recursive

Recursively change permissions of directories and their contents.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4 touch: Change file timestamps

touch changes the access and/or modification times of the specified files. Synopsis:

touch [option]… file

If the first file would be a valid argument to the ‘-t’ option and no timestamp is given with any of the ‘-d’, ‘-r’, or ‘-t’ options and the ‘--’ argument is not given, that argument is interpreted as the time for the other files instead of as a file name.

Any file that does not exist is created empty.

If changing both the access and modification times to the current time, touch can change the timestamps for files that the user running it does not own but has write permission for. Otherwise, the user must own the files.

The program accepts the following options. Also see Common options.

-a
--time=atime
--time=access
--time=use

Change the access time only.

-c
--no-create

Do not create files that do not exist.

-d
--date=time

Use time instead of the current time. It can contain month names, timezones, ‘am’ and ‘pm’, etc. @xref{Date input formats}.

-f

Ignored; for compatibility with BSD versions of touch.

-m
--time=mtime
--time=modify

Change the modification time only.

-r file
--reference=file

Use the times of the reference file instead of the current time.

-t MMDDhhmm[[CC]YY][.ss]

Use the argument (months, days, hours, minutes, optional century and years, optional seconds) instead of the current time.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8 Disk usage

No disk can hold an infinite amount of data. These commands report on how much disk storage is in use or available. (This has nothing much to do with how much main memory, i.e., RAM, a program is using when it runs; for that, you want ps or pstat or swap or some such command.)


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1 df: Report filesystem disk space usage

df reports the amount of disk space used and available on filesystems. Synopsis:

df [option]… [file]…

With no arguments, df reports the space used and available on all currently mounted filesystems (of all types). Otherwise, df reports on the filesystem containing each argument file.

Disk space is shown in 1024-byte blocks by default, unless the environment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used (unless the ‘-k’ option is given).

If an argument file is a disk device file containing a mounted filesystem, df shows the space available on that filesystem rather than on the filesystem containing the device node (i.e., the root filesystem). GNU df does not attempt to determine the disk usage on unmounted filesystems, because on most kinds of systems doing so requires extremely nonportable intimate knowledge of filesystem structures.

The program accepts the following options. Also see Common options.

-a
--all

Include in the listing filesystems that have a size of 0 blocks, which are omitted by default. Such filesystems are typically special-purpose pseudo-filesystems, such as automounter entries. Also, filesystems of type “ignore” or “auto”, supported by some operating systems, are only included if this option is specified.

-h
--human-readable

Append a size letter such as ‘M’ for megabytes to each size.

-i
--inodes

List inode usage information instead of block usage. An inode (short for index node) is contains information about a file such as its owner, permissions, timestamps, and location on the disk.

-k
--kilobytes

Print sizes in 1024-byte blocks. This overrides the environment variable POSIXLY_CORRECT.

-m
--megabytes

Print sizes in megabyte (that 1,048,576 bytes) blocks.

--no-sync

Do not invoke the sync system call before getting any usage data. This may make df run significantly faster on systems with many disks, but on some systems (notably SunOS) the results may be slightly out of date. This is the default.

-P
--portability

Use the POSIX output format. This is like the default format except that the information about each filesystem is always printed on exactly one line; a mount device is never put on a line by itself. This means that if the mount device name is more than 20 characters long (e.g., for some network mounts), the columns are misaligned.

--sync

Invoke the sync system call before getting any usage data. On some systems (notably SunOS), doing this yields more up to date results, but in general this option makes df much slower, especially when there are many or very busy filesystems.

-t fstype
--type=fstype

Limit the listing to filesystems of type fstype. Multiple filesystem types can be specified by giving multiple ‘-t’ options. By default, nothing is omitted.

-T
--print-type

Print each filesystem’s type. The types printed here are the same ones you can include or exclude with ‘-t’ and ‘-x’. The particular types printed are whatever is supported by the system. Here are some of the common names (this list is certainly not exhaustive):

nfs

An NFS filesystem, i.e., one mounted over a network from another machine. This is the one type name which seems to be used uniformly by all systems.

4.2, ufs, efs…

A filesystem on a locally-mounted hard disk. (The system might even support more than one type here; Linux does.)

hsfs, cdfs

A filesystem on a CD-ROM drive. HP-UX uses ‘cdfs’, most other systems use ‘hsfs’ (‘hs’ for ‘High Sierra’).

pcfs

An MS-DOS filesystem, usually on a diskette.

-x fstype
--exclude-type=fstype

Limit the listing to filesystems not of type fstype. Multiple filesystem types can be eliminated by giving multiple ‘-x’ options. By default, no filesystem types are omitted.

-v

Ignored; for compatibility with System V versions of df.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2 du: Estimate file space usage

du reports the amount of disk space used by the specified files and for each subdirectory (of directory arguments). Synopsis:

du [option]… [file]…

With no arguments, du reports the disk space for the current directory. The output is in 1024-byte units by default, unless the environment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used (unless ‘-k’ is specified).

The program accepts the following options. Also see Common options.

-a
--all

Show counts for all files, not just directories.

-b
--bytes

Print sizes in bytes, instead of kilobytes.

-c
--total

Print a grand total of all arguments after all arguments have been processed. This can be used to find out the total disk usage of a given set of files or directories.

-D
--dereference-args

Dereference symbolic links that are command line arguments. Does not affect other symbolic links. This is helpful for finding out the disk usage of directories, such as ‘/usr/tmp’, which are often symbolic links.

-h
--human-readable

Append a size letter, such as ‘M’ for megabytes, to each size.

-k
--kilobytes

Print sizes in kilobytes. This overrides the environment variable POSIXLY_CORRECT.

-l
--count-links

Count the size of all files, even if they have appeared already (as a hard link).

-L
--dereference

Dereference symbolic links (show the disk space used by the file or directory that the link points to instead of the space used by the link).

-m
--megabytes

Print sizes in megabyte (that 1,048,576 bytes) blocks.

-s
--summarize

Display only a total for each argument.

-S
--separate-dirs

Report the size of each directory separately, not including the sizes of subdirectories.

-x
--one-file-system

Skip directories that are on different filesystems from the one that the argument being processed is on.

On BSD systems, du reports sizes that are half the correct values for files that are NFS-mounted from HP-UX systems. On HP-UX systems, it reports sizes that are twice the correct values for files that are NFS-mounted from BSD systems. This is due to a flaw in HP-UX; it also affects the HP-UX du program.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.3 sync: Synchronize data on disk with memory

sync writes any data buffered in memory out to disk. This can include (but is not limited to) modified superblocks, modified inodes, and delayed reads and writes. This must be implemented by the kernel; The sync program does nothing but exercise the sync system call.

The kernel keeps data in memory to avoid doing (relatively slow) disk reads and writes. This improves performance, but if the computer crashes, data may be lost or the filesystem corrupted as a result. sync ensures everything in memory is written to disk.

Any arguments are ignored, except for a lone ‘--help’ or ‘--version’ (see section Common options).


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Index

Jump to:   -   4  
A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   R   S   T   U   V  
Index Entry  Section

-
- and Unix rm 5.5 rm: Remove files or directories
-’, removing files beginning with 5.5 rm: Remove files or directories
-1 4.1.4 General output formatting
-a 4.1.1 Which files are listed
-A 4.1.1 Which files are listed
-a 5.1 cp: Copy files and directories
-a 7.4 touch: Change file timestamps
-a 8.1 df: Report filesystem disk space usage
-a 8.2 du: Estimate file space usage
--all 4.1.1 Which files are listed
--all 8.1 df: Report filesystem disk space usage
--all 8.2 du: Estimate file space usage
--almost-all 4.1.1 Which files are listed
--archive 5.1 cp: Copy files and directories
-b 2.1 Backup options
-B 4.1.1 Which files are listed
-b 4.1.5 Formatting the file names
-b 4.4 dircolors: Color setup for ls
-b 5.1 cp: Copy files and directories
-b 5.3 install: Copy files and set attributes
-b 5.4 mv: Move (rename) files
-b 6.1 ln: Make links between files
-b 8.2 du: Estimate file space usage
--backup 2.1 Backup options
--backup 5.1 cp: Copy files and directories
--backup 5.3 install: Copy files and set attributes
--backup 5.4 mv: Move (rename) files
--backup 6.1 ln: Make links between files
--bourne-shell 4.4 dircolors: Color setup for ls
--bytes 8.2 du: Estimate file space usage
-c 4.1.3 Sorting the output
-C 4.1.4 General output formatting
-c 4.4 dircolors: Color setup for ls
-c 5.3 install: Copy files and set attributes
-c 7.1 chown: Change file owner and group
-c 7.2 chgrp: Change group ownership
-c 7.3 chmod: Change access permissions
-c 7.4 touch: Change file timestamps
-c 8.2 du: Estimate file space usage
--c-shell 4.4 dircolors: Color setup for ls
--changes 7.1 chown: Change file owner and group
--changes 7.2 chgrp: Change group ownership
--changes 7.3 chmod: Change access permissions
--classify 4.1.4 General output formatting
--color 4.1.4 General output formatting
--count-links 8.2 du: Estimate file space usage
--csh 4.4 dircolors: Color setup for ls
-d 4.1.1 Which files are listed
-D 4.1.2 What information is listed
-d 5.1 cp: Copy files and directories
-d 5.3 install: Copy files and set attributes
-d 5.5 rm: Remove files or directories
-d 6.1 ln: Make links between files
-d 7.4 touch: Change file timestamps
-D 8.2 du: Estimate file space usage
--date 7.4 touch: Change file timestamps
--dereference 4.1.1 Which files are listed
--dereference 8.2 du: Estimate file space usage
--dereference-args 8.2 du: Estimate file space usage
--directory 4.1.1 Which files are listed
--directory 5.3 install: Copy files and set attributes
--directory 5.5 rm: Remove files or directories
--directory 6.1 ln: Make links between files
--dired 4.1.2 What information is listed
--escape 4.1.5 Formatting the file names
--exclude-type 8.1 df: Report filesystem disk space usage
-f 4.1.3 Sorting the output
-F 4.1.4 General output formatting
-f 5.1 cp: Copy files and directories
-f 5.4 mv: Move (rename) files
-f 5.5 rm: Remove files or directories
-F 6.1 ln: Make links between files
-f 6.1 ln: Make links between files
-f 7.1 chown: Change file owner and group
-f 7.1 chown: Change file owner and group
-f 7.2 chgrp: Change group ownership
-f 7.2 chgrp: Change group ownership
-f 7.3 chmod: Change access permissions
-f 7.4 touch: Change file timestamps
--force 5.1 cp: Copy files and directories
--force 5.4 mv: Move (rename) files
--force 5.5 rm: Remove files or directories
--force 6.1 ln: Make links between files
--format 4.1.2 What information is listed
--format 4.1.4 General output formatting
--format 4.1.4 General output formatting
--format 4.1.4 General output formatting
--format 4.1.4 General output formatting
--full-time 4.1.4 General output formatting
-G 4.1.2 What information is listed
-g 5.3 install: Copy files and set attributes
-g (ignored) 4.1 ls: List directory contents
--group 5.3 install: Copy files and set attributes
-h 8.1 df: Report filesystem disk space usage
-h 8.2 du: Estimate file space usage
--help 2 Common options
--hide-control-chars 4.1.5 Formatting the file names
--human-readable 8.1 df: Report filesystem disk space usage
--human-readable 8.2 du: Estimate file space usage
-I 4.1.1 Which files are listed
-i 4.1.2 What information is listed
-i 5.1 cp: Copy files and directories
-i 5.4 mv: Move (rename) files
-i 5.5 rm: Remove files or directories
-i 6.1 ln: Make links between files
-i 8.1 df: Report filesystem disk space usage
--ignore-backups 4.1.1 Which files are listed
--ignore=pattern 4.1.1 Which files are listed
--inode 4.1.2 What information is listed
--inodes 8.1 df: Report filesystem disk space usage
--interactive 5.1 cp: Copy files and directories
--interactive 5.4 mv: Move (rename) files
--interactive 5.5 rm: Remove files or directories
--interactive 6.1 ln: Make links between files
-k 4.1.4 General output formatting
-k 8.1 df: Report filesystem disk space usage
-k 8.2 du: Estimate file space usage
--kilobytes 4.1.4 General output formatting
--kilobytes 8.1 df: Report filesystem disk space usage
--kilobytes 8.2 du: Estimate file space usage
-L 4.1.1 Which files are listed
-l 4.1.2 What information is listed
-l 5.1 cp: Copy files and directories
-l 8.2 du: Estimate file space usage
-L 8.2 du: Estimate file space usage
--link 5.1 cp: Copy files and directories
--literal 4.1.5 Formatting the file names
-m 4.1.4 General output formatting
-m 5.3 install: Copy files and set attributes
-m 6.2 mkdir: Make directories
-m 6.3 mkfifo: Make FIFOs (named pipes)
-m 6.4 mknod: Make block or character special files
-m 7.4 touch: Change file timestamps
-m 8.1 df: Report filesystem disk space usage
-m 8.2 du: Estimate file space usage
--megabytes 8.1 df: Report filesystem disk space usage
--megabytes 8.2 du: Estimate file space usage
--mode 5.3 install: Copy files and set attributes
--mode 6.2 mkdir: Make directories
--mode 6.3 mkfifo: Make FIFOs (named pipes)
--mode 6.4 mknod: Make block or character special files
-n 4.1.4 General output formatting
-N 4.1.5 Formatting the file names
-n 6.1 ln: Make links between files
--no-create 7.4 touch: Change file timestamps
--no-dereference 5.1 cp: Copy files and directories
--no-dereference 6.1 ln: Make links between files
--no-dereference 7.1 chown: Change file owner and group
--no-dereference 7.2 chgrp: Change group ownership
--no-group 4.1.2 What information is listed
--no-sync 8.1 df: Report filesystem disk space usage
--numeric-uid-gid 4.1.4 General output formatting
-o 4.1.2 What information is listed
-o 5.3 install: Copy files and set attributes
--one-file-system 5.1 cp: Copy files and directories
--one-file-system 8.2 du: Estimate file space usage
--owner 5.3 install: Copy files and set attributes
-p 4.4 dircolors: Color setup for ls
-p 5.1 cp: Copy files and directories
-P 5.1 cp: Copy files and directories
-p 6.2 mkdir: Make directories
-p 6.5 rmdir: Remove empty directories
-P 8.1 df: Report filesystem disk space usage
--parents 5.1 cp: Copy files and directories
--parents 6.2 mkdir: Make directories
--parents 6.5 rmdir: Remove empty directories
--portability 8.1 df: Report filesystem disk space usage
--preserve 5.1 cp: Copy files and directories
--print-data-base 4.4 dircolors: Color setup for ls
--print-type 8.1 df: Report filesystem disk space usage
-q 4.1.5 Formatting the file names
-Q 4.1.5 Formatting the file names
--quiet 7.1 chown: Change file owner and group
--quiet 7.2 chgrp: Change group ownership
--quiet 7.3 chmod: Change access permissions
--quote-name 4.1.5 Formatting the file names
-R 4.1.1 Which files are listed
-r 4.1.3 Sorting the output
-R 5.1 cp: Copy files and directories
-r 5.5 rm: Remove files or directories
-R 5.5 rm: Remove files or directories
-R 7.1 chown: Change file owner and group
-R 7.2 chgrp: Change group ownership
-R 7.3 chmod: Change access permissions
-r 7.4 touch: Change file timestamps
--recursive 4.1.1 Which files are listed
--recursive 5.1 cp: Copy files and directories
--recursive 5.5 rm: Remove files or directories
--recursive 7.1 chown: Change file owner and group
--recursive 7.2 chgrp: Change group ownership
--recursive 7.3 chmod: Change access permissions
--reference 7.4 touch: Change file timestamps
--reverse 4.1.3 Sorting the output
-S 2.1 Backup options
-s 4.1.2 What information is listed
-S 4.1.3 Sorting the output
-s 5.1 cp: Copy files and directories
-S 5.1 cp: Copy files and directories
-s 5.3 install: Copy files and set attributes
-S 5.3 install: Copy files and set attributes
-S 5.4 mv: Move (rename) files
-s 6.1 ln: Make links between files
-S 6.1 ln: Make links between files
-s 8.2 du: Estimate file space usage
-S 8.2 du: Estimate file space usage
--separate-dirs 8.2 du: Estimate file space usage
--sh 4.4 dircolors: Color setup for ls
--silent 7.1 chown: Change file owner and group
--silent 7.2 chgrp: Change group ownership
--silent 7.3 chmod: Change access permissions
--size 4.1.2 What information is listed
--sort 4.1.3 Sorting the output
--sort 4.1.3 Sorting the output
--sort 4.1.3 Sorting the output
--sort 4.1.3 Sorting the output
--sparse=when 5.1 cp: Copy files and directories
--strip 5.3 install: Copy files and set attributes
--suffix 2.1 Backup options
--suffix 5.1 cp: Copy files and directories
--suffix 5.3 install: Copy files and set attributes
--suffix 5.4 mv: Move (rename) files
--suffix 6.1 ln: Make links between files
--summarize 8.2 du: Estimate file space usage
--symbolic 6.1 ln: Make links between files
--symbolic-link 5.1 cp: Copy files and directories
--sync 8.1 df: Report filesystem disk space usage
-t 4.1.3 Sorting the output
-T 4.1.4 General output formatting
-t 8.1 df: Report filesystem disk space usage
-T 8.1 df: Report filesystem disk space usage
--tabsize 4.1.4 General output formatting
--time 4.1.3 Sorting the output
--time 4.1.3 Sorting the output
--time 7.4 touch: Change file timestamps
--time 7.4 touch: Change file timestamps
--total 8.2 du: Estimate file space usage
--type 8.1 df: Report filesystem disk space usage
-u 4.1.3 Sorting the output
-U 4.1.3 Sorting the output
-u 5.1 cp: Copy files and directories
-u 5.4 mv: Move (rename) files
--update 5.1 cp: Copy files and directories
--update 5.4 mv: Move (rename) files
-V 2.1 Backup options
-v 5.1 cp: Copy files and directories
-V 5.1 cp: Copy files and directories
-V 5.3 install: Copy files and set attributes
-v 5.4 mv: Move (rename) files
-V 5.4 mv: Move (rename) files
-v 5.5 rm: Remove files or directories
-v 6.1 ln: Make links between files
-V 6.1 ln: Make links between files
-v 7.1 chown: Change file owner and group
-v 7.2 chgrp: Change group ownership
-v 7.3 chmod: Change access permissions
--verbose 5.1 cp: Copy files and directories
--verbose 5.4 mv: Move (rename) files
--verbose 5.5 rm: Remove files or directories
--verbose 6.1 ln: Make links between files
--verbose 6.2 mkdir: Make directories
--verbose 7.1 chown: Change file owner and group
--verbose 7.2 chgrp: Change group ownership
--verbose 7.3 chmod: Change access permissions
--version 2 Common options
--version-control 2.1 Backup options
--version-control 5.1 cp: Copy files and directories
--version-control 5.3 install: Copy files and set attributes
--version-control 5.4 mv: Move (rename) files
--version-control 6.1 ln: Make links between files
-w 4.1.4 General output formatting
--width 4.1.4 General output formatting
-X 4.1.3 Sorting the output
-x 4.1.4 General output formatting
-x 5.1 cp: Copy files and directories
-x 8.1 df: Report filesystem disk space usage
-x 8.2 du: Estimate file space usage

4
4.2 filesystem type 8.1 df: Report filesystem disk space usage

A
access permissions, changing 7.3 chmod: Change access permissions
access time, changing 7.4 touch: Change file timestamps
access time, sorting files by 4.1.3 Sorting the output
across, listing files 4.1.4 General output formatting
alternate ebcdic, converting to 5.2 dd: Convert and copy a file
always color option 4.1.4 General output formatting
appropriate privileges 5.3 install: Copy files and set attributes
ascii, converting to 5.2 dd: Convert and copy a file
atime, changing 7.4 touch: Change file timestamps
atime, sorting files by 4.1.3 Sorting the output
attributes, file 7 Changing file attributes
auto color option 4.1.4 General output formatting
automounter filesystems 8.1 df: Report filesystem disk space usage

B
b for block special file 6.4 mknod: Make block or character special files
backslash sequences for file names 4.1.5 Formatting the file names
backup files, ignoring 4.1.1 Which files are listed
backup files, type made 2.1 Backup options
backup options 2.1 Backup options
backup suffix 2.1 Backup options
backups, making 2.1 Backup options
backups, making 5.1 cp: Copy files and directories
backups, making 5.3 install: Copy files and set attributes
backups, making 5.4 mv: Move (rename) files
backups, making 6.1 ln: Make links between files
backups, making only 5.1 cp: Copy files and directories
block (space-padding) 5.2 dd: Convert and copy a file
block size 5.2 dd: Convert and copy a file
block size of conversion 5.2 dd: Convert and copy a file
block size of input 5.2 dd: Convert and copy a file
block size of output 5.2 dd: Convert and copy a file
block special files 6.4 mknod: Make block or character special files
block special files, creating 6.4 mknod: Make block or character special files
Bourne shell syntax for color setup 4.4 dircolors: Color setup for ls
bs 5.2 dd: Convert and copy a file
BSD touch compatibility 7.4 touch: Change file timestamps
buffered character file 6.4 mknod: Make block or character special files
bugs, reporting 1 Introduction
byte-swapping 5.2 dd: Convert and copy a file

C
c for character special file 6.4 mknod: Make block or character special files
C shell syntax for color setup 4.4 dircolors: Color setup for ls
cbs 5.2 dd: Convert and copy a file
CD-ROM filesystem type 8.1 df: Report filesystem disk space usage
cdfs filesystem type 8.1 df: Report filesystem disk space usage
changed files, verbosely describing 7.2 chgrp: Change group ownership
changed owners, verbosely describing 7.1 chown: Change file owner and group
changing access permissions 7.3 chmod: Change access permissions
changing file attributes 7 Changing file attributes
changing file ownership 7.1 chown: Change file owner and group
changing file timestamps 7.4 touch: Change file timestamps
changing group ownership 7.1 chown: Change file owner and group
changing group ownership 7.2 chgrp: Change group ownership
character special files 6.4 mknod: Make block or character special files
character special files, creating 6.4 mknod: Make block or character special files
chgrp 7.2 chgrp: Change group ownership
chmod 7.3 chmod: Change access permissions
chown 7.1 chown: Change file owner and group
color database, printing 4.4 dircolors: Color setup for ls
color setup 4.4 dircolors: Color setup for ls
color, distinguishing file types with 4.1.4 General output formatting
COLUMNS 4.1.4 General output formatting
commas, outputting between files 4.1.4 General output formatting
common options 2 Common options
conv 5.2 dd: Convert and copy a file
converstion block size 5.2 dd: Convert and copy a file
converting while copying a file 5.2 dd: Convert and copy a file
copying directories recursively 5.1 cp: Copy files and directories
copying files and directories 5.1 cp: Copy files and directories
copying files and setting attributes 5.3 install: Copy files and set attributes
count 5.2 dd: Convert and copy a file
cp 5.1 cp: Copy files and directories
crashes and corruption 8.3 sync: Synchronize data on disk with memory
creating directories 6.2 mkdir: Make directories
creating FIFOs (named pipes) 6.3 mkfifo: Make FIFOs (named pipes)
creating links (hard or soft) 6.1 ln: Make links between files
csh syntax for color setup 4.4 dircolors: Color setup for ls
ctime, sorting by 4.1.3 Sorting the output

D
database for color setup, printing 4.4 dircolors: Color setup for ls
dd 5.2 dd: Convert and copy a file
dereferencing symbolic links 6.1 ln: Make links between files
device file, disk 8.1 df: Report filesystem disk space usage
df 8.1 df: Report filesystem disk space usage
dir 4.2 dir: Briefly list directory contents
dircolors 4.4 dircolors: Color setup for ls
directories, copying 5.1 cp: Copy files and directories
directories, copying recursively 5.1 cp: Copy files and directories
directories, creating 6.2 mkdir: Make directories
directories, creating with given attributes 5.3 install: Copy files and set attributes
directories, removing (recursively) 5.5 rm: Remove files or directories
directories, removing empty 6.5 rmdir: Remove empty directories
directories, removing with unlink 5.5 rm: Remove files or directories
directory listing 4.1 ls: List directory contents
directory listing, brief 4.2 dir: Briefly list directory contents
directory listing, recursive 4.1.1 Which files are listed
directory listing, verbose 4.3 vdir: Verbosely list directory contents
directory order, listing by 4.1.3 Sorting the output
dired Emacs mode support 4.1.2 What information is listed
disk device file 8.1 df: Report filesystem disk space usage
disk usage 8 Disk usage
disk usage by filesystem 8.1 df: Report filesystem disk space usage
disk usage for files 8.2 du: Estimate file space usage
diskette filesystem 8.1 df: Report filesystem disk space usage
DOS filesystem 8.1 df: Report filesystem disk space usage
du 8.2 du: Estimate file space usage

E
ebcdic, converting to 5.2 dd: Convert and copy a file
efs filesystem type 8.1 df: Report filesystem disk space usage
empty files, creating 7.4 touch: Change file timestamps
error messages, omitting 7.1 chown: Change file owner and group
error messages, omitting 7.2 chgrp: Change group ownership
error messages, omitting 7.3 chmod: Change access permissions
executables and file type, marking 4.1.4 General output formatting
existing backup method 2.1 Backup options
extension, sorting files by 4.1.3 Sorting the output

F
FIFOs, creating 6.3 mkfifo: Make FIFOs (named pipes)
file attributes, changing 7 Changing file attributes
file information, preserving 5.1 cp: Copy files and directories
file ownership, changing 7.1 chown: Change file owner and group
file permissions 3 File permissions
file space usage 8.2 du: Estimate file space usage
file timestamps, changing 7.4 touch: Change file timestamps
file type and executables, marking 4.1.4 General output formatting
file type, marking 4.1.4 General output formatting
file types 6 Special file types
file types, special 6 Special file types
files beginning with ‘-’, removing 5.5 rm: Remove files or directories
files, copying 5.1 cp: Copy files and directories
filesystem disk usage 8.1 df: Report filesystem disk space usage
filesystem space, retrieving current data more slowly 8.1 df: Report filesystem disk space usage
filesystem space, retrieving old data more quickly 8.1 df: Report filesystem disk space usage
filesystem types, limiting output to certain 8.1 df: Report filesystem disk space usage
filesystem types, printing 8.1 df: Report filesystem disk space usage
filesystems and hard links 6.1 ln: Make links between files
filesystems, omitting copying to different 5.1 cp: Copy files and directories
fsck 5.5 rm: Remove files or directories

G
grand total of disk space 8.2 du: Estimate file space usage
group ownership of installed files, setting 5.3 install: Copy files and set attributes
group ownership, changing 7.2 chgrp: Change group ownership
group ownerships, changing 7.1 chown: Change file owner and group

H
hard links to directories 6.1 ln: Make links between files
hard links, counting in du 8.2 du: Estimate file space usage
hard links, creating 6.1 ln: Make links between files
hard links, preserving 5.1 cp: Copy files and directories
help, online 2 Common options
High Sierra filesystem 8.1 df: Report filesystem disk space usage
history 1 Introduction
holes, copying files with 5.1 cp: Copy files and directories
horizontal, listing files 4.1.4 General output formatting
hsfs filesystem type 8.1 df: Report filesystem disk space usage
human-readable df output 8.1 df: Report filesystem disk space usage
human-readable df output 8.2 du: Estimate file space usage

I
ibs 5.2 dd: Convert and copy a file
if 5.2 dd: Convert and copy a file
ignore filesystems 8.1 df: Report filesystem disk space usage
inode number, printing 4.1.2 What information is listed
inode usage 8.1 df: Report filesystem disk space usage
inodes, written buffered 8.3 sync: Synchronize data on disk with memory
input block size 5.2 dd: Convert and copy a file
install 5.3 install: Copy files and set attributes
introduction 1 Introduction

K
kilobytes for filesystem sizes 8.1 df: Report filesystem disk space usage

L
lcase, converting to 5.2 dd: Convert and copy a file
lchown 7.1 chown: Change file owner and group
lchown 7.2 chgrp: Change group ownership
leading directories, creating missing 5.3 install: Copy files and set attributes
links, creating 6.1 ln: Make links between files
Linux filesystem types 8.1 df: Report filesystem disk space usage
ln 6.1 ln: Make links between files
local filesystem types 8.1 df: Report filesystem disk space usage
long ls format 4.1.2 What information is listed
ls 4.1 ls: List directory contents
LS_COLOR 4.4 dircolors: Color setup for ls

M
Makefiles, installing programs in 5.3 install: Copy files and set attributes
manipulating files 5 Basic operations
megabytes for filesystem sizes 8.1 df: Report filesystem disk space usage
megabytes for filesystem sizes 8.2 du: Estimate file space usage
mkdir 6.2 mkdir: Make directories
mkfifo 6.3 mkfifo: Make FIFOs (named pipes)
mknod 6.4 mknod: Make block or character special files
modes of created directories, setting 6.2 mkdir: Make directories
modes of created FIFOs, setting 6.3 mkfifo: Make FIFOs (named pipes)
modification time, sorting files by 4.1.3 Sorting the output
modify time, changing 7.4 touch: Change file timestamps
MS-DOS filesystem 8.1 df: Report filesystem disk space usage
mtime, changing 7.4 touch: Change file timestamps
multipliers after numbers 5.2 dd: Convert and copy a file
mv 5.4 mv: Move (rename) files

N
named pipes, creating 6.3 mkfifo: Make FIFOs (named pipes)
newer files, copying only 5.1 cp: Copy files and directories
newer files, moving only 5.4 mv: Move (rename) files
NFS filesystem type 8.1 df: Report filesystem disk space usage
NFS mounts from BSD to HP-UX 4.1.2 What information is listed
NFS mounts from BSD to HP-UX 8.2 du: Estimate file space usage
noerror 5.2 dd: Convert and copy a file
non-directories, copying as special files 5.1 cp: Copy files and directories
none color option 4.1.4 General output formatting
none, sorting option for ls 4.1.3 Sorting the output
notrunc 5.2 dd: Convert and copy a file
numbered backup method 2.1 Backup options
numeric uid and gid 4.1.4 General output formatting

O
obs 5.2 dd: Convert and copy a file
of 5.2 dd: Convert and copy a file
one filesystem, restricting du to 8.2 du: Estimate file space usage
one-line output format 8.1 df: Report filesystem disk space usage
output block size 5.2 dd: Convert and copy a file
output format, portable 8.1 df: Report filesystem disk space usage
ownership of installed files, setting 5.3 install: Copy files and set attributes

P
p for FIFO file 6.4 mknod: Make block or character special files
parent directories and cp 5.1 cp: Copy files and directories
parent directories, creating 6.2 mkdir: Make directories
parent directories, creating missing 5.3 install: Copy files and set attributes
parent directories, removing 6.5 rmdir: Remove empty directories
PC filesystem 8.1 df: Report filesystem disk space usage
pcfs 8.1 df: Report filesystem disk space usage
permissions of files 3 File permissions
permissions of installed files, setting 5.3 install: Copy files and set attributes
permissions, changing access 7.3 chmod: Change access permissions
permissions, for changing file timestamps 7.4 touch: Change file timestamps
permissions, output by ls 4.1.2 What information is listed
portable output format 8.1 df: Report filesystem disk space usage
POSIX output format 8.1 df: Report filesystem disk space usage
POSIX.2 1 Introduction
POSIXLY_CORRECT 8.1 df: Report filesystem disk space usage
POSIXLY_CORRECT, overridden by df -k 8.1 df: Report filesystem disk space usage
POSIXLY_CORRECT, overridden by du -k 8.2 du: Estimate file space usage
POSIXLY_CORRECT, overridden by ls -k 4.1.4 General output formatting
POSIXLY_CORRECT, overrides ls -s 4.1.2 What information is listed
printing color database 4.4 dircolors: Color setup for ls
prompting, and ln 6.1 ln: Make links between files
prompting, and mv 5.4 mv: Move (rename) files
prompting, and rm 5.5 rm: Remove files or directories
prompts, forcing 5.4 mv: Move (rename) files
prompts, omitting 5.4 mv: Move (rename) files

R
read errors, ignoring 5.2 dd: Convert and copy a file
read system call, and holes 5.1 cp: Copy files and directories
recursive directory listing 4.1.1 Which files are listed
recursively changing access permissions 7.3 chmod: Change access permissions
recursively changing file ownership 7.1 chown: Change file owner and group
recursively changing group ownership 7.2 chgrp: Change group ownership
recursively copying directories 5.1 cp: Copy files and directories
removing empty directories 6.5 rmdir: Remove empty directories
removing files or directories 5.5 rm: Remove files or directories
reverse sorting 4.1.3 Sorting the output
rm 5.5 rm: Remove files or directories
rmdir 6.5 rmdir: Remove empty directories
root as default owner 5.3 install: Copy files and set attributes

S
seek 5.2 dd: Convert and copy a file
self-backups 5.1 cp: Copy files and directories
setup for color 4.4 dircolors: Color setup for ls
sh syntax for color setup 4.4 dircolors: Color setup for ls
SHELL environment variable, and color 4.4 dircolors: Color setup for ls
simple backup method 2.1 Backup options
SIMPLE_BACKUP_SUFFIX 2.1 Backup options
single-column output of files 4.1.4 General output formatting
size of files, reporting 4.1.2 What information is listed
size of files, sorting files by 4.1.3 Sorting the output
skip 5.2 dd: Convert and copy a file
sorting ls output 4.1.3 Sorting the output
sparse files, copying 5.1 cp: Copy files and directories
special file types 6 Special file types
special file types 6 Special file types
special files 6.4 mknod: Make block or character special files
status time, sorting by 4.1.3 Sorting the output
stripping symbol table information 5.3 install: Copy files and set attributes
superblock, writing 8.3 sync: Synchronize data on disk with memory
swab (byte-swapping) 5.2 dd: Convert and copy a file
symbol table information, stripping 5.3 install: Copy files and set attributes
symbolic (soft) links, creating 6.1 ln: Make links between files
symbolic links, changing group 7.2 chgrp: Change group ownership
symbolic links, changing owner 7.1 chown: Change file owner and group
symbolic links, copying 5.1 cp: Copy files and directories
symbolic links, copying with 5.1 cp: Copy files and directories
symbolic links, dereferencing 4.1.1 Which files are listed
symbolic links, permissions of 7.3 chmod: Change access permissions
sync 8.3 sync: Synchronize data on disk with memory
sync (padding with nulls) 5.2 dd: Convert and copy a file
synchronize disk and memory 8.3 sync: Synchronize data on disk with memory

T
terminal, using color iff 4.1.4 General output formatting
time 7.4 touch: Change file timestamps
timestamps, changing file 7.4 touch: Change file timestamps
touch 7.4 touch: Change file timestamps
truncating output file, avoiding 5.2 dd: Convert and copy a file

U
u for unbuffered character special file 6.4 mknod: Make block or character special files
ucase, converting to 5.2 dd: Convert and copy a file
ufs filesystem type 8.1 df: Report filesystem disk space usage
unblock 5.2 dd: Convert and copy a file
unbuffered character special file 6.4 mknod: Make block or character special files
unlink 5.5 rm: Remove files or directories
unsorted directory listing 4.1.3 Sorting the output
use time, changing 7.4 touch: Change file timestamps
use time, sorting files by 4.1.3 Sorting the output

V
vdir 4.3 vdir: Verbosely list directory contents
verbose ls format 4.1.2 What information is listed
version number, finding 2 Common options
version-control Emacs variable 2.1 Backup options
VERSION_CONTROL 2.1 Backup options
vertical sorted files in columns 4.1.4 General output formatting

Jump to:   -   4  
A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   R   S   T   U   V  

[Top] [Contents] [Index] [ ? ]

Table of Contents


[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated on November 5, 2024 using texi2html 5.0.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ << ] FastBack Beginning of this chapter or previous chapter 1
[ < ] Back Previous section in reading order 1.2.2
[ Up ] Up Up section 1.2
[ > ] Forward Next section in reading order 1.2.4
[ >> ] FastForward Next chapter 2
[Top] Top Cover (top) of document  
[Contents] Contents Table of contents  
[Index] Index Index  
[ ? ] About About (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:


This document was generated on November 5, 2024 using texi2html 5.0.