티스토리 뷰
Pipelines
The | symbol is used for linking two commands together.
A | B | C [commands B must be filter]
{
$ who | wc -l
14
$ who | date
Thu Jun 22 12:12:12 KST 2017
$ ps -ef | more
$ ls | sort -r | more
$ ps -ef | grep telnetd
$ ps -ef | grep telnetd | wc -l
}
Pipelines versus Input and Output Redirection
who > sort.out, sort < who.out versus. who | sort
Redirection in a Pipeline (stdout - pipe line-> stdin)
$ grep user /etc/passwd | wc -l > wc.out [good]
$ grep user /etc/passwd > grep.out | wc -l [bad]
$ grep user /etc/passwd 2> grep.err | wc -l [good or bad]
$ grep user /etc/passwd | wc -l < /etc/passwd [bad]
$ grep user /etc/passwd | wc -l 2> wc.out [good]
cut command
$ date | cut -c1-3 [characters 1~3]
$tail /etc/passwd | cut -f1,6 -d: [field ":" 1, 6]
$ who | cut -f1 -d" " [field " "1]
user8
user5
user9
user6
user7
user1
tr command
Translate character
$ tr "a" "@" < filenames
$ who | tr -s " " | cut -f1,5 -d" " // -s 반복되는 문자를 하나로 바꿈
user8 11:54
user5 10:41
user9 09:24
user6 09:41
$ who | tee who.out ; cat who.out | wc -l
user8 pts/ta Jun 22 11:54
...
user5 pts/tl Jun 22 12:15
14
$ who | tee who.out | wc -l ; cat who.out
14
user8 pts/ta Jun 22 11:54
user5 pts/0 Jun 22 10:41
pr command
$ cut -f1 -d: /etc/passwd | pr -t -5
root hpdb iwww user7 user16
instr nobody owww user8 user17
daemon www tftp user9 user18
'IoT 과정' 카테고리의 다른 글
HPUX - Shell Programming (0) | 2017.06.23 |
---|---|
HPUX - Process Control (0) | 2017.06.22 |
HPUX - Input and Output Redirection (0) | 2017.06.22 |
HPUX - Quoting (0) | 2017.06.21 |
HPUX - File Name Generation (0) | 2017.06.21 |
- Total
- Today
- Yesterday
- 엄청난 인내심과 시뮬레이션을 위한 아레나 툴
- 대규모 시스템 설계 기초
- grafana cloud
- rosen
- 자바스크립트 예제
- Simulation
- Arena
- paul wilton
- 백준
- 항해99
- 아레나 시뮬레이션
- 아레나
- 명제논리
- arena simulation
- flutter
- 최단경로 알고리즘
- Propositional and Predicate Logic
- 자바스크립트
- Grafana
- 이산 수학
- 이산수학
- 그라파나
- beginning javascript
- javascript
- 아레나시뮬레이션
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- 시뮬레이션
- 로젠
- Discrete Mathematics
- 데이터 중심 애플리케이션 설계
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |