-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcommands.text
94 lines (74 loc) · 1.51 KB
/
commands.text
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
echo $$
brew install pstree
brew install watch
watch pstree -p 8776
tail -f /var/log/system.log &
fg
^z
bg
wait
^c
pstree -p 1234
kill 5678
mvim fork_block.rb
./fork_block.rb
mvim fork_if.rb
./fork_if.rb
mvim zombie.c
./zombie
^z
ps ax
pstree 10244
mvim monitor.sh
/bin/bash.monitor.sh
ls -la
chmod +x monitor.sh
exec monitor.sh
./monitor.sh
./monitor.sh moo
ls | ./monitor.sh moo
ls | ./monitor.sh | tr [a-z] [A-Z]
ps
ps | ./monitor.rb -bleat
cat seuss.text
./monitor.rb <seuss.text | tr [a-z] [A-Z]
echo "There is" | ./monitor.rb -no 2>>log.err | ./monitor.rb -spoon >/dev/null 2>>log.err
cat log.err
curl "http://en.wikipedia.org/wiki/Pipeline_(Unix)" |
sed 's/[^a-zA-Z ]/ /g' |
tr 'A-Z ' 'a-z\n' |
grep '[a-z]' |
sort -u |
comm -23 - <(sort /usr/share/dict/words) |
less
ls | ruby -e 'puts "<div>#{STDIN.gets.chomp}</div>"'
ls | ruby -ne 'puts "<div>#{$_.chomp}</div>"'
cat /etc/passwd
cat /etc/passwd | ruby -ne 'puts $1 if $_.scan(/(^[a-z]+)/).first'
ruby -ne 'puts $1 if VARGS[0].scan(/(^[a-z]+)/).first' /etc/passwd
cat | tr [a-z] [A-Z}
mvim pipery.rb
./pipery.rb
irb
require 'fileutils'
FileUtils.pwd
FileUtils.cd “/”
FileUtils.cd "/Users/greg/git/unix_for_programmers_demo"
`ps`
puts `ps`
exit
echo `cd ..;pwd`
$ pwd
irb
host = `hostname -f`
host = `hostname -s`
result = `echo "testing..." | ./monitor.rb -cowbell`
require ‘open3’
pwd = `pwd`.chomp
stdin, stdout, stderr, thread = Open3.popen3("#{pwd}/monitor.rb -lesscowbell")
stdin.puts "eggs"
stdin.puts "beans"
stdin.close
stdout.gets
stderr.gets
thread.pid