Or you'll get the first file in the oldest directory containing BOT in its name (assuming no file whose name contains BOT is older)ls -td *BOT* | head -1
This still has the possibility of returning a directory name though. Under Unix, this still is a file, although when people say "file", they usually want to exclude directories.
In reply to Re^3: Finding Oldest File in a Directory
by Perl Mouse
in thread Finding Oldest File in a Directory
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |