2017年5月18日 星期四

[Linux 常見問題] Show only filename, date and size

Source From Here
Question
How can I in linux to get a listing of filenames date and size only. I don't need to see the other info such as owner or permission. Is this possible?

How-To
Command stat will help:
# ls -hl test.sh
-rwxr-xr-x 1 root root 120 May 13 10:45 test.sh

// -c, --format=FORMAT: use the specified FORMAT instead of the default
// Format %y: Time of last modification
// Format %s: Total size, in bytes
// Format %n: File name

# stat -c "%n %s %y" test.sh
test.sh 120 2017-05-13 10:45:35.484211409 +0800


沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...