Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Practical unix utilities for text processing
Search
Anton Arhipov
October 01, 2010
Technology
0
65
Practical unix utilities for text processing
Anton Arhipov
October 01, 2010
Tweet
Share
More Decks by Anton Arhipov
See All by Anton Arhipov
Strengthening Immutability in Kotlin. A Glimpse into Valhalla
antonarhipov
2
27
Kotlin—the New and Noteworthy in 2.2
antonarhipov
1
6
Levels of AI-assisted programming
antonarhipov
0
64
Devoxx France 2024. Kotlin - the new and noteworthy
antonarhipov
2
50
Harnessing the power of AI in IntelliJ IDEA
antonarhipov
1
180
VirtualJUG: Kotlin 2.0 and beyond
antonarhipov
1
130
Kotlin 2.1: Language Updates
antonarhipov
3
150
Devoxx Belgium 2024 - Kotlin 2.0 and beyond
antonarhipov
2
170
Data Analysis with Kotlin Notebook, DataFrame, and Kandy
antonarhipov
1
95
Other Decks in Technology
See All in Technology
知覚とデザイン
rinchoku
1
720
進化する大規模言語モデル評価: Swallowプロジェクトにおける実践と知見
chokkan
PRO
3
440
現場の壁を乗り越えて、 「計装注入」が拓く オブザーバビリティ / Beyond the Field Barriers: Instrumentation Injection and the Future of Observability
aoto
PRO
1
840
kotlin-lsp の開発開始に触発されて、Emacs で Kotlin 開発に挑戦した記録 / kotlin‑lsp as a Catalyst: My Journey to Kotlin Development in Emacs
nabeo
2
250
abema-trace-sampling-observability-cost-optimization
tetsuya28
0
440
組織全員で向き合うAI Readyなデータ利活用
gappy50
5
2k
初海外がre:Inventだった人間の感じたこと
tommy0124
1
180
Observability — Extending Into Incident Response
nari_ex
2
730
書籍『実践 Apache Iceberg』の歩き方
ishikawa_satoru
0
430
仕様駆動開発を実現する上流工程におけるAIエージェント活用
sergicalsix
10
5.3k
猫でもわかるAmazon Q Developer CLI 解体新書
kentapapa
1
270
[Journal club] Thinking in Space: How Multimodal Large Language Models See, Remember, and Recall Spaces
keio_smilab
PRO
0
110
Featured
See All Featured
Become a Pro
speakerdeck
PRO
29
5.6k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
The Invisible Side of Design
smashingmag
302
51k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Speed Design
sergeychernyshev
32
1.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.3k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
700
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
GitHub's CSS Performance
jonrohan
1032
470k
Transcript
grep | sed | awk | xargs | etc
None
sed vim awk ls
cat tac head tail split wc sum sort uniq kill cut paste join tr dir mv du echo test expr tee grep
DB Mega App Files Log
GNU Coreutils http://www.gnu.org/software/coreutils/ The takeaway
command: man > info coreutils
List of files: ls –l ls –1
ls –latr find . –name *.txt
Seek for a string in a file: grep
“cat” file.txt grep –v “dog” file.txt grep –i “PaTtErN” file.txt egrep “cat|dog” file.txt zgrep “cat” file.txt.gz
for file in `find . –name *tmp` do
rm $file done find . –name *tmp | xargs rm Do something with each file:
find + grep find . -‐name '*txt' -‐exec
grep -‐l aaa {} \; find . -‐name '*txt' | xargs grep -‐l aaa
ls cat tac head tail
split wc sum sort uniq kill cut paste join tr dir mv du echo test expr tee grep
None
None
None
None
None
None
sed awk
s for substitution sed ‘s/cat/dog/’ #
cat -‐> dog sed ‘s/\(a\)\(b\)/\2\1/’ # ab -‐> ba
p for printing sed –n ‘/dog/p’
# print lines that match ‘dog’ sed –n ‘/start/,/end/p’ # print range
d to delete sed ‘/dog/d’ # delete
lines that match ‘dog’ sed ‘1,/pattern/d’ # delete range
| and –e for invocation sed ‘s/a/A/’ |
sed ‘s/b/B/’ # sed –e ‘s/a/A/’ –e ‘s/b/B/’ #
{ .. } to group the commands sed
‘/pattern/ { s/p/P/ s/e/E/ }’ #pattern -‐> PattErn
r to read a file sed ‘/include/ r
file.txt’ # insert file.txt after include w to write to a file sed ‘/pattern/ w file.txt’ # write matched lines to a file
None
aaa bbb ccc aaa bbb zzz awk
'/zzz/' 1.txt grep zzz 1.txt aaa bbb zzz
awk 'BEGIN
{<initializations>} <pattern 1> {<actions>} <pattern 2> {<actions>} ... END {<final actions>}'
awk 'BEGIN {a=0, b=0}
/aaa/ {a++} /bbb/ {b++} END {printf “%d\t%d”,a,b}'
awk '{arr[$2]+=$1} END {
for (id in arr) printf "%s\t%d\t\n",id,arr[id]}'
@antonarhipov