- Ubuntu 20.04 Essentials
- Neil Smyth
- 127字
- 2021-06-11 17:39:43
9.10 Working with Pipes in the Bash Shell
In addition to I/O redirection, the shell also allows output from one command to be piped directly as input to another command. A pipe operation is achieved by placing the ‘|’ character between two or more commands on a command-line. For example, to count the number of processes running on a system, the output from the ps command can be piped through to the wc command:
$ ps –ef | wc –l
There is no limit to the number of pipe operations that can be performed on a command-line. For example, to find the number of lines in a file which contain the name Smith:
$ cat namesfile | grep Smith | wc –l
推薦閱讀
- 亮劍.NET:.NET深入體驗(yàn)與實(shí)戰(zhàn)精要
- 三菱FX3U/5U PLC從入門到精通
- 網(wǎng)上沖浪
- Deep Learning Quick Reference
- 蕩胸生層云:C語言開發(fā)修行實(shí)錄
- 輕松學(xué)Java
- UTM(統(tǒng)一威脅管理)技術(shù)概論
- 機(jī)器人人工智能
- 單片機(jī)技能與實(shí)訓(xùn)
- Access 2007數(shù)據(jù)庫(kù)入門與實(shí)例應(yīng)用金典
- 運(yùn)動(dòng)控制系統(tǒng)
- Practical Network Automation
- 新世紀(jì)Photoshop CS6中文版應(yīng)用教程
- CPLD/FPGA技術(shù)應(yīng)用
- Appcelerator Titanium Smartphone App Development Cookbook(Second Edition)