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
Levels of AI-assisted programming
antonarhipov
0
26
Devoxx France 2024. Kotlin - the new and noteworthy
antonarhipov
2
29
Harnessing the power of AI in IntelliJ IDEA
antonarhipov
1
150
VirtualJUG: Kotlin 2.0 and beyond
antonarhipov
1
110
Kotlin 2.1: Language Updates
antonarhipov
3
120
Devoxx Belgium 2024 - Kotlin 2.0 and beyond
antonarhipov
2
160
Data Analysis with Kotlin Notebook, DataFrame, and Kandy
antonarhipov
1
75
Kotlin 2.0 and Beyond
antonarhipov
2
240
Kotlin Standard Library Gems
antonarhipov
2
510
Other Decks in Technology
See All in Technology
American airlines ®️ USA Contact Numbers: Complete 2025 Support Guide
airhelpsupport
0
380
事業成長の裏側:エンジニア組織と開発生産性の進化 / 20250703 Rinto Ikenoue
shift_evolve
PRO
2
21k
React開発にStorybookとCopilotを導入して、爆速でUIを編集・確認する方法
yu_kod
1
270
Claude Code に プロジェクト管理やらせたみた
unson
6
4k
LangSmith×Webhook連携で実現するプロンプトドリブンCI/CD
sergicalsix
1
230
2025 AWS Jr. Championが振り返るAWS Summit
kazukiadachi
0
110
Core Audio tapを使ったリアルタイム音声処理のお話
yuta0306
0
190
タイミーのデータモデリング事例と今後のチャレンジ
ttccddtoki
6
2.4k
Reach American Airlines®️ Instantly: 19 Calling Methods for Fast Support in the USA
flyamerican
1
170
Beyond Kaniko: Navigating Unprivileged Container Image Creation
f30
0
130
怖くない!はじめてのClaude Code
shinya337
0
400
Backlog ユーザー棚卸しRTA、多分これが一番早いと思います
__allllllllez__
1
150
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
695
190k
Adopting Sorbet at Scale
ufuk
77
9.5k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Statistics for Hackers
jakevdp
799
220k
A Tale of Four Properties
chriscoyier
160
23k
The Invisible Side of Design
smashingmag
301
51k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
950
Site-Speed That Sticks
csswizardry
10
690
How to Ace a Technical Interview
jacobian
278
23k
Building Applications with DynamoDB
mza
95
6.5k
We Have a Design System, Now What?
morganepeng
53
7.7k
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