You are on page 1of 40

PRACTICAL-1:

MAN(1):
NAME
man - an interface to the system reference manuals

SYNOPSIS
man [man options] [[section] page ...] ...

man -k [apropos options] regexp ...

man -K [man options] [section] term ...

man -f [whatis options] page ...

man -l [man options] file ...

man -w|-W [man options] page ...

DESCRIPTION
man is the system's manual pager. Each page argument given to man is normally the name of
a program, utility or function. The manual page associated with each of these arguments is then

found and displayed. A section, if provided, will direct man to look only in that section of
the manual. The default action is to search in all of the available sections following a pre-
defined order (see DEFAULTS), and to show only the first page found, even if page exists
in several sections.
The table below shows the section numbers of the manual followed by the types of pages
they contain.
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)

5 File formats and conventions, e.g. /etc/passwd

6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)

EXAMPLE:
man ls
Display the manual page for the item (program) ls.

man man.7

Display the manual page for macro package man from section 7. (This is an alternative
spelling of "man 7 man".)

man 'man(7)'

Display the manual page for macro package man from section 7. (This is another
alternative spelling of "man 7 man". It may be more convenient when copying and pasting
cross-references

to manual pages. Note that the parentheses must normally be quoted to protect them from
the shell.)

man -a intro

Display, in succession, all of the available intro manual pages contained within the
manual. It is possible to quit between successive displays or skip any of them.

man -t bash | lpr -Pps

Format the manual page for bash into the default troff or groff format and pipe it to the
printer named ps. The default output for groff is usually PostScript. man --help should advise
as to which processor is bound to the -t option.

man -l -Tdvi ./foo.1x.gz > ./foo.1x.dvi

This command will decompress and format the nroff source manual page ./foo.1x.gz into
a device independent (dvi) file. The redirection is necessary as the -T flag causes output to be

directed to stdout with no pager. The output could be viewed with a program such as xdvi
or further processed into PostScript using a program such as dvips.

man -k printf

Search the short descriptions and manual page names for the keyword printf as regular
expression. Print out any matches. Equivalent to apropos printf.

man -f smail
Lookup the manual pages referenced by smail and print out the short descriptions of any
found. Equivalent to whatis smail.

MKDIR(1)
NAME
mkdir - make directories

SYNOPSIS
mkdir [OPTION]... DIRECTORY...

DESCRIPTION
Create the DIRECTORY(ies), if they do not already exist.

Mandatory arguments to long options are mandatory for short options too.

-m, --mode=MODE

set file mode (as in chmod), not a=rwx - umask

-p, --parents

no error if existing, make parent directories as needed


-v, --verbose

print a message for each created directory

-Z set SELinux security context of each created directory to the default type

--context[=CTX]

like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX

--help display this help and exit

--version

output version information and exitLS(1)

LS(1):
NAME
ls - list directory contents

SYNOPSIS
ls [OPTION]... [FILE]...

DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries
alphabetically if none of -cftuvSUX nor --sort is specified.

Mandatory arguments to long options are mandatory for short options too.

-a, --all

do not ignore entries starting with .

-A, --almost-all

do not list implied . and ..

--author

with -l, print the author of each file

-b, --escape

print C-style escapes for nongraphic characters

--block-size=SIZE

with -l, scale sizes by SIZE when printing them; e.g., '--block-size=M'; see SIZE format
below

-B, --ignore-backups

do not list implied entries ending with ~

-c with -lt: sort by, and show, ctime (time of last modification of file status information);
with -l: show ctime and sort by name; otherwise: sort by ctime, newest first

-C list entries by columns

--color[=WHEN]

colorize the output; WHEN can be 'always' (default if omitted), 'auto', or 'never'; more
info below

-d, --directory

list directories themselves, not their contents

-D, --dired

generate output designed for Emacs' dired mode

-f do not sort, enable -aU, disable -ls --color


-F, --classify

PWD(1)
NAME
pwd - print name of current/working directory

SYNOPSIS pwd [OPTION]...

DESCRIPTION
Print the full filename of the current working directory.

