연휴 기간동안 gee라는 도구를 만들었습니다. tee랑 비슷한 도구이고 추가적인 기능들이 포함된 tee라고 생각하시면 됩니다. 오늘은 간단하게 gee에 대해 소개할까 합니다.
It is the current holiday season in South Korea. I had some time during that period, so I made and released simple tools focusing on the functions I needed. It’s gee.
What is gee?
Gee is tool of stdin to each files and stdout. It is similar to the tee command, but there are more functions for convenience. In addition, it was written as go
How to install?
go get github.com/hahwul/gee
brew tap hahwul/gee
brew install gee
Contacted snapcraft team because there is a user who has already occupied the gee name.
(but not published package…😭)
Usage: gee [flags] [file1] [file2] ...
(If you do not specify a file, only stdout is output)
Append mode for files
Chuked files from line (e.g output / output_1 / output_2)
Distribution to files
Find string in line (colorize red)
Change output format (json, md-table, html-table) (default "line")
Match with Regular Expression (like grep)
Unmatch with Regular Expression (like grep -v)
Replace string in line with '-find' option
Split string within line. (to line , to table, to md-table)
Version of gee
With line number (colorize blue)
With timestamp (colorize blue)
Make curl request with
cat urls | gee -prefix "curl -i -k " -suffix " -H 'Auth: abcd'" curls.sh
curl -i -k https://www.hahwul.com/?q=123 -H 'Auth: abcd'
curl -i -k http://testphp.vulnweb.com/listproducts.php?cat=asdf&ff=1 -H 'Auth: abcd'
curl -i -k https://xss-game.appspot.com/level1/frame -H 'Auth: abcd'
-find) and Replace(
cat raw.txt | gee -find keep-alive
cat raw.txt | gee -find keep-alive -replace close
Specify the maximum length of the file and save it in multiple files. (with
wc -l http.txt
cat http.txt | gee -chunked 500 output
Distribute each line sequentially to multiple files. (with
wc -l http.txt
cat http.txt | gee -distribute alice.txt bob.txt charlie.txt