 --help-h ð
 etcSystem32Ŀ¼ŵ windowsĿ¼
ע⣺ЩĿ¼ָ/\ʵwindowsҲ/Ŀ¼ָ.

=================================================
0: bash.exe   ǳҪ
ע⣺windowsзʵ2ַ س з һдΪ"\r\n".
ԭǹϵĵԵնΪ紫ֻҪȻسٻУҪ2Ҫ2Ʒ
MS͵Ըκδ˱ŤΪ־ᣬMSд2ļ
۸ģ 2ݲܰȫͨܵݣûҵأ֪ʦPROMPTܷرջת
UNIXLINUXֻһ"\n"ˣйܵ԰ȫ 2 

׼ϵͳbash.exe, bash.exe   LINUX淶 йܵ԰ȫ 2ݡ
bash.exe -c ""  cmd.exe /c ""
bashһǱģҲһԵš

1>÷
EXEC*  &RESULT=*bash.exe -c  '1|  2 2>&1|  3'
ţͬǰҪ\ת塣
ڣſѡ˫ź͵ţ ʵѡͬ
windows˫ţ ѡ
 2>&1 ʾ 2ı׼ ϲ2ı׼


=================================================
1:ַ滻ߣsed   ǳҪ
Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...

  -n, --quiet, --silent
                 suppress automatic printing of pattern space
  -e ű, --expression=ű
                 ӽűжȡ
  -f űļ, --file=űļ
                 ӽűļжȡ
  -c  --nocr     turn off \r$ translation; must be first switch on command line
      --help     display this help and exit
  -V, --version  output version information and exit

If no -e, --expression, -f, or --file option is given, then the first
non-option argument is taken as the sed script to interpret.  All
remaining arguments are names of input files; if no input files are
specified, then the standard input is read.

(1) ÷
  ǰ|sed s/滻/滻/g
  ǰ 2>&1|sed s/滻/滻/g
  ECHO ԭʼ|sed s/滻/滻/g
gΪȫ滻ֻһΡ
ECHOǡһո񣬶ڵݡ
PECMDУ
EXEC*  &RESULT=cmd.exe /c ECHO abc1abc2abc3|sed s/abc/def/g
õ&RESULTdef1def2def3

(2) ļ룺sed s/滻/滻/g  Դļ
gΪȫ滻ֻһΡ

PECMDУ
EXEC*  &RESULT=sed s/abc/def/g  src.txt
ٶsrc.txt Ϊabc1abc2abc3
õ&RESULTdef1def2def3




=================================================
2 ַ: tr  ǳá
÷: tr [ѡ]... 1 [2]
Ϊ׼룬Ϊ׼
, ѹ, ɾ ַ.

  -c, -C, --complement    һƥ 1
  -d, --delete            ɾ1гֵַʱҪ2
  -s, --squeeze-repeats   ƥظַֻ滻Ϊһַڷ
  -t, --truncate-set1       1  2һڷ
      --help     
      --version  汾

 һַһйҺŰΧ󲿷ַʾΪתС
תУ

  \NNN            8ֵNNN ʾַ  (1  3  8λ)
  \\              \
  \a              
  \b              ˸
  \f              ҳ
  \n              з
  \r              س
  \t              ˮƽ(TAB)
  \v              ֱ
  ַ1-ַ2     ַ1ַ2ַ
  [ַ*]          2, ظֱַͼ1һ
  [ַ*ظ]  ظַ ظ0ͷΪ8
  [:alnum:]       ĸ
  [:alpha:]       ĸ
  [:blank:]       ˮƽTABͿհַ(whitespace)
  [:cntrl:]       пƷ
  [:digit:]       ֣09
  [:graph:]       пɴӡַո
  [:lower:]       Сдĸaz
  [:print:]       all printable characters, including space
  [:punct:]       all punctuation characters
  [:space:]       ˮƽTABʹֱ\vͿհַ(whitespace)
  [:upper:]       ддĸA-Z
  [:xdigit:]      16֣09 af A-F
  [=CHAR=]        CHARַ

2  ֻ [:lower:] and [:upper:] չ֤;ֻڴСдת
2 Զչ 1һظַԶڵַ


룺 tr 1  2

ɾ tr -d 1 

˵תеһйκתеһ֣ͼйκŲһǣʡ
 1 [[:xdigit:]]   [3-8[:alpha:]]



=================================================
3ļ2ƺıת  ǳá
Usage:
       xxd [options] [infile [outfile]]
    or
       xxd -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]
Options:
    -a          toggle autoskip: A single '*' replaces nul-lines. Default off.
    -b          binary digit dump (incompatible with -p,-i,-r). Default hex.
    -c cols     format <cols> octets per line. Default 16 (-i: 12, -ps: 30).
    -E          show characters in EBCDIC. Default ASCII.
    -g          number of octets per group in normal output. Default 2.
    -h          print this summary.
    -i          output in C include file style.
    -l len      stop after <len> octets.
    -ps         output in postscript plain hexdump style.
    -r          reverse operation: convert (or patch) hexdump into binary.
    -r -s off   revert with <off> added to file positions found in hexdump.
    -s [+][-]seek  start at <seek> bytes abs. (or +: rel.) infile offset.
    -u          use upper case hex letters.
    -v          show version: "xxd V1.10 27oct98 by Juergen Weigert".

(1) ÷2ƺHEXı: 
 2=>HEXı
   xxd -g1 Դļ [ļ]
   ǰ|xxd -g1 - [ļ]
     //ǰΪ
   ǰ 2>&1 |xxd -g1 - [ļ]
     //Ƚǰı׼ϲΪ

 HEXı=>2
   xxd -r Դļ 2ļ
   ǰ|xxd -r - 2ļ
   Դļǰ  xxd HEXı ʽ
   ʡ2ļ,ֱ׼windows׼֧2,ܴ۸2ݡ
   һ㻹дļɡ

(4) Ҫ
-r
   ת
-r -s off
   off ʼת   
   
-c 
  ÿַһСĬ16-iģʽĬ12
-g
  ÿֽһ顣Ĭ2. һ -g1
-i
  ԴļתCC++ͷļ
-b
  2ƿɶı010101..HEX
-l len 
  תlenֽ
  
-s [+][-]seekN
   seekN ֽڣʼת
-u
   д HEX(ABCDEF) 





=================================================
4lsort.exe
ԭsort.exeںwindowssortΪlsort linux sort
Usage: sort [OPTION]... [FILE]...
Write sorted concatenation of all FILE(s) to standard output.

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'
  -n, --numeric-sort          compare according to string numerical value
  -r, --reverse               reverse the result of comparisons

Other options:

  -c, --check               check whether input is sorted; do not sort
  -k, --key=POS1[,POS2]     start a key at POS1, end it at POS2 (origin 1)
  -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
  -u, --unique              with -c, check for strict ordering;
                              without -c, output only the first of an equal run
  -z, --zero-terminated     end lines with 0 byte, not newline
      --help     display this help and exit
      --version  output version information and exit

POS is F[.C][OPTS], where F is the field number and C the character position
in the field.  OPTS is one or more single-letter ordering options, which
override global ordering options for that key.  If no key is given, use the
entire line as the key.

SIZE may be followed by the following multiplicative suffixes:
% 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y.

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


(1) ÷ǰ|SORT
ǰ

(2) ÷: SORT Դļ
Դļ



(3) Ҫ

-n ֵ簴ֵ109󣻰109С
-r 
--ignore-case  ʱԴСдɼд -f
--ignore-nonprinting   ʱԲɴӡַɼд -i
--output=ļ
  Ĭʾ
--key=POS1[,POS2]
  POS1POS2ΪؼʡĬС
  POSʽΪF[.C]
  FΪڼ(), CΪĵڼС
--field-separator=SEP
  ָ()ָĬΪַ
 
  
=================================================
5: ȡıļͷ

÷: head [OPTION]... [FILE]...
Print the first 10 lines of each FILE to standard output.
With more than one FILE, precede each with a header giving the file name.
With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
  -c, --bytes=[-]N         print the first N bytes of each file;
                             with the leading `-', print all but the last
                             N bytes of each file
  -n, --lines=[-]N         print the first N lines instead of the first 10;
                             with the leading `-', print all but the last
                             N lines of each file
  -q, --quiet, --silent    never print headers giving file names
  -v, --verbose            always print headers giving file names
      --help     display this help and exit
      --version  output version information and exit

N may have a multiplier suffix: b 512, k 1024, m 1024*1024.

(1) ÷ǰ|head
ȡǰǰ10

(2) ÷: head Դļ1  [Դļ2 ..]
ȡÿԴļǰ10
 
(3) Ҫ
--lines=[-]
  ȡУĬ10. -ʾȥĶȫ
--bytes=[-]
  ÿȡУĬȫ. -ʾȥĶȫ
  
/ɴ׺bkmb512, k1024, m1024*1024



=================================================
6: ȡıļβ

÷: tail [OPTION]... [FILE]...
Print the last 10 lines of each FILE to standard output.
With more than one FILE, precede each with a header giving the file name.
With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
      --retry              keep trying to open a file even if it is
                           inaccessible when tail starts or if it becomes
                           inaccessible later; useful when following by name,
                           i.e., with --follow=name
  -c, --bytes=N            output the last N bytes
  -f, --follow[={name|descriptor}]
                           output appended data as the file grows;
                           -f, --follow, and --follow=descriptor are
                           equivalent
  -F                       same as --follow=name --retry
  -n, --lines=N            output the last N lines, instead of the last 10
      --max-unchanged-stats=N
                           with --follow=name, reopen a FILE which has not
                           changed size after N (default 5) iterations
                           to see if it has been unlinked or renamed
                           (this is the usual case of rotated log files)
      --pid=PID            with -f, terminate after process ID, PID dies
  -q, --quiet, --silent    never output headers giving file names
  -s, --sleep-interval=S   with -f, sleep for approximately S seconds
                           (default 1.0) between iterations.
  -v, --verbose            always output headers giving file names
      --help     display this help and exit
      --version  output version information and exit

If the first character of N (the number of bytes or lines) is a `+',
print beginning with the Nth item from the start of each file, otherwise,
print the last N items in the file.  N may have a multiplier suffix:
b 512, k 1024, m 1024*1024.

With --follow (-f), tail defaults to following the file descriptor, which
means that even if a tail'ed file is renamed, tail will continue to track
its end.  This default behavior is not desirable when you really want to
track the actual name of the file, not the file descriptor (e.g., log
rotation).  Use --follow=name in that case.  That causes tail to track the
named file by reopening it periodically to see if it has been removed and
recreated by some other program.


(1) ÷ǰ|tail
ȡǰĺ10

(2) ÷: tail Դļ1  [Դļ2 ..]
ȡÿԴļĺ10

(3) ÷ǰ|tail -f
ǰĺ10Сʾᶯ̬仯


 
(4) Ҫ
--lines=
  ȡУĬ10. 
--bytes=ַ
  ȡĶַĬϰм.

--pid=PID
  PIDӦֹԶ˳
  
-f
  ģʽ
  
--sleep-interval=S
  ģʽڣλ룬Ĭ1
  
  
/ַɴ׺bkmb512, k1024, m1024*1024


=================================================
7 г̣ps
Usage ps [-aefl] [-u uid]
-f = show process uids, ppids
-l = show process uids, ppids, pgids, winpids
-u uid = list processes owned by uid
-a, -e = show processes of all users
-s = show process summary
-W = show windows as well as cygwin processes

(1) ÷: ps -W

ڸеȿԺMSTRȡ




   
=================================================
8.ѹ:gzip
gzip 1.2.4 (18 Aug 93)
usage: gzip [-acdfhlLnNrtvV19] [-S suffix] [file ...]
 -a --ascii       ascii text; convert end-of-lines using local conventions
 -c --stdout      write on standard output, keep original files unchanged
 -d --decompress  decompress
 -f --force       force overwrite of output file and compress links
 -h --help        give this help
 -l --list        list compressed file contents
 -L --license     display software license
 -n --no-name     do not save or restore the original name and time stamp
 -N --name        save or restore the original name and time stamp
 -q --quiet       suppress all warnings
 -r --recursive   operate recursively on directories
 -S .suf  --suffix .suf     use suffix .suf on compressed files
 -t --test        test compressed file integrity
 -v --verbose     verbose mode
 -V --version     display version number
 -1 --fast        compress faster
 -9 --best        compress better
 file...          files to (de)compress. If none given, use standard input.


=================================================
9./tar

GNU `tar' saves many files together into a single tape or disk archive, and
can restore individual files from the archive.