-L, --logical

use PWD from environment, even if it contains symlinks

-P, --physical

avoid all symlinks

--help display this help and exit

--version

output version information and exit


If no option is specified, -P is assumed.behaves differently, depending on the name of the
command (the executable may still be the same file).

vim The "normal" way, everything is default.

ex Start in Ex mode. Go to Normal mode with the ":vi" command. Can also be done
with the "-e" argument.

view Start in read-only mode. You will be protected from writing the files. Can also be
done with the "-R" argument.

gvim gview

The GUI version. Starts a new window. Can also be done with the "-g" argument.

evim eview

The GUI version in easy mode. Starts a new window. Can also be done with the "-y"
argument.

rvim rview rgvim rgview

Like the above, but with restrictions. It will not be possible to start shell commands,
or suspend Vim. Can also be done with the "-Z" argument.

OPTIONS
The options may be given in any order, before or after filenames. Options without an
argument can be combined after a single dash.

-A If Vim has been compiled with ARABIC support for editing right-to-left oriented files
and Arabic keyboard mapping, this option starts Vim in Arabic mode, i.e. 'arabic' is set.

Otherwise an error message is given and Vim aborts.

-b Binary mode. A few options will be set that makes it possible to edit a binary or
executable file.

-C Compatible. Set the 'compatible' option. This will make Vim behave mostly like Vi,
even though a .vimrc file exists.

-d Start in diff mode. There should be two, three or four file name arguments. Vim will
open all the files and show differences between them. Works like vimdiff(1).

-d {device} Open {device} for use as a terminal. Only on the Amiga. Example: "-d
con:20/30/600/150".
-D Debugging. Go to debugging mode when executing the first command from a script.

VIM(1)
NAME
vim - Vi IMproved, a programmer's text editor

SYNOPSIS
vim [options] [file ..]

vim [options] -

vim [options] -t tag

vim [options] -q [errorfile]

ex

view

gvim gview evim eview

rvim rview rgvim rgview

DESCRIPTION
Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain
text. It is especially useful for editing programs. There are a lot of enhancements above Vi:
multi level undo, multi windows and buffers, syntax highlighting, command line editing,
filename completion, on-line help, visual selection, etc..

See ":help vi_diff.txt" for a summary of the differences between Vim and Vi.While running
Vim a lot of help can be obtained from the on-line help system, with the ":help" command. See
the ON-LINE HELP section below.

Most often Vim is started to edit a single file with the command

vim file

More generally Vim is started with:

vim [options] [filelist]

If the filelist is missing, the editor will start with an empty buffer. Otherwise exactly one out
of the following four may be used to choose one or more files to be edited.

file .. A list of filenames. The first one will be the current file and read into the buffer.
The cursor will be positioned on the first line of the buffer. You can get to the other
files with the ":next" command. To edit a file that starts with a dash, precede the filelist with
"--".

- The file to edit is read from stdin. Commands are read from stderr, which should be
a tty.

-t {tag} The file to edit and the initial cursor position depends on a "tag", a sort of goto
label. {tag} is looked up in the tags file, the associated file becomes the current file and
the associated command is executed. Mostly this is used for C programs, in which case {tag}
could be a function name. The effect is that the file containing that function becomes the
current file and the cursor is positioned on the start of the function. See ":help tag-commands".

-q [errorfile]

Start in quickFix mode. The file [errorfile] is read and the first error is displayed. If
[errorfile] is omitted, the filename is obtained from the 'errorfile' option (defaults to "AztecC.Err"
for the Amiga, "errors.err" on other systems). Further errors can be jumped to with the ":cn"
command. See ":help quickfix". Manual page vim(1) line 1 (press h for help or q to quit)

OPTIONS
The options may be given in any order, before or after filenames. Options without an
argument can be combined after a single dash.
+[num] For the first file the cursor will be positioned on line "num". If "num" is missing, the
cursor will be positioned on the last line.

+/{pat} For the first file the cursor will be positioned in the line with the first occurrence of
{pat}. See ":help search-pattern" for the available search patterns.

+{command}

