Tuesday, January 10, 2017

Linux Command Line Tutorial For Beginners 36 - tar command to Compress a...



TAR(1)                    BSD General Commands Manual                   TAR(1)

NAME
     tar — The GNU version of the tar archiving utility

SYNOPSIS
     tar [-] A --catenate --concatenate | c --create | d --diff --compare |
         --delete | r --append | t --list | --test-label | u --update | x
         --extract --get [options] [pathname ...]

DESCRIPTION
     Tar stores and extracts files from a tape or disk archive.

     The first argument to tar should be a function; either one of the letters
     Acdrtux, or one of the long function names.  A function letter need not
     be prefixed with ``-'', and may be combined with other single-letter
     options.  A long function name must be prefixed with --.  Some options
     take a parameter; with the single-letter form these must be given as sep‐
     arate arguments.  With the long form, they may be given by appending
     =value to the option.

FUNCTION LETTERS
     Main operation mode:

     -A, --catenate, --concatenate
           append tar files to an archive

     -c, --create
           create a new archive

     -d, --diff, --compare
           find differences between archive and file system

     --delete
           delete from the archive (not on mag tapes!)

     -r, --append
           append files to the end of an archive

     -t, --list
           list the contents of an archive

     --test-label
           test the archive volume label and exit

     -u, --update
           only append files newer than copy in archive

     -x, --extract, --get
           extract files from an archive

