Unix- Some Commands with its man page:

cal
cal—Displays a calendar

SYNOPSIS
cal [–jy] [month [year]]

DESCRIPTION
cal displays a simple calendar. If arguments are not specified, the current month is displayed. The options are as follows:
–j Display Julian dates (days one-based, numbered from January 1)
–y Display a calendar for the current year
A single parameter specifies the year (1–9999) to be displayed; note the year must be fully specified:
cal 89
will not display a calendar for 1989. Two parameters denote the month (1–12) and year. If no parameters are specified, the
current month’s calendar is displayed.
A year starts on Jan 1.
The Gregorian Reformation is assumed to have occurred in 1752 on the 3rd of September. By this time, most countries had
recognized the reformation (although a few did not recognize it until the early 1900s.) Ten days following that date were
eliminated by the reformation, so the calendar for that month is a bit unusual.

cat
cat—Concatenate files and print on the standard output
SYNOPSIS
cat [–benstuvAET] [—number] [—number-nonblank] [—squeeze-blank]
[—show-nonprinting] [—show-ends] [—show-tabs] [—show-all]
[—help] [—version] [file...]
DESCRIPTION
This manual page documents the GNU version of cat. cat writes the contents of each given file, or the standard input if
none are given or when a file named – is given, to the standard output.
OPTIONS
–b, —number-nonblank Number all nonblank output lines, starting with 1.
–e Equivalent to –vE.
–n, —number Number all output lines, starting with 1.
–s, —squeeze-blank Replace multiple adjacent blank lines with a single blank line.
–t Equivalent to –vT.
–u Ignored; for UNIX compatibility.

–v, —show-nonprinting Display control characters except for LFD and TAB using ˆ notation and precede characters that
have the high bit set with M-.
–A, —show-all Equivalent to –vET.
–E, —show-ends Display a $ after the end of each line.
–T, —show-tabs Display tab characters as ˆI.
—help Print a usage message and exit with a nonzero status.
—version Print version information on standard output then exit.
date
date—Show and set date and time
SYNOPSIS
date [ –u ][–c ][–n ][–d dsttype ] [ –t minutes-west ] [ –a [+|-]sss.fff ][+format ][
[yyyy]mmddhhmm[yy][.ss]]
DESCRIPTION
Date without arguments writes the date and time to the standard output in the form:
Wed Mar 8 14:54:40 EST 1989 with EST replaced by the local time zone’s abbreviation (or by the abbreviation for the time zone specified in the TZ environment variable if set). The exact output format depends on the locale.
If a command-line argument starts with a plus sign (+), the rest of the argument is used as a format that controls what appears in the output. In the format, when a percent sign (%) appears, it and the character after it are not output, but rather identify part of the date or time to be output in a particular way (or identify a special character to output):

%a Wed Abbreviated weekday name*
%A Wednesday Full weekday name*
%b Mar Abbreviated month name*
%B March Full month name*
%c Wed Mar 08 14:54:40 1989 Date and time*
%C 19 Century
%d 08 Day of month (always two digits)
%D 03/08/89 Month/day/year (eight characters)
%e 8 Day of month (leading zero blanked)
%h Mar Abbreviated month name*
%H 14 24-hour-clock hour (two digits)
%I 02 12-hour-clock hour (two digits)
%j 067 Julian day number (three digits)
%k 2 12-hour-clock hour (leading zero blanked)
%l 14 2 4-hour-clock hour (leading zero blanked)
%m 03 Month number (two digits)
%M 54 Minute (two digits)
%n nn Newline character
%p PM AM/PM designation
%r 02:54:40 PM Hour:minute:second AM/PM designation
%R 14:54 Hour:minute
%S 40 Second (two digits)
%t nt Tab character
%T 14:54:40 Hour:minute:second
%U 10 Sunday-based week number (two digits)
%w 3 Day number (one digit, Sunday is 0)
%W 10 Monday-based week number (two digits)
%x 03/08/89 Date*
%X 14:54:40 Time*
%y 89 Last two digits of year
%Y 1989 Year in full
%Z EST Time zone abbreviation
%+ Wed Mar 8 14:54:40 EST 1989 Default output format*

* The exact output depends on the locale.

If a character other than one of those shown in the preceding table appears after a percent sign in the format, that following character is output. All other characters in the format are copied unchanged to the output; a newline character is always added at the end of the output.
In Sunday-based week numbering, the first Sunday of the year begins week 1; days preceding it are part of week 0. In Monday-based week numbering, the first Monday of the year begins week 1.

To set the date, use a command-line argument with one of the following forms:

1454 24- hour-clock hours (first two digits) and minutes
081454 Month day (first two digits), hours, and minutes
03081454 Month (two digits, January is 01), month day, hours, minutes
8903081454 Year, month, month day, hours, minutes
0308145489 Month, month day, hours, minutes, year (on System V-compatible systems)
030814541989 Month, month day, hours, minutes, four-digit year
198903081454 Four-digit year, month, month day, hours, minutes

