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
64
Practical unix utilities for text processing
Anton Arhipov
October 01, 2010
Tweet
Share
More Decks by Anton Arhipov
See All by Anton Arhipov
Devoxx France 2024. Kotlin - the new and noteworthy
antonarhipov
1
21
Harnessing the power of AI in IntelliJ IDEA
antonarhipov
1
110
VirtualJUG: Kotlin 2.0 and beyond
antonarhipov
1
100
Kotlin 2.1: Language Updates
antonarhipov
3
110
Devoxx Belgium 2024 - Kotlin 2.0 and beyond
antonarhipov
2
150
Data Analysis with Kotlin Notebook, DataFrame, and Kandy
antonarhipov
1
63
Kotlin 2.0 and Beyond
antonarhipov
2
220
Kotlin Standard Library Gems
antonarhipov
2
500
Ktor Workshop
antonarhipov
1
140
Other Decks in Technology
See All in Technology
転職したらMCPサーバーだった件
nwiizo
13
9.2k
ゆるくはじめるSLI・SLO
yatoum
1
110
2025年8月から始まるAWS Lambda INITフェーズ課金/AWS Lambda INIT phase billing changes
quiver
1
1.1k
Next.jsと状態管理のプラクティス
uhyo
6
2.3k
MagicPod MCPサーバー開発の裏側とAIエージェント活用の展望
magicpod
0
280
猫でもわかるS3 Tables【Apache Iceberg編】
kentapapa
2
250
DynamoDB のデータを QuickSight で可視化する際につまづいたこと/stumbling-blocks-when-visualising-dynamodb-with-quicksight
emiki
0
170
AIフレンドリーなプロダクト開発を目指して 〜MCPを橋渡しにした環境移行〜
shinpr
0
120
Terraform にコントリビュートしていたら Azure のコストをやらかした話 / How I Messed Up Azure Costs While Contributing to Terraform
nnstt1
1
560
LangfuseではじめるAIアプリのLLMトレーシング
codenote
0
200
Amplifyとゼロからはじめた AIコーディング。失敗と気づき
mkdev10
1
160
WindowsでGenesisに挑戦した話
natsutan
0
120
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Automating Front-end Workflow
addyosmani
1370
200k
Facilitating Awesome Meetings
lara
54
6.4k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
33k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
The Pragmatic Product Professional
lauravandoore
33
6.6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
800
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
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