-c {command}

{command} will be executed after the first file has been read. {command} is interpreted as an
Ex command. If the {command} contains spaces it must be enclosed in double quotes(this
depends on the shell that is used). Example: Vim "+set si" main.c

Note: You can use up to 10 "+" or "-c" commands.

-S {file} {file} will be sourced after the first file has been read. This is equivalent to -c
"source {file}". {file} cannot start with '-'. If {file} is omitted "Session.vim" is used

(only works when -S is the last argument).

CP(1)
NAME
cp - copy files and directories
SYNOPSIS
cp [OPTION]... [-T] SOURCE DEST

cp [OPTION]... SOURCE... DIRECTORY

cp [OPTION]... -t DIRECTORY SOURCE...

DESCRIPTION
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.

-a, --archive

same as -dR --preserve=all

--attributes-only

don't copy the file data, just the attributes

--backup[=CONTROL]

make a backup of each existing destination file

-b like --backup but does not accept an argument

--copy-contents

copy contents of special files when recursive

-d same as --no-dereference --preserve=links

-f, --force

if an existing destination file cannot be opened, remove it and try again (this option is
ignored when the -n option is also used)

-i, --interactive

prompt before overwrite (overrides a previous -n option)

-H follow command-line symbolic links in SOURCE

-l, --link

hard link files instead of copying


-L, --dereference

always follow symbolic links in SOURCE

-n, --no-clobber

do not overwrite an existing file (overrides a previous -i option)

-P, --no-dereference

never follow symbolic links in SOURCE

-p same as --preserve=mode,ownership,timestamps

--preserve[=ATTR_LIST]

preserve the specified attributes (default: mode,ownership,timestamps), if possible


additional attributes: context, links, xattr, all

--no-preserve=ATTR_LIST

don't preserve the specified attributes

--parents

use full source file name under DIRECTORY

-R, -r, --recursive

copy directories recursively

--reflink[=WHEN]

control clone/CoW copies. See below

--remove-destination

remove each existing destination file before attempting to open it (contrast with --force)

--sparse=WHEN

control creation of sparse files. See below

--strip-trailing-slashes

remove any trailing slashes from each SOURCE argument

-s, --symbolic-link
make symbolic links instead of copying

-S, --suffix=SUFFIX

override the usual backup suffix

-t, --target-directory=DIRECTORY

copy all SOURCE arguments into DIRECTORY

-T, --no-target-directory

treat DEST as a normal file

-u, --update

copy only when the SOURCE file is newer than the destination file or when the
destination file is missing

-v, --verbose

explain what is being done

-x, --one-file-system

stay on this file system

-Z set SELinux security context of destination file to default type--context[=CTX]

like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX

--help display this help and exit

--version

output version information and exit


MV(1)
NAME
mv - move (rename) files

SYNOPSIS
mv [OPTION]... [-T] SOURCE DEST

mv [OPTION]... SOURCE... DIRECTORY

mv [OPTION]... -t DIRECTORY SOURCE...

DESCRIPTION
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.

--backup[=CONTROL]

make a backup of each existing destination file

-b like --backup but does not accept an argument

-f, --force
do not prompt before overwriting

-i, --interactive

prompt before overwrite

-n, --no-clobber

do not overwrite an existing file

If you specify more than one of -i, -f, -n, only the final one takes effect.

--strip-trailing-slashes

remove any trailing slashes from each SOURCE argument

-S, --suffix=SUFFIX

override the usual backup suffix

-t, --target-directory=DIRECTORY

move all SOURCE arguments into DIRECTORY

-T, --no-target-directory

treat DEST as a normal file

-u, --update

move only when the SOURCE file is newer than the destination file or when the
destination file is missing

-v, --verbose

explain what is being done

-Z, --context

set SELinux security context of destination file to default type

--help display this help and exit

--version

output version information and exit


RM(1)
NAME
rm - remove files or directories

SYNOPSIS
rm [OPTION]... [FILE]...

DESCRIPTION
This manual page documents the GNU version of rm. rm removes each specified file. By
default, it does not remove directories.