If the century, year, month, or month day is not given, the current value is used. Any of the preceding forms may be followed by a period and two digits that give the seconds part of the new time; if no seconds are given, zero is assumed.
These options are available:

–u or –c Use GMT when setting and showing the date and time.
–n Do not notify other networked systems of the time change.
–d dsttype Set the kernel-stored Daylight Saving Time type to the given value. (The kernel-stored DST type is used mostly by “old” binaries.)
–t minutes-west Set the kernel-stored “minutes west of GMT” value to the one given on the command line. (The kernel-stored DST type is used mostly by “old” binaries.)
–a adjustment Change the time forward (or backward) by the number of seconds (and fractions thereof) specified in the adjustment argument. Either the seconds part or the fractions part of the argument (but not both) may be omitted. On BSD-based systems, the adjustment is made by changing the rate at which time advances; on System-V–based systems, the adjustment is made by changing the time


echo:
Print message on the terminal
usage: echo “
$ echo "Welcome to the Linux"
Welcome to the Linux
printf:
Print the formatted message on the terminal
Syntax of printf is same as C language printf statement. usage: printf “).
Special macros, which are usually in uppercase, are in bold (such as MAXINT). When enumerating a list of error codes, the codes are in bold (this list usually uses the .TP macro). Any reference to another man page (or to the subject of the current man page) is in bold. If the manual section number is given, it is given in roman, without any spaces (such as man(7)). The commands to select the typeface are given below:
.B Bold
.BI Bold alternating with italics
.BR Bold alternating with Roman
.I Italics
.IB Italics alternating with bold
.IR Italics alternating with Roman
.RB Roman alternating with bold
.RI Roman alternating with italics
.SB Small alternating with bold
.SM Small
Traditionally, each command can have up to six arguments, but the GNU version seems to remove this limitation. Arguments are delimited by spaces. Double quotes can be used to specify an argument that contains spaces. All the arguments will be printed next to each other without intervening spaces, so that the .BR command can be used to specify a word in bold followed by a mark of punctuation in Roman.

SECTIONS
Sections are started with .SH followed by the heading name. If the name contains spaces and appears on the same line as .SH, then place the heading in double quotes. Traditional headings include NAME, SYNOPSIS, DESCRIPTION, OPTIONS, FILES, SEE ALSO, DIAGNOSTICS, BUGS, and AUTHOR. The only required heading is NAME, which should be followed on the next line by a one line description of the program:
.SH NAME
chess \- the game of chess
It is extremely important that this format is followed and that there is a backslash before the single dash that follows the command name. This syntax is used by the makewhatis(8) program to create a database of short command descriptions for the whatis(1) and apropos(1) commands.

OTHER MACROS
Other macros include the following:
.DT Default tabs.
.HP Begin hanging indent.
.IP Begin paragraph with hanging tag. This is the same as .TP, except the tag is given on the same line, not on the following line.
.LP Same as .PP.
.PD Set interparagraph distance to argument.
.PP Begin a new paragraph.
.RE End relative indent (indented paragraph).
.RS Start relative indent (indented paragraph).
.SS Subheading (like .SH but used for a subsection).
.TP Begin paragraph with hanging tag. The tag is given on the next line. This command is similar to .IP.

FILES
/usr/local/lib/groff/tmac/tmac.an
/usr/man/whatis


ls, dir, vdir
ls, dir, vdir—List contents of directories
SYNOPSIS
ls [–abcdfgiklmnpqrstuxABCFGLNQRSUX1] [–w cols] [–T cols] [–I pattern] [--all]
[--escape] [--directory] [--inode] [--kilobytes] [--numeric-uid-gid] [–no-group]
[--hide-control-chars] [--reverse] [--size] [--width=cols] [--tabsize=cols]
[--almost-all] [--ignore-backups] [--classify] [--file-type] [--full-time]
[--ignore=pattern] [--dereference] [--literal] [--quote-name] [--recursive]
[-- -sort={none, time, size, extension}] [--format={long, verbose, commas,
across, vertical, single-column}] [--time={atime, access, use, ctime, status}]
[--help] [--version] [name...]
DESCRIPTION
This manual page documents the GNU version of ls. dir and vdir are versions of ls with different default output formats. These programs list each given file or directory name. Directory contents are sorted alphabetically. For ls, files are by default listed in columns, sorted vertically, if the standard output is a terminal; otherwise, they are listed one per line. For dir, files are by default listed in columns, sorted vertically. For vdir, files are by default listed in long format.

