439 shaares
38 private links
38 private links
Reminders about some bash syntaxes I never remember :)
Read a file, line by line
while IFS= read -r line; do echo "$line"; done < file.txt
Curl with headers (in request and response)/
curl -i -X POST "http://example.com" -H "header: value" -H "another-header: value"
Cat some files in a folder (adding carriage return) (in a watch)
Here, every files matching folder-*/subfolder/file-*.txt
watch -n 1 'for file in folder-*/subfolder/file-*.txt; do cat $file; echo; done'