If the -I or --interactive=once option is given, and there are more than three files or the -r, -
R, or --recursive are given, then rm prompts the user for whether to proceed with the entire
operation. If the response is not affirmative, the entire command is aborted.

Otherwise, if a file is unwritable, standard input is a terminal, and the -f or --force option is not
given, or the -i or --interactive=always option is given, rm prompts the user for whether to
remove the file. If the response is not affirmative, the file is skipped.

OPTIONS
Remove (unlink) the FILE(s).

-f, --force

ignore nonexistent files and arguments, never prompt

-i prompt before every removal -I prompt once before removing more than three
files, or when removing recursively; less intrusive than -i, while still giving protection against
most mistakes

--interactive[=WHEN]

prompt according to WHEN: never, once (-I), or always (-i); without WHEN, prompt
always

--one-file-system

when removing a hierarchy recursively, skip any directory that is on a file system
different from that of the corresponding command line argument

--no-preserve-root

do not treat '/' specially

--preserve-root[=all]

do not remove '/' (default); with 'all', reject any command line argument on a separate
device from its parent
FIND(1)
NAME
find - search for files in a directory hierarchy

SYNOPSIS
find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]

DESCRIPTION
This manual page documents the GNU version of find. GNU find searches the directory tree
rooted at each given starting-point by evaluating the given expression from left to right,
according

to the rules of precedence (see section OPERATORS), until the outcome is known (the left
hand side is false for and operations, true for or), at which point find moves on to the next file
name. If no starting-point is specified, `.' is assumed.

If you are using find in an environment where security is important (for example if you are
using it to search directories that are writable by other users), you should read the `Security

Considerations' chapter of the findutils documentation, which is called Finding Files and
comes with findutils. That document also includes a lot more detail and discussion than this
manual

page, so you may find it a more useful source of information.

