Random File: Return a random file in a given directory
rf [-afd] [DIRECTORY]
By default, rf
will select a random file from within the current directory, not including hidden files.
Options:
- Run with the -a option to allow hidden files (starting with ".") to be randomly selected as well.
- Run with -f to select a random file, not a directory.
- Run with -d to select a random directory, not a file.
Add a directory on the end of the command to run in any directory other than the current one.
- Add man page.
-r
to select a random file recursively.-i
to take files from standard input (suggest piping with find).- Don't depend on glibc (GNU C). Currently using getopt.
- Randomly select a file in a directory EVEN IF the file contains a space or a newline.
- Add
-a
to allow for accessing hidden files. - Use
-f
to allow for searching of files only. - Use
-d
to allow for searching of directories only.