Usage: tar [OPTION]... [FILE]...

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

If a long option shows an argument as mandatory, then it is mandatory
for the equivalent short option also.  Similarly for optional arguments.

Main operation mode:
  -t, --list              list the contents of an archive
  -x, --extract, --get    extract files from an archive
  -c, --create            create a new archive
  -d, --diff, --compare   find differences between archive and file system
  -r, --append            append files to the end of an archive
  -u, --update            only append files newer than copy in archive
  -A, --catenate          append tar files to an archive
      --concatenate       same as -A
      --delete            delete from the archive (not on mag tapes!)

Operation modifiers:
  -W, --verify               attempt to verify the archive after writing it
      --remove-files         remove files after adding them to the archive
  -k, --keep-old-files       don't replace existing files when extracting
      --overwrite            overwrite existing files when extracting
  -U, --unlink-first         remove each file prior to extracting over it
      --recursive-unlink     empty hierarchies prior to extracting directory
  -S, --sparse               handle sparse files efficiently
  -O, --to-stdout            extract files to standard output
  -G, --incremental          handle old GNU-format incremental backup
  -g, --listed-incremental=FILE
                             handle new GNU-format incremental backup
      --ignore-failed-read   do not exit with nonzero on unreadable files

Handling of file attributes:
      --owner=NAME             force NAME as owner for added files
      --group=NAME             force NAME as group for added files
      --mode=CHANGES           force (symbolic) mode CHANGES for added files
      --atime-preserve         don't change access times on dumped files
  -m, --modification-time      don't extract file modified time
      --same-owner             try extracting files with the same ownership
      --no-same-owner          extract files as yourself
      --numeric-owner          always use numbers for user/group names
  -p, --same-permissions       extract permissions information
      --no-same-permissions    do not extract permissions information
      --preserve-permissions   same as -p
  -s, --same-order             sort names to extract to match archive
      --preserve-order         same as -s
      --preserve               same as both -p and -s

Device selection and switching:
  -f, --file=ARCHIVE             use archive file or device ARCHIVE
      --force-local              archive file is local even if has a colon
      --rsh-command=COMMAND      use remote COMMAND instead of rsh
  -[0-7][lmh]                    specify drive and density
  -M, --multi-volume             create/list/extract multi-volume archive
  -L, --tape-length=NUM          change tape after writing NUM x 1024 bytes
  -F, --info-script=FILE         run script at end of each tape (implies -M)
      --new-volume-script=FILE   same as -F FILE
      --volno-file=FILE          use/update the volume number in FILE

Device blocking:
  -b, --blocking-factor=BLOCKS   BLOCKS x 512 bytes per record
      --record-size=SIZE         SIZE bytes per record, multiple of 512
  -i, --ignore-zeros             ignore zeroed blocks in archive (means EOF)
  -B, --read-full-records        reblock as we read (for 4.2BSD pipes)

Archive format selection:
  -V, --label=NAME                   create archive with volume name NAME
              PATTERN                at list/extract time, a globbing PATTERN
  -o, --old-archive, --portability   write a V7 format archive
      --posix                        write a POSIX format archive
  -j, --bzip2                        filter the archive through bzip2
  -z, --gzip, --ungzip               filter the archive through gzip
  -Z, --compress, --uncompress       filter the archive through compress
      --use-compress-program=PROG    filter through PROG (must accept -d)