OPTIONS
The -H, -L and -P options control the treatment of symbolic links. Command-line arguments
following these are taken to be names of files or directories to be examined, up to the first
argument that begins with `-', or the argument `(' or `!'. That argument and any following
arguments are taken to be the expression describing what is to be searched for. If no paths
are given, the current directory is used. If no expression is given, the expression -print is used
(but you should probably consider using -print0 instead, anyway).

This manual page talks about `options' within the expression list. These options control the
behaviour of find but are specified immediately after the last path name. The five `real' options -
H, -L, -P, -D and -O must appear before the first path name, if at all. A double dash -- can also
be used to signal that any remaining arguments are not options (though ensuring that all start
points begin with either `./' or `/' is generally safer if you use wildcards in the list of start points).
-P Never follow symbolic links. This is the default behaviour. When find examines or
prints information a file, and the file is a symbolic link, the information used shall be taken from
the properties of the symbolic link itself.

-L Follow symbolic links. When find examines or prints information about files, the
information used shall be taken from the properties of the file to which the link points, not
from the link itself (unless it is a broken symbolic link or find is unable to examine the file to
which the link points). Use of this option implies -noleaf. If you later use the -P option, -noleaf
will still be in effect. If -L is in effect and find discovers a symbolic link to a subdirectory during
its search, the subdirectory pointed to by the symbolic link will be searched.

When the -L option is in effect, the -type predicate will always match against the type
of the file that a symbolic link points to rather than the link itself (unless the symbolic link is
broken). Actions that can cause symbolic links to become broken while find is executing (for
example -delete) can give rise to confusing behaviour. Using -L causes the -lname and -
ilname predicates always to return false.

-H Do not follow symbolic links, except while processing the command line arguments.
When find examines or prints information about files, the information used shall be taken from
the properties of the symbolic link itself. The only exception to this behaviour is when a
file specified on the command line is a symbolic link, and the link can be resolved. For that
situation, the information used is taken from whatever the link points to (that is, the link is
followed). The information about the link itself is used as a fallback if the file pointed to by the
symbolic link cannot be examined. If -H is in effect and one of the paths specified on the
command line is a symbolic link to a directory, the contents of that directory will be examined
(though of course -maxdepth 0 would prevent this).
HISTORY(3)

NAME
history - GNU History Library

DESCRIPTION
Many programs read input from the user a line at a time. The GNU History library is able
to keep track of those lines, associate arbitrary data with each line, and utilize information from
previous lines in composing new ones.

CAT(1)
NAME
cat - concatenate files and print on the standard output

SYNOPSIS
cat [OPTION]... [FILE]...

DESCRIPTION
Concatenate FILE(s) to standard output.
With no FILE, or when FILE is -, read standard input.

-A, --show-all

equivalent to -vET

-b, --number-nonblank

number nonempty output lines, overrides -n

-e equivalent to -vE

-E, --show-ends

display $ at end of each line

-n, --number

number all output line

-s, --squeeze-blank

suppress repeated empty output lines

-t equivalent to -vT

-T, --show-tabs

display TAB characters as ^I

-u (ignored)

-v, --show-nonprinting

use ^ and M- notation, except for LFD and TAB

--help display this help and exit

--version

output version information and exit

EXAMPLES
cat f – g

Output f's contents, then standard input, then g's contents.

cat Copy standard input to standard output.


ECHO(1)
NAME
echo - display a line of text

SYNOPSIS
echo [SHORT-OPTION]... [STRING]...

echo LONG-OPTION

DESCRIPTION
Echo the STRING(s) to standard output.

-n do not output the trailing newline

-e enable interpretation of backslash escapes

-E disable interpretation of backslash escapes (default)

--help display this help and exit

--version
output version information and exit

If -e is in effect, the following sequences are recognized:

\\ backslash

\a alert (BEL)

\b backspace

\c produce no further output

\e escape

\f form feed

\n new line

\r carriage return

\t horizontal tab

\v vertical tab

\0NNN byte with octal value NNN (1 to 3 digits)

\xHH byte with hexadecimal value HH (1 to 2 digits)


GREP(1)
NAME
grep, egrep, fgrep, rgrep - print lines that match patterns

SYNOPSIS
grep [OPTION...] PATTERNS [FILE...]

grep [OPTION...] -e PATTERNS ... [FILE...]

grep [OPTION...] -f PATTERN_FILE ... [FILE...]

DESCRIPTION
grep searches for PATTERNS in each FILE. PATTERNS is one or more patterns
separated by newline characters, and grep prints each line that matches a pattern. Typically
PATTERNS should be quoted when grep is used in a shell command.

A FILE of “-” stands for standard input. If no FILE is given, recursive searches examine the
working directory, and nonrecursive searches read standard input.

In addition, the variant programs egrep, fgrep and rgrep are the same as grep -E, grep -F, and
grep -r, respectively. These variants are deprecated, but are provided for backward
compatibility.

OPTIONS
Generic Program Information

--help Output a usage message and exit.

-V, --version

Output the version number of grep and exit.

Pattern Syntax

-E, --extended-regexp

Interpret PATTERNS as extended regular expressions (EREs, see below).

-F, --fixed-strings

Interpret PATTERNS as fixed strings, not regular expressions.


-G, --basic-regexp

Interpret PATTERNS as basic regular expressions (BREs, see below). This is the
default.

-P, --perl-regexp

Interpret PATTERNS as Perl-compatible regular expressions (PCREs). This option is


experimental when combined with the -z (--null-data) option, and grep -P may warn of
unimplemented features.

Matching Control

-e PATTERNS, --regexp=PATTERNS

Use PATTERNS as the patterns. If this option is used multiple times or is combined
with the -f (--file) option, search for all patterns given. This option can be used to protect a
pattern beginning with “-”.

-f FILE, --file=FILE

Obtain patterns from FILE, one per line. If this option is used multiple times or is
combined with the -e (--regexp) option, search for all patterns given. The empty file contains
zero patterns, and therefore matches nothing.

-i, --ignore-case

Ignore case distinctions in patterns and input data, so that characters that differ only in
case match each other.

--no-ignore-case

Do not ignore case distinctions in patterns and input data. This is the default. This
option is useful for passing to shell scripts that already use -i, to cancel its effects because
the two options override each other.

-v, --invert-match

Invert the sense of matching, to select non-matching lines.

-w, --word-regexp

Select only those lines containing matches that form whole words. The test is that
the matching substring must either be at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end of the line or followed by a non-
word constituent character. Word-constituent characters are letters, digits, and the underscore.
This option has no effect if -x is also specified.

-x, --line-regexp

Select only those matches that exactly match the whole line. For a regular expression
pattern, this is like parenthesizing the pattern and then surrounding it with ^ and $.

-y Obsolete synonym for -i.

General Output Control

-c, --count

Suppress normal output; instead print a count of matching lines for each input file. With
the -v, --invert-match option (see below), count non-matching lines.

--color[=WHEN], --colour[=WHEN]

Surround the matched (non-empty) strings, matching lines, context lines, file names,
line numbers, byte offsets, and separators (for fields and groups of context lines) with escape
sequences to display them in color on the terminal. The colors are defined by the environment
variable GREP_COLORS. The deprecated environment variable GREP_COLOR is still
supported, but its setting does not have priority. WHEN is never, always, or auto.

-L, --files-without-match

Suppress normal output; instead print the name of each input file from which no output
would normally have been printed. The scanning will stop on the first match.

-l, --files-with-matches

Manual page grep(1) line 36/405 16% (press h for help or q to quit)

-m NUM, --max-count=NUM

Stop reading a file after NUM matching lines. If the input is standard input from
a regular file, and NUM matching lines are output, grep ensures that the standard input is
positioned to just after the last matching line before exiting, regardless of the presence of trailing
context lines. This enables a calling process to resume a search. When grep stops after NUM
matching lines, it outputs any trailing context lines. When the -c or --count option is also used,
grep does not output a count greater than NUM. When the -v or--invert-match option is also
used, grep stops after outputting NUM non-matching lines.

-o, --only-matching

Print only the matched (non-empty) parts of a matching line, with each such part on a
separate output line.

-q, --quiet, --silent

Quiet; do not write anything to standard output. Exit immediately with zero status if
any match is found, even if an error was detected. Also see the -s or --no-messages option.

-s, --no-messages

Suppress error messages about nonexistent or unreadable files.

Output Line Prefix Control

-b, --byte-offset

Print the 0-based byte offset within the input file before each line of output. If -o (--
only-matching) is specified, print the offset of the matching part itself.

-H, --with-filename

Print the file name for each match. This is the default when there is more than one file
to search.

-h, --no-filename

Suppress the prefixing of file names on output. This is the default when there is only
one file (or only standard input) to search.

--label=LABEL

Display input actually coming from standard input as input coming from file LABEL.
This can be useful for commands that transform a file's contents before searching, e.g., gzip -cd
foo.gz | grep --label=foo -H 'some pattern'. See also the -H option.

-n, --line-number

Prefix each line of output with the 1-based line number within its input file.Context Line
Control

-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines. Places a line containing a
group separator (--) between contiguous groups of matches. With the -o or --only-matching
option, this has no effect and a warning is given.

-B NUM, --before-context=NUM

Print NUM lines of leading context before matching lines. Places a line containing
a group separator (--) between contiguous groups of matches. With the -o or --only-matching
option, this has no effect and a warning is given.

-C NUM, -NUM, --context=NUM

Print NUM lines of output context. Places a line containing a group separator (--)
between contiguous groups of matches. With the -o or --only-matching option, this has no
effect and a warning is given.

EXAMPLE
The following example outputs the location and contents of any line containing “f” and
ending in “.c”, within all files in the current directory whose names contain “g” and end in “.h”.
The

-n option outputs line numbers, the -- argument treats expansions of “*g*.h” starting with
“-” as file names not options, and the empty file /dev/null causes file names to be output even if
only one file name happens to be of the form “*g*.h”.

$ grep -n -- 'f.*\.c$' *g*.h /dev/null

argmatch.h:1:/* definitions and prototypes for argmatch.c

The only line that matches is line 1 of argmatch.h. Note that the regular expression syntax
used in the pattern differs from the globbing syntax that the shell uses to match file names.
WC(1)
NAME
wc - print newline, word, and byte counts for each file

SYNOPSIS
wc [OPTION]... [FILE]...

wc [OPTION]... --files0-from=F

DESCRIPTION
Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is
specified. A word is a non-zero-length sequence of characters delimited by white space.With no
FILE, or when FILE is -, read standard input.

The options below may be used to select which counts are printed, always in the following
order: newline, word, character, byte, maximum line length.

-c, --bytes

print the byte counts

-m, --chars

print the character counts


-l, --lines

print the newline counts

--files0-from=F

read input from the files specified by NUL-terminated names in file F; If F is - then read
names from standard input

-L, --max-line-length

print the maximum display width

-w, --words

print the word counts

--help display this help and exit

--version

output version information and exit


SORT(1)
NAME
sort - sort lines of text files

SYNOPSIS
sort [OPTION]... [FILE]...

sort [OPTION]... --files0-from=F

DESCRIPTION
Write sorted concatenation of all FILE(s) to standard output.

With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too. Ordering
options:

-b, --ignore-leading-blanks

ignore leading blanks

-d, --dictionary-order

consider only blanks and alphanumeric characters

-f, --ignore-case

fold lower case to upper case characters

-g, --general-numeric-sort

compare according to general numerical value

-i, --ignore-nonprinting

consider only printable characters

-M, --month-sort

compare (unknown) < 'JAN' < ... < 'DEC'

-h, --human-numeric-sort

compare human readable numbers (e.g., 2K 1G)


-n, --numeric-sort

compare according to string numerical value

-R, --random-sort

shuffle, but group identical keys. See shuf(1)

--random-source=FILE

get random bytes from FILE

-r, --reverse

reverse the result of comparisons

--sort=WORD

sort according to WORD: general-numeric -g, human-numeric -h, month -M, numeric -
n, random -R, version -V

-V, --version-sort

natural sort of (version) numbers within text

Other options:

--batch-size=NMERGE

merge at most NMERGE inputs at once; for more use temp files

-c, --check, --check=diagnose-first

check for sorted input; do not sort

-C, --check=quiet, --check=silent

like -c, but do not report first bad line

--compress-program=PROG

compress temporaries with PROG; decompress them with PROG -d --debug

annotate the part of the line used to sort, and warn about questionable usage to stderr

--files0-from=F

read input from the files specified by NUL-terminated names in file F; If F is - then read
names from standard input
-k, --key=KEYDEF

sort via a key; KEYDEF gives location and type

-m, --merge

merge already sorted files; do not sort

-o, --output=FILE

write result to FILE instead of standard output

-s, --stable

stabilize sort by disabling last-resort comparison

-S, --buffer-size=SIZE

use SIZE for main memory buffer

-t, --field-separator=SEP

use SEP instead of non-blank to blank transition

-T, --temporary-directory=DIR

use DIR for temporaries, not $TMPDIR or /tmp; multiple options specify multiple
directories

--parallel=N

change the number of sorts run concurrently to N

-u, --unique

with -c, check for strict ordering; without -c, output only the first of an equal run

-z, --zero-terminated

line delimiter is NUL, not newline

--help display this help and exit

--version output version information and exit


CHMOD(1)
NAME
chmod - change file mode bits

SYNOPSIS
chmod [OPTION]... MODE[,MODE]... FILE...

chmod [OPTION]... OCTAL-MODE FILE...

chmod [OPTION]... --reference=RFILE FILE...

DESCRIPTION
This manual page documents the GNU version of chmod. chmod changes the file mode bits
of each given file according to mode, which can be either a symbolic representation of changes
to make,or an octal number representing the bit pattern for the new mode bits.

The format of a symbolic mode is [ugoa...][[-+=][perms...]...], where perms is either zero or


more letters from the set rwxXst, or a single letter from the set ugo. Multiple symbolic modes
can be given, separated by commas.

A combination of the letters ugoa controls which users' access to the file will be changed:
the user who owns it (u), other users in the file's group (g), other users not in the file's group(o),
or all users (a). If none of these are given, the effect is as if (a) were given, but bits that are set in
the umask are not affected.
The operator + causes the selected file mode bits to be added to the existing file mode bits of
each file; - causes them to be removed; and = causes them to be added and causes unmentioned
bits to be removed except that a directory's unmentioned set user and group ID bits are not
affected.

The letters rwxXst select file mode bits for the affected users: read (r), write (w), execute
(or search for directories) (x), execute/search only if the file is a directory or already has execute
permission for some user (X), set user or group ID on execution (s), restricted deletion flag or
sticky bit (t). Instead of one or more of these letters, you can specify exactly one of the letters
ugo: the permissions granted to the user who owns the file (u), the permissions granted to other
users who are members of the file's group (g), and the permissions granted to users that are in
neither of the two preceding categories (o).

A numeric mode is from one to four octal digits (0-7), derived by adding up the bits with
values 4, 2, and 1. Omitted digits are assumed to be leading zeros. The first digit selects the
set user ID (4) and set group ID (2) and restricted deletion or sticky (1) attributes. The second
digit selects permissions for the user who owns the file: read (4), write (2), and execute(1); the
third selects permissions for other users in the file's group, with the same values; and the fourth
for other users not in the file's group, with the same values. chmod never changes the
permissions of symbolic links; 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.

OPTIONS
Change the mode of each FILE to MODE. With --reference, change the mode of each FILE
to that of RFILE.

-c, --changes

like verbose but report only when a change is made

-f, --silent, --quiet

suppress most error messages

-v, --verbose

output a diagnostic for every file processed

--no-preserve-root
do not treat '/' specially (the default)

--preserve-root

fail to operate recursively on '/

CHOWN(1)
NAME
chown - change file owner and group

SYNOPSIS
chown [OPTION]... [OWNER][:[GROUP]] FILE...

chown [OPTION]... --reference=RFILE FILE...

DESCRIPTION
This manual page documents the GNU version of chown. chown changes the user and/or
group ownership of each given file. 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. If the owner is
followed by a colon and a group name (or numeric group ID), with no spaces between them, the
group ownership of the files is changed as well. If a colon but no group name follows the user
name, that user is made the owner of the files and the group of the files is changed to that user's
login group. If the colon and 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. If only a colon is
given, or if the entire operand is empty, neither the owner nor the group is changed.

OPTIONS
Change the owner and/or group of each FILE to OWNER and/or GROUP. With --reference,
change the owner and group of each FILE to those of RFILE.

-c, --changes

like verbose but report only when a change is made

-f, --silent, --quiet

suppress most error messages

-v, --verbose

output a diagnostic for every file processed

--dereference

affect the referent of each symbolic link (this is the default), rather than the symbolic
link itself

-h, --no-dereference

affect symbolic links instead of any referenced file (useful only on systems that can
change the ownership of a symlink)

EXAMPLES
chown root /u

Change the owner of /u to "root".

chown root:staff /u

Likewise, but also change its group to "staff".

chown -hR root /u

Change the owner of /u and subfiles to "root".


WHO(1)
NAME
who - show who is logged on

SYNOPSIS
who [OPTION]... [ FILE | ARG1 ARG2 ]

DESCRIPTION
Print information about users who are currently logged in.

-a, --all

same as -b -d --login -p -r -t -T -u

-b, --boot

time of last system boot

-d, --dead

print dead processes

-H, --heading
print line of column headings

--ips print ips instead of hostnames. with --lookup, canonicalizes based on stored IP, if
available, rather than stored hostname

-l, --login

print system login processes

--lookup

attempt to canonicalize hostnames via DNS

-m only hostname and user associated with stdin

-p, --process

print active processes spawned by init

-q, --count

all login names and number of users logged on

-r, --runlevel

print current runlevel

-s, --short

print only name, line, and time (default)

-t, --time

print last system clock change

-T, -w, --mesg

add user's message status as +, - or ?

-u, --users

list users logged in

--message

same as -T

--writable
same as –

--help display this help and exit

--version

output version information and exit

You might also like