Blog Archives

List all files recursively with absolute path names

Sometimes you need a list of all files within a directory and its sub-directories. This is useful i.e. for a .m3u file.

# find /parent-path -type f | grep -v m3u | sort > something.m3u

The command lists all files, removes all “m3u” files (which could be generated by an audio ripper) and sorts the lines by name.

Finding a file containing a particular text string

To find a text within all files of a directory use the following command:

grep -H -r "needle" /hay/stack