How to Time Piped *nix Commands
If you want to time how long a piped bash command take, use the `time` command followed by your commands in parens like so.. time (ls -lha | wc -l)
Written by Sean Behan on 12/11/2017
Find a File On Your File System with the Unix Find Command By Extension
find path/ -name *.txt
Written by Sean Behan on 11/05/2013
How to Create A Unix Timestamp or the Epoch in Python
It's a little convoluted. Seeing as it's a pretty common thing you use when programming computers one might think that there would be a quick and easy method for it. But from what I can tell there isn't. So here is a snippet that will give you a *nix Epoc...
Written by Sean Behan on 11/02/2013
How to Split a Large File Into Smaller Files on OSX or Unix
Use the split command. split -l 1000 name-of-file output/directory You can set the number of lines (the "-l" flag) to split on and also the location of where the split files should be saved. Note, the output directory must already exists....
Written by Sean Behan on 10/08/2013
Using Grep To Find or Match All Links in an HTML Document
egrep -or "(http(s)?://){1}[^'\"]+" path/to/directory You can further reduce to just return the images by piping again. grep -r src views/ | egrep -o "(mailto|ftp|http(s)?://){1}[^'\"]+" The -r flag is for a recursive directory scan....
Written by Sean Behan on 09/15/2013
Recursively Search Contents of a File with Grep
The -r flag is for recursive, meaning it will also look in sub directories. The -i flag is for case insensitivity, meaning WORD and word will both be found. grep -ir "search term" directory/path
Written by Sean Behan on 08/29/2013
Uncompress A Bz2 File Using Tar Command
Uncompress a bz2 file using tar command tar --use-compress-program bzip2 -xvf your-file-to-uncompress.tar.bz2 @source http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html...
Written by Sean Behan on 06/17/2012