phpfunk.com


Archive for the ‘bash shell scripting’ Category

bash one liners

Monday, December 12th, 2011

Get a list of URLs for a website using wget: wget -r -nv -nd –delete-after “your-url-goes-here” 2>&1 | sed -n ‘/->/{/URL:/s/.*URL:\([^ ]*\).*/\1/;/^[ ]*$/d;p}’

how to find longest line in a file

Tuesday, September 28th, 2010

Regularly I work with large CSV files and on one occasion had a need to figure out which line was the longest in the file. Of course there should be a one-liner bash script that can do this for us. I started here but none of the posted solutions did exactly what I want. So [...]