OTHER OPTIONS
     Operation modifiers:

     -[0-7][lmh]
           specify drive and density

     -a, --auto-compress
           use archive suffix to determine the compression program

     --acls
           Enable the POSIX ACLs support

     --no-acls
           Disable the POSIX ACLs support

     --add-file=FILE
           add given FILE to the archive (useful if its name starts with a
           dash)

     --anchored
           patterns match file name start

     --no-anchored
           patterns match after any '/' (default for exclusion)

     --atime-preserve
           preserve access times on dumped files, either by restoring the
           times

     --no-auto-compress
           do not use archive suffix to determine the compression program

     -b, --blocking-factor BLOCKS
           BLOCKS x 512 bytes per record

     -B, --read-full-records
           reblock as we read (for 4.2BSD pipes)

     --backup
           backup before removal, choose version CONTROL

     -C, --directory DIR
           change to directory DIR

     --check-device
           check device numbers when creating incremental archives (default)

     --no-check-device
           do not check device numbers when creating incremental archives

     --checkpoint
           display progress messages every NUMBERth record (default 10)

     --checkpoint-action=ACTION
           execute ACTION on each checkpoint

     --delay-directory-restore
           delay setting modification times and permissions of extracted

     --no-delay-directory-restore
           cancel the effect of --delay-directory-restore option

     --exclude=PATTERN
           exclude files, given as a PATTERN

     --exclude-backups
           exclude backup and lock files

     --exclude-caches
           exclude contents of directories containing CACHEDIR.TAG,

     --exclude-caches-all
           exclude directories containing CACHEDIR.TAG

     --exclude-caches-under
           exclude everything under directories containing CACHEDIR.TAG

     --exclude-tag=FILE
           exclude contents of directories containing FILE, except

     --exclude-tag-all=FILE
           exclude directories containing FILE

     --exclude-tag-under=FILE
           exclude everything under directories containing FILE

     --exclude-vcs
           exclude version control system directories

     -f, --file ARCHIVE
           use archive file or device ARCHIVE

     -F, --info-script, --new-volume-script NAME
           run script at end of each tape (implies -M)

     --force-local
           archive file is local even if it has a colon

     --full-time
           print file time to its full resolution

     -g, --listed-incremental FILE
           handle new GNU-format incremental backup

     -G, --incremental
           handle old GNU-format incremental backup

     --group=NAME
           force NAME as group for added files

     -h, --dereference
           follow symlinks; archive and dump the files they point to

     -H, --format FORMAT
           create archive of the given formatFORMAT is one of the following:

           --format=gnu
                 GNU tar 1.13.x format

           --format=oldgnu
                 GNU format as per tar <= 1.12

           --format=pax
                 POSIX 1003.1-2001 (pax) format

           --format=posix
                 same as pax

           --format=ustar
                 POSIX 1003.1-1988 (ustar) format

           --format=v7
                 old V7 tar format

     --hard-dereference
           follow hard links; archive and dump the files they refer to

     -i, --ignore-zeros
           ignore zeroed blocks in archive (means EOF)

     -I, --use-compress-program PROG
           filter through PROG (must accept -d)

     --ignore-case
           ignore case

     --no-ignore-case
           case sensitive matching (default)

     --ignore-command-error
           ignore exit codes of children

     --no-ignore-command-error
           treat non-zero exit codes of children as error

     --ignore-failed-read
           do not exit with nonzero on unreadable files

     --index-file=FILE
           send verbose output to FILE

     -j, --bzip2


     -J, --xz


     -k, --keep-old-files
           don't replace existing files when extracting,

     -K, --starting-file MEMBER-NAME
           begin at member MEMBER-NAME when reading the archive

     --keep-directory-symlink
           preserve existing symlinks to directories when extracting

     --keep-newer-files
           don't replace existing files that are newer than their archive
           copies

     -l, --check-links
           print a message if not all links are dumped

     -L, --tape-length NUMBER
           change tape after writing NUMBER x 1024 bytes

     --level=NUMBER
           dump level for created listed-incremental archive

     --lzip


     --lzma


     --lzop


     -m, --touch
           don't extract file modified time

     -M, --multi-volume
           create/list/extract multi-volume archive

     --mode=CHANGES
           force (symbolic) mode CHANGES for added files

     --mtime=DATE-OR-FILE
           set mtime for added files from DATE-OR-FILE

     -n, --seek
           archive is seekable

     -N, --newer, --after-date DATE-OR-FILE
           only store files newer than DATE-OR-FILE

     --newer-mtime=DATE
           compare date and time when data changed only

     --null
           -T reads null-terminated names, disable -C

     --no-null
           disable the effect of the previous --null option

     --numeric-owner
           always use numbers for user/group names

     -O, --to-stdout
           extract files to standard output

     --occurrence
           process only the NUMBERth occurrence of each file in the archive;

     --old-archive, --portability
           same as --format=v7

     --one-file-system
           stay in local file system when creating archive

     --overwrite
           overwrite existing files when extracting

     --overwrite-dir
           overwrite metadata of existing directories when extracting
           (default)

     --no-overwrite-dir
           preserve metadata of existing directories

     --owner=NAME
           force NAME as owner for added files

     -p, --preserve-permissions, --same-permissions
           extract information about file permissions (default for superuser)

     -P, --absolute-names
           don't strip leading '/'s from file names

     --pax-option=keyword[[:]=value][,keyword[[:]=value]]...
           control pax keywords

     --posix
           same as --format=posix

     --preserve
           same as both -p and -s

     --quote-chars=STRING
           additionally quote characters from STRING

     --no-quote-chars=STRING
           disable quoting for characters from STRING

     --quoting-style=STYLE
           set name quoting style; see below for valid STYLE values

     -R, --block-number
           show block number within archive with each message

     --record-size=NUMBER
           NUMBER of bytes per record, multiple of 512

     --recursion
           recurse into directories (default)

     --no-recursion
           avoid descending automatically in directories

     --recursive-unlink
           empty hierarchies prior to extracting directory

     --remove-files
           remove files after adding them to the archive

     --restrict
           disable use of some potentially harmful options

     --rmt-command=COMMAND
           use given rmt COMMAND instead of rmt

     --rsh-command=COMMAND
           use remote COMMAND instead of rsh

     -s, --preserve-order, --same-order
           member arguments are listed in the same order as the

     -S, --sparse
           handle sparse files efficiently

     --same-owner
           try extracting files with the same ownership as exists in the ar‐
           chive (default for superuser)

     --no-same-owner
           extract files as yourself (default for ordinary users)

     --no-same-permissions
           apply the user's umask when extracting permissions from the archive
           (default for ordinary users)

     --no-seek
           archive is not seekable

     --selinux
           Enable the SELinux context support

     --no-selinux
           Disable the SELinux context support

     --show-defaults
           show tar defaults

     --show-omitted-dirs
           when listing or extracting, list each directory that does not match
           search criteria

     --show-snapshot-field-ranges
           show valid ranges for snapshot-file fields

     --show-transformed-names, --show-stored-names
           show file or archive names after transformation

     --skip-old-files
           don't replace existing files when extracting, silently skip over
           them

     --sparse-version=MAJOR[.MINOR]
           set version of the sparse format to use (implies --sparse)

     --strip-components=NUMBER
           strip NUMBER leading components from file names on extraction

     --suffix=STRING
           backup before removal, override usual suffix ('~' unless overridden
           by environment variable SIMPLE_BACKUP_SUFFIX)

     -T, --files-from FILE
           get names to extract or create from FILE

     --to-command=COMMAND
           pipe extracted files to another program

     --totals
           print total bytes after processing the archive;

     --transform, --xform EXPRESSION
           use sed replace EXPRESSION to transform file names

     -U, --unlink-first
           remove each file prior to extracting over it

     --unquote
           unquote filenames read with -T (default)

     --no-unquote
           do not unquote filenames read with -T

     --utc
           print file modification times in UTC

     -v, --verbose
           verbosely list files processed

     -V, --label TEXT
           create archive with volume name TEXT; at list/extract time, use
           TEXT as a globbing pattern for volume name

     --volno-file=FILE
           use/update the volume number in FILE

     -w, --interactive, --confirmation
           ask for confirmation for every action

     -W, --verify
           attempt to verify the archive after writing it

     --warning=KEYWORD
           warning control

     --wildcards
           use wildcards (default for exclusion)

     --wildcards-match-slash
           wildcards match '/' (default for exclusion)

     --no-wildcards-match-slash
           wildcards do not match '/'

     --no-wildcards
           verbatim string matching

     -X, --exclude-from FILE
           exclude patterns listed in FILE

     --xattrs
           Enable extended attributes support

     --xattrs-exclude=MASK
           specify the exclude pattern for xattr keys

     --xattrs-include=MASK
           specify the include pattern for xattr keys

     --no-xattrs
           Disable extended attributes support

     -z, --gzip, --gunzip --ungzip


     -Z, --compress, --uncompress