OPTIONS
–a, --all List all files in directories, including all files that start with a period (.).
–b, --escape Quote nongraphic characters in filenames using alphabetic and octal backslash sequences like those used in C.
–c, --time=ctime, Sort directory contents according to the files’ status change time instead of the modification
--time=status time. If the long listing format is being used, print the status change time instead of the
modification time.
–d, --directory List directories like other files, rather than listing their contents.
–f Do not sort directory contents; list them in whatever order they are stored on the disk. This is the same as enabling –a and –U and disabling –l, –s, and –t.
--full-time List times in full, rather than using the standard abbreviation heuristics.
–g Ignored; for UNIX compatibility.
–i, --inode Print the index number of each file to the left of the filename.
–k, --kilobytes If file sizes are being listed, print them in kilobytes. This overrides the environment variable POSIXLY_CORRECT.
–l, --format=long, In addition to the name of each file, print the file type, permissions, number of hard links,
--format=verbose owner name, group name, size in bytes, and timestamp (the modification time unless other times are selected). For files with a time that is more than six months old or more than one hour into the future, the timestamp contains the year instead of the time of day.
–m, --format=commas List files horizontally, with as many as will fit on each line, separated by commas.
–n, --numeric-uid-gid List the numeric UID and GID instead of the names.
–p Append a character to each filename indicating the file type.
–q, --hide-control-chars Print question marks instead of nongraphic characters in filenames.
–r, --reverse Sort directory contents in reverse order.
–s, --size Print the size of each file in 1KB blocks to the left of the filename. If the environment variable POSIXLY_CORRECT is set, 512-byte blocks are used instead.
–t, --sort=time Sort directory contents by timestamp instead of alphabetically, with the newest files listed
first.
–u, --time=atime, Sort directory contents according to the files’ last access time instead of the modification
--time=access,--time=use time. If the long listing format is being used, print the last access time instead of the modification time.
–x, --format=across, List the files in columns, sorted horizontally.
--format=horizontal
–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.
–C, --format=vertical List files in columns, sorted vertically.
–F, --classify Append a character to each filename indicating the file type. For regular files that are executable, append a *. The file type indicators are / for directories, @ for symbolic links, | for FIFOs, = for sockets, and nothing for regular files.
–G, --no–group Inhibit display of group information in a long format directory listing.
–L, --dereference List the files linked to by symbolic links instead of listing the contents of the links.
–N, --literal Do not quote filenames.
–Q, --quote-name Enclose filenames in double quotes and quote nongraphic characters as in C.
–R, --recursive List the contents of all directories recursively.
–S, --sort=size Sort directory contents by file size instead of alphabetically, with the largest files listed first.
–U, --sort=none Do not sort directory contents; list them in whatever order they are stored on the disk. This option is not called –f because the UNIX ls –f option also enables –a and disables –l, –s, and –t. It seems useless and ugly to group those unrelated things together in one option. Because this option doesn’t do that, it has a different name.
–X, --sort=extension Sort directory contents alphabetically by file extension (characters after the last period); files with no extension are sorted first.
–1, --format=single-column List one file per line.
–w, --width cols Assume the screen is cols columns wide. The default is taken from the terminal driver if
possible; otherwise, the environment variable COLUMNS is used if it is set; otherwise, the default is 80.
–T, --tabsize cols Assume that each tab stop is cols columns wide. The default is 8.
–I, --ignore pattern Do not list files whose names match the shell pattern pattern unless they are given on the command line. As in the shell, an initial period (.) in a filename does not match a wildcard at the start of pattern.
--help Print a usage message on standard output and exit successfully.
--version Print version information on standard output then exit successfully.


rm
rm—Remove files
SYNOPSIS
rm [-dfirvR] [--directory] [--force] [--interactive] [--recursive]
[--help] [--version] [--verbose] name...
DESCRIPTION
This manual page documents the GNU version of rm. rm removes each specified file. By default, it does not remove directories. If a file is unwritable, the standard input is a tty, and the -f or --force option is not 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. 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 nonoptions. 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.
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 for the superuser. 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.
--help Print a usage message on standard output and exit successfully.
--version Print version information on standard output, then exit successfully.

rmdir
rmdir—Remove empty directories
SYNOPSIS
rmdir [-p] [--parents] [--help] [--version] dir...
DESCRIPTION
This manual page documents the GNU version of rmdir. rmdir removes each given empty directory. If any nonoption argument does not refer to an existing empty directory, it is an error.
OPTIONS
-p, --parents Remove any parent directories that are explicitly mentioned in an argument, if they become empty after the argument file is removed.
--help Print a usage message on standard output and exit successfully.
--version Print version information on standard output, then exit successfully.

rmmod
rmmod—Unload loadable modules
SYNOPSIS
rmmod [ -r ] module ...
DESCRIPTION
rmmod unloads loadable modules from the kernel. rmmod tries to unload a set of modules from the kernel, with the restriction that they are not in use and that they are not referred to by other modules.
If more than one module is named on the command line, the modules will be removed in the given order. This supports unloading of stacked modules. With the option -r, a recursive removal of modules will be attempted. This means that if a top module in a stack is named on the command line, all modules that are used by this module will be removed as well, if possible.

cp
cp—Copy files
SYNOPSIS
cp [options] source dest
cp [options] source... directory
Options:
[–abdfilprsuvxPR] [–S backup-suffix] [–V fnumbered,existing,simpleg] [—backup]
[—no-dereference] [—force] [—interactive] [—one-file-system] [—preserve]
[—recursive][—update] [—verbose] [—suffix=backup-suffix]
[—version-control=fnumbered,existing,simpleg] [—archive] [—parents] [—link]
[—symbolic-link] [—help] [—version]
DESCRIPTION
This manual page documents the GNU version of cp. If the last argument names an existing directory, cp copies each other given file into a file with the same name in that directory. 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 files are given. By default, it does not copy directories.
OPTIONS
–a, —archive Preserve as much as possible of the structure and attributes of the original files in the copy.
The same as –dpR.
–b, —backup Make backups of files that are about to be overwritten or removed.
–d, —no-dereference Copy symbolic links as symbolic links rather than copying the files that they point to, and preserve hard link relationships 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 nondirectories.
–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.
–p, —preserve Preserve the original files’ owner, group, permissions, and timestamps.
-r Copy directories recursively, copying all nondirectories as if they were regular files.
–s, —symbolic-link Make symbolic links instead of copies of nondirectories. All source filenames must be absolute (starting with /) unless the destination files are in the current directory. This option produces an error message on systems that do not support symbolic links.
–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.
–x, —one-file-system Skip subdirectories that are on different filesystems from the one that the copy started on.
–R, —recursive Copy directories recursively.
—help Print a usage message on standard output and exit successfully.
—version Print version information on standard output then exit successfully.
–S, —suffix backup-suffix The suffix used for making simple backup files can be set with the SIMPLE_BACKUP_SUFFIX environment variable, which can be overridden by this option. If neither of those is given, the default is ~, as it is in emacs.
–V, —version-control The type of backups made can be set with the VERSION_CONTROL environment variable, which {numbered,existing,simple} can be overridden by this option. If VERSION_CONTROL is not set and this option is not given, the default backup type is existing. The value of the VERSION_CONTROL environment variable and the argument to this option are like the GNU emacs version- control variable; they also recognize synonyms that are more descriptive. The valid values are (unique abbreviations are accepted) the following:
t or numbered Always make numbered backups
nil or existing Make numbered backups of files that already have them,
simple backups of the others
never or simple Always make simple backups
mkdir
mkdir—Make directories
SYNOPSIS
mkdir [–p] [–m mode] [--parents] [--mode=mode] [--help] [--version] dir...
DESCRIPTION
This manual page documents the GNU version of mkdir. mkdir creates a directory with each given name. By default, the mode of created directories is 0777 minus the bits set in the umask.
OPTIONS
–m, --mode mode Set the mode of created directories to mode, which is symbolic as in chmod and uses the default mode as the point of departure.
–p, --parents Ensure that each given directory exists. Create any missing parent directories for each argument. Parent directories default to the umask modified by u+wx. Do not consider an argument directory that already exists to be an error.
--help Print a usage message on standard output and exit successfully.
--version Print version information on standard output then exit successfully.
ERRORS
EEXIST pathname already exists (not necessarily as a directory).
EFAULT pathname points outside your accessible address space.
EACCES The parent directory does not allow write permission to the process, or one of the directories in pathname did not allow search (execute) permission.
ENAMETOOLONG pathname was too long.
ENOENT A directory component in pathname does not exist or is a dangling symbolic link.
ENOTDIR A component used as a directory in pathname is not, in fact, a directory.
ENOMEM Insufficient kernel memory was available.
EROFS pathname refers to a file on a read-only filesystem and write access was requested.
ELOOP pathname contains a reference to a circular symbolic link, that is, a symbolic link whose expansion contains a reference to itself.
ENOSPC The device containing pathname has no room for the new directory.
ENOSPC The new directory cannot be created because the user’s disk quota is exhausted.
cat
cat—Concatenate files and print on the standard output
SYNOPSIS
cat [–benstuvAET] [—number] [—number-nonblank] [—squeeze-blank]
[—show-nonprinting] [—show-ends] [—show-tabs] [—show-all]
[—help] [—version] [file...]
DESCRIPTION
This manual page documents the GNU version of cat. cat writes the contents of each given file, or the standard input if none are given or when a file named – is given, to the standard output.
OPTIONS
–b, —number-nonblank Number all nonblank output lines, starting with 1.
–e Equivalent to –vE.
–n, —number Number all output lines, starting with 1.
–s, —squeeze-blank Replace multiple adjacent blank lines with a single blank line.
–t Equivalent to –vT.
–u Ignored; for UNIX compatibility.
–v, —show-nonprinting Display control characters except for LFD and TAB using ˆ notation and precede characters that have the high bit set with M-.
–A, —show-all Equivalent to –vET.
–E, —show-ends Display a $ after the end of each line.
–T, —show-tabs Display tab characters as ˆI.
—help Print a usage message and exit with a nonzero status.
—version Print version information on standard output then exit.