Local file selection:
  -C, --directory=DIR          change to directory DIR
  -T, --files-from=NAME        get names to extract or create from file NAME
      --null                   -T reads null-terminated names, disable -C
      --exclude=PATTERN        exclude files, given as a globbing PATTERN
  -X, --exclude-from=FILE      exclude globbing patterns listed in FILE
  -P, --absolute-names         don't strip leading `/'s from file names
  -h, --dereference            dump instead the files symlinks point to
      --no-recursion           avoid descending automatically in directories
  -l, --one-file-system        stay in local file system when creating archive
  -K, --starting-file=NAME     begin at file NAME in the archive
  -N, --newer=DATE             only store files newer than DATE
      --newer-mtime            compare date and time when data changed only
      --after-date=DATE        same as -N
      --backup[=CONTROL]       backup before removal, choose version control
      --suffix=SUFFIX          backup before removal, override usual suffix

Informative output:
      --help            print this help, then exit
      --version         print tar program version number, then exit
  -v, --verbose         verbosely list files processed
      --checkpoint      print directory names while reading the archive
      --totals          print total bytes written while creating archive
  -R, --block-number    show block number within archive with each message
  -w, --interactive     ask for confirmation for every action
      --confirmation    same as -w

The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control may be set with --backup or VERSION_CONTROL, values are:

  t, numbered     make numbered backups
  nil, existing   numbered if numbered backups exist, simple otherwise
  never, simple   always make simple backups

GNU tar cannot read nor produce `--posix' archives.  If POSIXLY_CORRECT
is set in the environment, GNU extensions are disallowed with `--posix'.
Support for POSIX is only partially implemented, don't count on it yet.
ARCHIVE may be FILE, HOST:FILE or USER@HOST:FILE; and FILE may be a file
or a device.  *This* `tar' defaults to `-f- -b20'.

Report bugs to <bug-tar@gnu.org>.

ɵ*.tarļԽһgzipѹ*.tar.gzѹ
gzip -9 ABC.tar 
õѹABC.tar.gz

tarҲ-zֱѹ*.tgzѹtgztar.gzд

(1) ÷: 
   ѹ tar  -czf ѹ ѹĿ¼ļ1  [ѹĿ¼ļ2 ...]
   б tar  -lxf ѹ 
   ѹ tar  [-C ѹĿ¼] -xzf ѹ 
   ȡ tar  [-C ѹĿ¼] -zf ѹ  --get ȡļĿ¼
      
   





=================================================
10:tee
Usage: tee [OPTION]... [ļ1] [ļ2 ...] 
Copy standard input to each FILE, and also to standard output.

  -a, --append              ׷ӵļУԭݡ
  -i, --ignore-interrupts   Ctrl-Cֹź
      --help     display this help and exit
      --version  output version information and exit

If a FILE is -, copy again to standard output.

ǰһı׼ÿһļͬʱ׼. 
ļ-,ʾٿ׼һΡ

(1) ÷:ǰ| tee my.log
               ǰ 2>&1| tee my.log 




=================================================
11 ȥظУuniq
÷: uniq.exe [ѡ]... [ļ [ļ]]
Discard all but one of successive identical lines from INPUT (or
standard input), writing to OUTPUT (or standard output).

Mandatory arguments to long options are mandatory for short options too.
  -c, --count           prefix lines by the number of occurrences
  -d, --repeated        ֻظ
  -D, --all-repeated[=delimit-method] print all duplicate lines
                        delimit-method={none(default),prepend,separate}
                        Delimiting is done with blank lines.
  -f, --skip-fields=N   ȽʱԿʼ N 򣨴ʣ
  -i, --ignore-case     ȽʱԴСд
  -s, --skip-chars=N    ȽʱԿʼ N ַ
  -u, --unique          ֻΨһ
  -w, --check-chars=N   һȽ N ַ
      --help     display this help and exit
      --version  output version information and exit

A field is a run of whitespace, then non-whitespace characters.
Fields are skipped before chars.

Ĭϣظ ֻһС
һ

(1) ÷:  
   ǰ| uniq [ -  ļ]
   ǰ|sort| uniq  [ -  ļ]
   sort ļ| uniq  [ -  ļ]
   uniq ļ [ļ]
   
   

