Automation Tool with bash shell

93 Likes Comment
Automation Tool

Linux command for remove duplicate lines in a file

awk '!seen[$0]++' file.txt

Repeat a loop to solve the list

for URL in `cat /tmp/filelist.txt`; do something good; echo $URL" is done " >> /checklist-ok.txt; done

Crawl the url list with http response code

for i in $(seq 1 $END); do out=$(curl -s -o /dev/null --head -w "%{http_code}" -X POST "$i";); echo $i"|"$out >> listposts.txt ; done

Remove blank lines in file

sed '/^$/d' input.txt > output.txt

Delete lines match pattern in text file

sed -i.bak '/pattern to match/d' ./infile

Count how many times a string appear in a cell of excel:

=(LEN(A2)-LEN(SUBSTITUTE(A2, "happy","")))/LEN("happy")


You might like

About the Author: Toc Xoan

This guy likes taking photos, hunting cheap tours, exploring the unique culture of every cities of Vietnam. Contact: [email protected]. I've created a dogecoin wallet to receive blog funding: DE6F5FisSCy7yz5rpHY1ChMSGYnDMpFZ1Q

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.