tac
tac—Concatenate and print files in reverse
SYNOPSIS
tac [-br] [-s separator] [--before] [--regex] [--separator=separator]
[--help] [--version] [file...]
DESCRIPTION
This manual page documents the GNU version of tac. tac copies each given file, or the standard input if none are given or when a filename of - is encountered, to the standard output with the order of the records reversed. The records are separated by instances of a string, or a newline if none is given. By default, the separator string is attached to the end of the record that it follows in the file.
OPTIONS
-b, --before The separator is attached to the beginning of the record that it precedes in the file.
-r, --regex The separator is a regular expression.
-s string, --separator=string Use string as the record separator.
--help Print a usage message and exit with a non-zero status.
--version Print version information on standard output, then exit.


more
more—File perusal filter for crt viewing
SYNOPSIS
more [-dlfpcsu] [-num] [+/ pattern] [+ linenum]
DESCRIPTION
more is a filter for paging through text one screen full at a time. This version is especially primitive. Users should realize that less(1) provides more(1) emulation and extensive enhancements.
OPTIONS
Command-line options are described in the following list. Options are also taken from the environment variable MORE (make sure to precede them with a hyphen (-)) but command-line options will override them.
-num This option specifies an integer that is the screen size (in lines).
-d more will prompt the user with the message [Press space to continue, ‘q’ to quit.] and will display [Press ‘h’ for instructions.] instead of ringing the bell when an illegal key is pressed.
-l more usually treats (form feed) as a special character, and will pause after any line that contains a form feed. The –l option will prevent this behavior.
-f Causes more to count logical, rather than screen lines (that is, long lines are not folded).
-p Do not scroll. Instead, clear the whole screen and then display the text.
-c Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed.
-s Squeeze multiple blank lines into one.
-u Suppress underlining.
+/ The +/ option specifies a string that will be searched for before each file is displayed.
+num Start at line number.
COMMANDS
Interactive commands for more are based on vi(1). Some commands may be preceded by a decimal number, called k in the following descriptions. In the following descriptions, ˆX means control-X.
h or ? Help: display a summary of these commands. If you forget all the other commands, remember this one.
SPACE Display next k lines of text. Defaults to current screen size.
z Display next k lines of text. Defaults to current screen size. Argument becomes new default.
RETURN Display next k lines of text. Defaults to 1. Argument becomes new default.
d or ˆD Scroll k lines. Default is current scroll size, initially 11. Argument becomes new default.
q or Q INTERRUPT Exit.
s Skip forward k lines of text. Defaults to 1.
f Skip forward k screenfuls of text. Defaults to 1.
b or ˆB Skip backwards k screenfuls of text. Defaults to 1.
‘ Go to place where previous search started.
= Display current line number.
/pattern Search for kth occurrence of regular expression. Defaults to 1.
n Search for kth occurrence of last r.e. Defaults to 1.
! or :! Execute in a subshell.
v Start up /usr/bin/vi at current line.
ˆL Redraw screen.
:n Go to kth next file. Defaults to 1.
:p Go to kth previous file. Defaults to 1.
Ic :f Display current filename and line number.
. Repeat previous command.

wc
wc—Print the number of bytes, words, and lines in files
SYNOPSIS
wc [-clw] [--bytes] [--chars] [--lines] [--words] [--help] [--version] [file...]
DESCRIPTION
This manual page documents the GNU version of wc. wc counts the number of bytes, whitespace-separated words, and
newlines in each given file, or the standard input if none are given or when a file named - is given. It prints one line of
counts for each file, and if the file was given as an argument, it prints the filename following the counts. If more than one
filename is given, wc prints a final line containing the cumulative counts, with the filename total. The counts are printed in
the order lines, words, bytes.
By default, wc prints all three counts. Options can specify that only certain counts be printed. Options do not undo others
previously given, so wc --bytes --words prints both the byte counts and the word counts.
OPTIONS
-c, --bytes, --chars Print only the byte counts.
-w, --words Print only the word counts.
-l, --lines Print only the newline counts.
--help Print a usage message and exit with a non-zero status.
--version Print version information on standard output, then exit.

Cmp
Cmp - command is used to compare two files whether they are identical or not
Synopsis: cmp

The two files are compared byte by byte and the location of the first mismatch is printed on the screen. If two files are identical, then it does not print anything on the screen
Example:
$cmp sample1.txt sample2.txt
sample1.txt sample2.txt differ: byte 1, line 1
$cmp sample1.txt sample1_copy.txt
$ /*No output prompt returns back*/

