Listing files with the path in Bash

Saturday, March 1st, 2008

This little script will print a list of the current files in a directory, prefixed with the full path: #!/bin/sh curdir=`pwd` if [ $# -eq 1 ] then usrdir="$1" ls | xargs -I % echo `pwd`/% | sed -e s!$usrdir!! else ls | xargs -I % echo `pwd`/% fi You can optionally provide an initial part of the path to ...

Split and Rename text files from the Bash command line

Tuesday, February 26th, 2008

I occasionally read text files (usually downloaded from the Gutenberg Project) on my mobile phone. This is not the best user experience, but bearable and very useful at times. The most annoying issue is the incredibly slow management of very large text files (sometimes greater than 1Mb) that my ...