Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux redirection and piping     - Python Dir find a folder several files (Programming)

- bash login and welcome message: / etc / issue, / etc / motd (Linux)

- CentOS install SystemTap-2.6 (Linux)

- MySQL Statistics (Database)

- CentOS6.5 setup Oracle 11gR2 startup (Database)

- C language to view various types of data size (Programming)

- How to install or upgrade to the Linux kernel in Ubuntu 4.2 (Linux)

- CentOS 7.0 Enable iptables firewall (Linux)

- MySQL flip-flop (Database)

- User rights management system under Linux (Linux)

- Oracle: RETURNING clause (Database)

- Try the command ip, ifconfig is obsolete under Linux (Linux)

- Oracle Sql Loader tool has shown signs (Database)

- Sublime Text 3 shortcuts summary (Linux)

- Oracle lag () and lpad () function (Database)

- Oracle database import and export (Database)

- MongoDB upgrade to 2.6 (Database)

- Database start listening TNS-12537, TNS-12560 error (Database)

- xCAT Installation Kit (Linux)

- Linux systems use IP masquerading anti-hacker (Linux)

 
         
  Linux redirection and piping
     
  Add Date : 2017-01-08      
         
       
         
  Standard output redirection

">" Operator: overwrite the destination file contents

linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ date> foo
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ cat foo
Fri May 8 09:55:42 CST 2015
">>" Operator: additional output in the target end of the file

linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ date >> foo
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ cat foo
Fri May 8 09:55:42 CST 2015
Fri May 8 09:57:02 CST 2015
Redirect standard error

"2>" operator: overwrite the destination file contents

linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ ls inexistent_dir 2> ls-error.txt
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ cat ls-error.txt
ls: can not access inexistent_dir: No such file or directory
"2 >>" operator: additional output in the target end of the file

linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ ls inexistent_dir 2 >> ls-error.txt
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ cat ls-error.txt
ls: can not access inexistent_dir: No such file or directory
ls: can not access inexistent_dir: No such file or directory
The standard output and standard error is redirected to the same file

"&>" Operator: overwrite the destination file contents

linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ date &> foo
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ cat foo
Fri May 8 10:16:12 CST 2015
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ ls inexistent_dir &> foo
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ cat foo
ls: can not access inexistent_dir: No such file or directory
"& >>" Operator: additional output in the target end of the file

linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ echo 'hello world'> foo
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ date & >> foo
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ ls inexistent_dir & >> foo
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ cat foo
hello world
Fri May 8 10:25:24 CST 2015
ls: can not access inexistent_dir: No such file or directory


Standard input redirection

"<" Operator

linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ echo 'hello world'> foo
linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ cat hello world
pipeline

"|" Operator


linuxhost @ linuxhost: ~ / linuxhost / linux / cmdline $ ls / usr / bin | grep '^ zip'
zip
zipcloak
zipgrep
zipinfo
zipnote
zipsplit
     
         
       
         
  More:      
 
- VNC configuration detailed analysis under Linux (Linux)
- Oracle Sql Loader tool has shown signs (Database)
- Ordinary users how to use the firewall software (Linux)
- MySQL multi-master-slave synchronization (Database)
- Inject script commands manually annotated summary (Linux)
- Processor in protected mode of protection (Linux)
- Linux smart small switch rfkill (Linux)
- Linux server security settings to close unused ports (Linux)
- Linux crontab commands and detailed usage examples (Linux)
- CentOS / Linux kernel upgrade (Linux)
- Using Lua implement various operations list (Programming)
- How to clear the DNS query cache under Linux / Unix / Mac (Linux)
- Learn about EditText little depth (Programming)
- ORA-00600: internal error code, arguments: [keltnfy-ldmInit], [46], [1], [], [], [], [], [] (Database)
- MySQL fuzzy query: LIKE and REGEXP pattern mode (Database)
- Memcached installation, configuration and monitoring (Server)
- Oracle ORA-01089 failure analysis (Database)
- SSL VPN SSL VPN access to security websites patron (Linux)
- OpenResty load balancing MySQL (Database)
- DB2 Version SQLJ to access Oracle Server (Database)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.