将第一个文件创建到文件夹中,然后 运行 它 ssh

get first file created into folder and run it ssh

以下命令尝试在文件夹名称 ssh 运行 中创建第一个文件,然后将其删除

find /home/buzzst/public_html/ssh/*.t -printf '%T+ %p\n' | sort -r | head

结果有两个文件,我试着只得到第一个

2017-04-04+12:57:08.7890000520 /home/buzzst/public_html/ssh/1-58707.t
2017-04-04+12:55:01.9810000520 /home/buzzst/public_html/ssh/2-58712.t

正在使用终端 ssh 命令 运行 寻找它

更新

使用此命令

find /home/buzzst/public_html/ssh/*.t  | sort -r | head -n 1

我得到最后一个文件名

/home/buzzst/public_html/ssh/2-58712.t

需要 运行 然后删除文件

我先用 xargs 到 运行,然后用 xargs rm 删除

    find /home/buzzst/public_html/ssh/*.t   -type f    | sort -r | head -n 1   | xargs sh
    find /home/buzzst/public_html/ssh/*.t   -type f    | sort -r | head -n 1   | xargs rm