comm
comm—Compare two sorted files line by line
SYNOPSIS
comm [–123] [—help] [—version] file1 file2
DESCRIPTION
This manual page documents the GNU version of comm. comm prints lines that are common, and lines that are unique, to two input files. The two files must be sorted before comm can be used. The filename – means the standard input. With no options, comm produces three column output. Column one contains lines unique to file1, column two contains lines unique to file2, and column three contains lines common to both files.
OPTIONS
The options –1, –2, and –3 suppress printing of the corresponding columns.
—help Print a usage message and exit with a nonzero status.
—version Print version information on standard output then exit.

gzip, gunzip, zcatgzip, gunzip, zcat
gzip, gunzip, zcatgzip, gunzip, zcat—Compress or expand files
SYNOPSIS
gzip [ –acdfhlLnNrtvV19 ][–Ssuffix] [ name ... ]
gunzip [ –acfhlLnNrtvV ][–Ssuffix] [ name ... ]
zcat [ –fhLV ][name ... ]
DESCRIPTION
gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the same ownership modes, access, and modification times. (The default extension is –gz for VMS, z for MS-DOS, OS/2 FAT, Windows NT FAT and Atari.). If no files are specified, or if a filename is -, the standard input is compressed to the standard output. gzip will only attempt to compress regular files. In particular, it will ignore symbolic links. If the compressed filename is too long for its filesystem, gzip truncates it. gzip attempts to truncate only the parts of the filename longer than three characters. (A part is delimited by dots.) If the name consists of small parts only, the longest parts are truncated. For example, if filenames are limited to 14 characters, gzip.msdos.exe is compressed to gzi.msd.exe.gz. Names are not truncated on systems that do not have a limit on filename length. By default, gzip keeps the original filename and timestamp in the compressed file. These are used when decompressing the file with the –N option. This is useful when the compressed filename was truncated or when the time stamp was not preserved after a file transfer. Compressed files can be restored to their original form using gzip -d or gunzip or zcat. If the original name saved in the compressed file is not suitable for its filesystem, a new name is constructed from the original one to make it legal. Gunzip takes a list of files on its command line and replaces each file whose name ends with .gz, -gz, .z, -z, z, or .Z and which begins with the correct magic number with an uncompressed file without the original extension. gunzip also recognizes the special extensions .tgz and .taz as shorthands for .tar.gz and .tar.Z respectively. When compressing, gzip uses the .tgz extension if necessary instead of truncating a file with a .tar extension. gunzip can currently decompress files created by gzip, zip, compress, compress -H, or pack. The detection of the input format is automatic. When using the first two formats, gunzip checks a 32-bit CRC. For pack, gunzip checks the uncompressed length. The standard compress format was not designed to allow consistency checks. However, gunzip is sometimes able to detect a bad .Z file. If you get an error when uncompressing a .Z file, do not assume that the .Z file is correct simply because the standard uncompress does not complain. This generally means that the standard uncompress does not check its input, and happily generates garbage output. The SCO compress -H format (lzh compression method) does not include a CRC but also allows some consistency checks.
Files created by zip can be uncompressed by gzip only if they have a single member compressed with the deflation method.
This feature is only intended to help conversion of tar.zip files to the tar.gz format. To extract zip files with several members, use unzip instead of gunzip. zcat is identical to gunzip –c. (On some systems, zcat may be installed as gzcat to preserve the original link to compress.) zcat uncompresses either a list of files on the command line or its standard input and writes the uncompressed data on standard output. zcat will uncompress files that have the correct magic number whether they have a .gz suffix or not. gzip uses the Lempel-Ziv algorithm used in zip and PKZIP. The amount of compression obtained depends on the size of the input and the distribution of common substrings. Typically, text such as source code or English is reduced by 60 to 70 percent. Compression is generally much better than that achieved by LZW (as used in compress), Huffman coding (as used in pack), or adaptive Huffman coding (compact). Compression is always performed, even if the compressed file is slightly larger than the original. The worst case expansion is a few bytes for the gzip file header, plus 5 bytes every 32KB block, or an expansion ratio of 0.015 percent for large files.
Note that the actual number of used disk blocks almost never increases. gzip preserves the mode, ownership, and timestamps of files when compressing or decompressing.
OPTIONS
–a –ascii ASCII text mode: convert end-of-lines using local conventions. This option is supported only on some non-UNIX systems. For MS-DOS, CR LF is converted to LF when compressing, and LF is converted to CR LF when decompressing.
–c –stdout –to-stdout Write output on standard output; keep original files unchanged. If there are several input files, the output consists of a sequence of independently compressed members. To obtain better compression, concatenate all input files before compressing them.
–d –decompress –uncompress Decompress.
–f –force Force compression or decompression even if the file has multiple links or the corresponding file already exists, or if the compressed data is read from or written to a terminal. If the input data is not in a format recognized by gzip, and if the option –stdout is also given, copy the input data without change to the standard output; let zcat behave as cat. If –f is not given, and when not running in the background, gzip prompts to verify whether an existing file should be overwritten.
–h –help Display a help screen and quit.
–l –list For each compressed file, list the following fields: compressed size (size of the compressed file), uncompressed size (size of the uncompressed file), ratio (compression ratio—0.0% if unknown), uncompressed name (name of the uncompressed file). The uncompressed size is given as -1 for files not in gzip format, such as compressed .Z files. To get the uncompressed size for such a file, you can use:
zcat file.Z | wc –c
In combination with the –verbose option, the following fields are also displayed: method (compression method), crc (the 32-bit CRC of the uncompressed data), date & time (timestamp for the uncompressed file). The compression methods currently supported are deflate, compress, lzh (SCO compress -H) and pack. The crc is given as ffffffff for a file not in gzip format. With –name, the uncompressed name, date and time are those stored within the compressed file if present. With –verbose, the size totals and compression ratio for all files is also displayed, unless some sizes are unknown. With –quiet, the title and totals lines are not displayed.
–L –license Display the gzip license and quit.
–n –no-name When compressing, do not save the original filename and timestamp by default. (The
original name is always saved if the name had to be truncated.) When decompressing, do not restore the original filename if present (remove only the gzip suffix from the compressed filename) and do not restore the original timestamp if present (copy it from the compressed file). This option is the default when decompressing.
–N –name When compressing, always save the original filename and timestamp; this is the default. When decompressing, restore the original filename and timestamp if present. This option is useful on systems that have a limit on filename length or when the timestamp has been lost after a file transfer.
–q –quiet Suppress all warnings.
–r –recursive Travel the directory structure recursively. If any of the filenames specified on the command
line are directories, gzip will descend into the directory and compress all the files it finds there (or decompress them in the case of gunzip).
–S .suf –suffix .suf Use suffix .suf instead of .gz. Any suffix can be given, but suffixes other than .z and .gz should be avoided to avoid confusion when files are transferred to other systems. A null suffix forces gunzip to try decompression on all given files regardless of suffix, as in the following:
gunzip -S “” * (*.* for MS-DOS)
Previous versions of gzip used the .z suffix. This was changed to avoid a conflict with pack(1).
–t –test Test. Check the compressed file integrity.
–v –verbose Verbose. Display the name and percentage reduction for each file compressed or decompressed.
–V –version Version. Display the version number and compilation options, then quit.
–# –fast –best Regulate the speed of compression using the specified digit #, where –1 or --fast indicates
the fastest compression method (less compression) and –9 or --best indicates the slowest compression method (best compression). The default compression level is –6 (that is, biased towards high compression at expense of speed).