ENVIRONMENT
     The behavior of tar is controlled by the following environment variables,
     among others:

     TAR_LONGLINK_100

     PRISTINE_TAR_COMPAT

     SIMPLE_BACKUP_SUFFIX
             Backup prefix to use when extracting, if --suffix is not speci‐
             fied.  The backup suffix defaults to `~' if neither is specified.

     TAR_OPTIONS
             Options to prepend to those specified on the command line, sepa‐
             rated by whitespace.  Embedded backslashes may be used to escape
             whitespace or backslashes within an option.

     TAPE    Device or file to use for the archive if --file is not specified.
             If this environment variable is unset, use stdin or stdout
             instead.

EXAMPLES
     Create archive.tar from files foo and bar.
           tar -cf archive.tar foo bar
     List all files in archive.tar verbosely.
           tar -tvf archive.tar
     Extract all files from archive.tar.
           tar -xf archive.tar

SEE ALSO
     tar(5), symlink(7), rmt(8)

HISTORY
     The tar command appeared in Version 7 AT&T UNIX.

BUGS
     The GNU folks, in general, abhor man pages, and create info documents
     instead.  Unfortunately, the info document describing tar is licensed
     under the GFDL with invariant cover texts, which makes it impossible to
     include any text from that document in this man page.  Most of the text
     in this document was automatically extracted from the usage text in the
     source.  It may not completely describe all features of the program.

                                  Feb 4, 2014

Wednesday, January 4, 2017

Linux Command Line Tutorial For Beginners 32 - date command

DATE(1)                        User Commands                       DATE(1)



NAME
       date - print or set the system date and time

SYNOPSIS
       date [OPTION]... [+FORMAT]
       date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

DESCRIPTION
       Display  the  current  time  in the given FORMAT, or set the system
       date.

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

       -d, --date=STRING
              display time described by STRING, not 'now'

       -f, --file=DATEFILE
              like --date once for each line of DATEFILE

       -I[TIMESPEC], --iso-8601[=TIMESPEC]
              output  date/time  in  ISO 8601 format.  TIMESPEC='date' for
              date only (the default), 'hours', 'minutes',  'seconds',  or
              'ns' for date and time to the indicated precision.

       -r, --reference=FILE
              display the last modification time of FILE

       -R, --rfc-2822
              output  date  and time in RFC 2822 format.  Example: Mon, 07
              Aug 2006 12:34:56 -0600

       --rfc-3339=TIMESPEC
              output date and time in RFC 3339  format.   TIMESPEC='date',
              'seconds', or 'ns' for date and time to the indicated preci‐
              sion.  Date and time components are separated  by  a  single
              space: 2006-08-07 12:34:56-06:00

       -s, --set=STRING
              set time described by STRING

       -u, --utc, --universal
              print or set Coordinated Universal Time

       --help display this help and exit

       --version
              output version information and exit

       FORMAT controls the output.  Interpreted sequences are:

       %%     a literal %

       %a     locale's abbreviated weekday name (e.g., Sun)

       %A     locale's full weekday name (e.g., Sunday)

       %b     locale's abbreviated month name (e.g., Jan)

       %B     locale's full month name (e.g., January)

       %c     locale's date and time (e.g., Thu Mar  3 23:05:25 2005)

       %C     century; like %Y, except omit last two digits (e.g., 20)

       %d     day of month (e.g., 01)

       %D     date; same as %m/%d/%y

       %e     day of month, space padded; same as %_d

       %F     full date; same as %Y-%m-%d

       %g     last two digits of year of ISO week number (see %G)

       %G     year  of ISO week number (see %V); normally useful only with
              %V

       %h     same as %b

       %H     hour (00..23)

       %I     hour (01..12)

       %j     day of year (001..366)

       %k     hour, space padded ( 0..23); same as %_H

       %l     hour, space padded ( 1..12); same as %_I

       %m     month (01..12)

       %M     minute (00..59)

       %n     a newline

       %N     nanoseconds (000000000..999999999)

       %p     locale's equivalent of either AM or PM; blank if not known

       %P     like %p, but lower case

       %r     locale's 12-hour clock time (e.g., 11:11:04 PM)

       %R     24-hour hour and minute; same as %H:%M

       %s     seconds since 1970-01-01 00:00:00 UTC

       %S     second (00..60)

       %t     a tab

       %T     time; same as %H:%M:%S

       %u     day of week (1..7); 1 is Monday

       %U     week number of year,  with  Sunday  as  first  day  of  week
              (00..53)

       %V     ISO week number, with Monday as first day of week (01..53)

       %w     day of week (0..6); 0 is Sunday

       %W     week  number  of  year,  with  Monday  as  first day of week
              (00..53)

       %x     locale's date representation (e.g., 12/31/99)

       %X     locale's time representation (e.g., 23:13:48)

       %y     last two digits of year (00..99)

       %Y     year

       %z     +hhmm numeric time zone (e.g., -0400)

       %:z    +hh:mm numeric time zone (e.g., -04:00)

       %::z   +hh:mm:ss numeric time zone (e.g., -04:00:00)

       %:::z  numeric time zone with : to necessary precision (e.g.,  -04,
              +05:30)

       %Z     alphabetic time zone abbreviation (e.g., EDT)

       By  default,  date  pads numeric fields with zeroes.  The following
       optional flags may follow '%':

       -      (hyphen) do not pad the field

       _      (underscore) pad with spaces

       0      (zero) pad with zeros

       ^      use upper case if possible

       #      use opposite case if possible

       After any flags comes an optional field width, as a decimal number;
       then  an  optional  modifier, which is either E to use the locale's
       alternate representations if available, or O to  use  the  locale's
       alternate numeric symbols if available.

EXAMPLES
       Convert seconds since the epoch (1970-01-01 UTC) to a date

              $ date --date='@2147483647'

       Show  the time on the west coast of the US (use tzselect(1) to find
       TZ)

              $ TZ='America/Los_Angeles' date

       Show the local time for 9AM next Friday on the west coast of the US

              $ date --date='TZ="America/Los_Angeles" 09:00 next Fri'

DATE STRING
       The --date=STRING is a  mostly  free  format  human  readable  date
       string  such  as  "Sun,  29 Feb 2004 16:21:42 -0800" or "2004-02-29
       16:21:42" or even "next Thursday".  A date string may contain items
       indicating calendar date, time of day, time zone, day of week, rel‐
       ative time, relative date, and numbers.  An empty string  indicates
       the  beginning  of the day.  The date string format is more complex
       than is easily documented here but is fully described in  the  info
       documentation.

AUTHOR
       Written by David MacKenzie.

REPORTING BUGS
       Report date bugs to bug-coreutils@gnu.org
       GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
       General help using GNU software: <http://www.gnu.org/gethelp/>
       Report    date    translation   bugs   to   <http://translationpro‐
       ject.org/team/>

COPYRIGHT
       Copyright © 2013 Free Software Foundation,  Inc.   License  GPLv3+:
       GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
       This  is free software: you are free to change and redistribute it.
       There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       The full documentation for date is maintained as a Texinfo  manual.
       If  the info and date programs are properly installed at your site,
       the command

              info coreutils 'date invocation'

       should give you access to the complete manual.



GNU coreutils 8.21              March 2014                         DATE(1)

Linux Command Line Tutorial For Beginners 31 - cal command

CAL(1)                  BSD General Commands Manual                 CAL(1)

NAME
     cal, ncal — displays a calendar and the date of Easter

SYNOPSIS
     cal [-3hjy] [-A number] [-B number] [[month] year]
     cal [-3hj] [-A number] [-B number] -m month [year]
     ncal [-3bhjJpwySM] [-A number] [-B number] [-s country_code] [[month]
         year]
     ncal [-3bhJeoSM] [-A number] [-B number] [year]
     ncal [-CN] [-H yyyy-mm-dd] [-d yyyy-mm]

DESCRIPTION
     The cal utility displays a simple calendar in traditional format and
     ncal offers an alternative layout, more options and the date of
     Easter.  The new format is a little cramped but it makes a year fit
     on a 25x80 terminal.  If arguments are not specified, the current
     month is displayed.

     The options are as follows:

     -h      Turns off highlighting of today.

     -J      Display Julian Calendar, if combined with the -o option, dis‐
             play date of Orthodox Easter according to the Julian Calen‐
             dar.

     -e      Display date of Easter (for western churches).

     -j      Display Julian days (days one-based, numbered from January
             1).

     -m month
             Display the specified month.  If month is specified as a dec‐
             imal number, it may be followed by the letter ‘f’ or ‘p’ to
             indicate the following or preceding month of that number,
             respectively.

     -o      Display date of Orthodox Easter (Greek and Russian Orthodox
             Churches).

     -p      Print the country codes and switching days from Julian to
             Gregorian Calendar as they are assumed by ncal.  The country
             code as determined from the local environment is marked with
             an asterisk.

     -s country_code
             Assume the switch from Julian to Gregorian Calendar at the
             date associated with the country_code.  If not specified,
             ncal tries to guess the switch date from the local environ‐
             ment or falls back to September 2, 1752.  This was when Great
             Britain and her colonies switched to the Gregorian Calendar.

     -w      Print the number of the week below each week column.

     -y      Display a calendar for the specified year. This option is
             implied when a year but no month are specified on the command
             line.

     -3      Display the previous, current and next month surrounding
             today.

     -1      Display only the current month. This is the default.

     -A number
             Months to add after. The specified number of months is added
             to the end of the display. This is in addition to any date
             range selected by the -y, -3, or -1 options. For example,
             “cal -y -B2 -A2” shows everything from November of the previ‐
             ous year to February of the following year. Negative numbers
             are allowed, in which case the specified number of months is
             subtracted. For example, “cal -y -B-6” shows July to Decem‐
             ber. And “cal -A11” simply shows the next 12 months.

     -B number
             Months to add before. The specified number of months is added
             to the beginning of the display. See -A for examples.

     -C      Switch to cal mode.

     -N      Switch to ncal mode.

     -d yyyy-mm
             Use yyyy-mm as the current date (for debugging of date selec‐
             tion).

     -H yyyy-mm-dd
             Use yyyy-mm-dd as the current date (for debugging of high‐
             lighting).

     -M      Weeks start on Monday.

     -S      Weeks start on Sunday.

     -b      Use oldstyle format for ncal output.

     A single parameter specifies the year (1–9999) to be displayed; note
     the year must be fully specified: “cal 89” will not display a calen‐
     dar for 1989.  Two parameters denote the month and year; the month is
     either a number between 1 and 12, or a full or abbreviated name as
     specified by the current locale.  Month and year default to those of
     the current system clock and time zone (so “cal -m 8” will display a
     calendar for the month of August in the current year).

     Not all options can be used together. For example, the options -y,
     -3, and -1 are mutually exclusive. If inconsistent options are given,
     the later ones take precedence over the earlier ones.

     A year starts on January 1.

SEE ALSO
     calendar(3), strftime(3)

HISTORY
     A cal command appeared in Version 5 AT&T UNIX.  The ncal command
     appeared in FreeBSD 2.2.6.  The output of the cal command is supposed
     to be bit for bit compatible to the original Unix cal command,
     because its output is processed by other programs like CGI scripts,
     that should not be broken. Therefore it will always output 8 lines,
     even if only 7 contain data. This extra blank line also appears with
     the original cal command, at least on Solaris 8

AUTHORS
     The ncal command and manual were written by Wolfgang Helbig
     <helbig@FreeBSD.org>.

BUGS
     The assignment of Julian–Gregorian switching dates to country codes
     is historically naive for many countries.

     Not all options are compatible and using them in different orders
     will give varying results.

BSD                           March 14, 2009                           BSD

Sunday, January 1, 2017

Linux Command Line Tutorial For Beginners 30 - wc command



WC(1)                              User Commands                              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.  With no FILE, or when FILE is -, read  standard
       input.   A  word  is  a  non-zero-length sequence of characters delimited by
       white space.  The options below may be  used  to  select  which  counts  are
       printed, always in the following order: newline, word, character, byte, max‐
       imum 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 length of the longest line

       -w, --words
              print the word counts

       --help display this help and exit

       --version
              output version information and exit

AUTHOR
       Written by Paul Rubin and David MacKenzie.

REPORTING BUGS
       Report wc bugs to bug-coreutils@gnu.org
       GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
       General help using GNU software: <http://www.gnu.org/gethelp/>
       Report wc translation bugs to <http://translationproject.org/team/>

COPYRIGHT
       Copyright  ©  2013  Free  Software Foundation, Inc.  License GPLv3+: GNU GPL
       version 3 or later <http://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it.  There is
       NO WARRANTY, to the extent permitted by law.

SEE ALSO
       The  full  documentation  for  wc is maintained as a Texinfo manual.  If the
       info and wc programs are properly installed at your site, the command

              info coreutils 'wc invocation'

       should give you access to the complete manual.



GNU coreutils 8.21                   March 2014                               WC(1)