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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Anton Arhipov
October 01, 2010
Technology
0
68
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
56
Kotlin—the New and Noteworthy in 2.2
antonarhipov
1
23
Levels of AI-assisted programming
antonarhipov
0
87
Devoxx France 2024. Kotlin - the new and noteworthy
antonarhipov
2
78
Harnessing the power of AI in IntelliJ IDEA
antonarhipov
1
210
VirtualJUG: Kotlin 2.0 and beyond
antonarhipov
1
140
Kotlin 2.1: Language Updates
antonarhipov
3
180
Devoxx Belgium 2024 - Kotlin 2.0 and beyond
antonarhipov
2
180
Data Analysis with Kotlin Notebook, DataFrame, and Kandy
antonarhipov
1
120
Other Decks in Technology
See All in Technology
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
410
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.5k
超初心者からでも大丈夫!オープンソース半導体の楽しみ方〜今こそ!オレオレチップをつくろう〜
keropiyo
0
110
MCPでつなぐElasticsearchとLLM - 深夜の障害対応を楽にしたい / Bridging Elasticsearch and LLMs with MCP
sashimimochi
0
170
OpenShiftでllm-dを動かそう!
jpishikawa
0
110
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.8k
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.5k
SRE Enabling戦記 - 急成長する組織にSREを浸透させる戦いの歴史
markie1009
0
110
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
2
200
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Believing is Seeing
oripsolob
1
55
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
93
4 Signs Your Business is Dying
shpigford
187
22k
GraphQLとの向き合い方2022年版
quramy
50
14k
Code Reviewing Like a Champion
maltzj
527
40k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
The browser strikes back
jonoalderson
0
370
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Deep Space Network (abreviated)
tonyrice
0
48
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
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