0
0

More than 3 years have passed since last update.

直近で作成した1ファイル(.zip または .gz)のファイル名のみを検索する

Posted at
[root@testhost tmp]# ls -l *.zip *.gz
-rw-r--r--. 1 root root 21182 11月  9 10:44 20191109_testhost_systemlog.tar.gz
-rw-r--r--. 1 root root   436 11月 17 06:31 20191117_testhost.zip
-rw-r--r--. 1 root root   124 11月 17 06:08 20191117_testhost_systemlog.tar.gz
[root@testhost tmp]# find /tmp \( -name "*.gz" -or -name "*.zip" \) | xargs ls -tr | gawk -F/ '{print $NF}' | tail -1
20191117_testhost.zip
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0