I have a process which creates text files whose filenames are based on the timestamp of their moment of creation:
$ ls 1378971222.txt 1378971254.txt 1378971482.txt 1378971488.txt 1378972089.txt 1378972140.txt 1378972141.txt 1378972153.txt 1378972155.txt 1378972241.txt
How might I auto-complete the filename of the latest created file, i.e. the file with the latest mtime? There is no way to use Tab-completion for these files as almost every character in the filename is shared with another file. I am hoping to find a shortcut (such as
Alt . which autocompletes the last argument of last command). I have managed to concoct the following alias which is great for
VIM, but I would love to know if a general-purpose shortcut exists that I could use with
sqlite3, and other applications.
alias lastest="vim `ls -t | grep -vE "^total [0-9]*$" | head -n1`"