ADVANCED USAGE
Multiple compressed files can be concatenated. In this case, gunzip will extract all members at once. For example,
gzip -c file1 >foo.gz gzip -c file2>>> foo.gz
Then gunzip -c foo is equivalent to cat file1 file2 In case of damage to one member of a .gz file, other members can still be recovered (if the damaged member is removed). However, you can get better compression by compressing all members at once.
cat file1 file2 | gzip > foo.gz compresses better than
gzip -c file1 file2 >foo.gz If you want to recompress concatenated files to get better compression, use
gzip -cd old.gz | gzip > new.gz If a compressed file consists of several members, the uncompressed size and CRC reported by the –list option applies to the last member only. If you need the uncompressed size for all members, you can use gzip -cd file.gz | wc -c
If you wish to create a single archive file with multiple members so that members can later be extracted independently, use an archiver such as tar or zip. GNU tar supports the -z option to invoke gzip transparently. gzip is designed as a complement to tar, not as a replacement.
ENVIRONMENT
The environment variable GZIP can hold a set of default options for gzip. These options are interpreted first and can be overwritten by explicit command-line parameters. For example,
For sh: GZIP=”-8v –name” Export GZIP for csh: setenv GZIP “-8v –name”
For MS-DOS: set GZIP=-8v –name. On Vax/VMS, the name of the environment variable is GZIP_OPT, to avoid a conflict with the symbol set for invocation of the program.

Zip
Zip- command can be used for archiving as well as compressing the contents of the directory or the file
Usage: zip [options] output.zip
Example:
$ zip sample1.zip sample1.txt
//will create sample1.zip file

Use -r option to recursively zip the contents of the directory
Example:
$ zip -r compression.zip compression
// will create compression.zip file

To un-compress the file use unzip command
Example:
$ unzip compression.zip
// will uncompress the compression.zip file

head
head—Output the first part of files
SYNOPSIS
head [–c N[bkm]] [–n N] [–qv] [--bytes=N[bkm]] [--lines=N] [--quiet] [--silent]
[--verbose] [--help] [--version] [file...]
head [–Nbcklmqv] [file...]
DESCRIPTION
This manual page documents the GNU version of head. head prints the first part (10 lines by default) of each given file; it reads from standard input if no files are given or when a filename of – is encountered. If more than one file is given, it prints a header consisting of the file’s name enclosed in ==> and <== before the output for each file. OPTIONS head accepts two option formats: the new one, in which numbers are arguments to the option letters; and the old one, in which the number precedes any option letters. –c N, --bytes N Print first N bytes. N is a nonzero integer, optionally followed by one of the following characters to specify a different unit : b 512-byte blocks. k 1-kilobyte blocks. m 1-megabyte blocks. –l, –n N, --lines N Print first N lines. –q, --quiet, --silent Never print filename headers. –v, --verbose Always print filename headers. --help Print a usage message and exit with a nonzero status. --version Print version information on standard output, then exit. tail tail—Output the last part of files SYNOPSIS tail [-c [+]N[bkm]] [-n [+]N] [-fqv] [--bytes=[+]N[bkm]] [--lines=[+]N] [--follow] [--quiet] [--silent] [--verbose] [--help] [--version] [file...] tail [{-,+}Nbcfklmqv] [file...] DESCRIPTION This manual page documents the GNU version of tail. tail prints the last part (10 lines by default) of each given file; it reads from standard input if no files are given or when a filename of - is encountered. If more than one file is given, it prints a header consisting of the file’s name enclosed in ==> and <== before the output for each file. The GNU tail can output any amount of data, unlike the UNIX version, which uses a fixed size buffer. It has no -r option (print in reverse). Reversing a file is really a different job from printing the end of a file; the BSD tail can only reverse files that are at most as large as its buffer, which is typically 32KB. A reliable and more versatile way to reverse files is the GNU tac command.
OPTIONS
tail accepts two option formats: the new one, in which numbers are arguments to the option letters, and the old one, in which a + or - and optional number precede any option letters. If a number (N) starts with a +, tail begins printing with the Nth item from the start of each file, instead of from the end. 0
-c N, --bytes N Tail by N bytes. N is a non-zero integer, optionally followed by one of the following characters to specify a different unit.
b 512-byte blocks
k 1-kilobyte blocks
m 1-megabyte blocks
-f, --follow Loop forever, trying to read more characters at the end of the file, on the assumption that the file is growing. Ignored if reading from a pipe. If more than one file is given, tail prints a header whenever it gets output from a different file, to indicate which file that output is from.
-l, -n N, --lines N Tail by N lines. -l is only recognized using the old option format.
-q, --quiet, --silent Never print filename headers.
-v, --verbose Always print filename headers.
--help Print a usage message and exit with a non-zero status.
--version Print version information on standard output then exit.
Chmod
chmod—Change the access permissions of files
SYNOPSIS
chmod [–Rcfv] [—recursive] [—changes] [—silent] [—quiet] [—verbose] [—help] [—version] mode file...
DESCRIPTION
This manual page documents the GNU version of chmod. chmod changes the permissions 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 permissions. The format of a symbolic mode is [ugoa...][[+-=][rwxXstugo...]...][,...]. Multiple symbolic operations 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 permissions selected to be added to the existing permissions of each file; - causes them to be removed; and = causes them to be the only permissions that the file has. The letters rwxXstugo select the new permissions for the affected users: read (r), write (w), execute (or access for directories) (x), execute only if the file is a directory or already has execute permission for some user (X), set user or group ID on execution (s), save program text on swap device (t), the permissions that the user who owns the file currently has for it (u), the permissions that other users in the file’s group have for it (g), and the permissions that other users not in the file’s group have for it (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. Any omitted digits are assumed to be leading zeros. The first digit selects the set user ID (4) and set group ID (2) and save text image (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
–c, —changes Verbosely describe only files whose permissions actually change.
–f, —silent, —quiet Do not print error messages about files whose permissions cannot be changed.
–v, —verbose Verbosely describe changed permissions.
–R, —recursive Recursively change permissions of directories and their contents.
—help Print a usage message on standard output and exit successfully.
—version Print version information on standard output, then exit successfully.

chown
chown—Change the user and group ownership of files
SYNOPSIS
chown [–Rcfv] [—recursive] [—changes] [—help] [—version] [—silent] [—quiet]
[—verbose] [user][:.][group] file...

DESCRIPTION
This manual page documents the GNU version of chown. chown changes the user and/or group ownership of each given file, according to its first nonoption argument, which is interpreted as follows. If only a username (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 username is followed by a colon or dot 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 or dot but no group name follows the username, that user is made the owner of the files and the group of the
Files are changed to that user’s login group. If the colon or dot and group are given, but the username is
Omitted, only the group of the files is changed; in this case, chown performs the same function as chgrp.
OPTIONS
–c, —changes verbosely describe only files whose ownership actually changes.
–f, —silent, —quiet Do not print error messages about files whose ownership cannot be changed.
–v, —verbose Verbosely describe ownership changes.
–R, —recursive Recursively change ownership of directories and their contents.
—help Print a usage message on standard output and exit successfully.
—version Print version information on standard output then exit successfully.