简体   繁体   English

使用ls命令隐藏不可执行的文件

[英]Using the ls command to hide non-executable files

I'm trying to have a command that will print only the non-executable files sorted by modification time in the current directory.我正在尝试使用一个命令,该命令将仅打印当前目录中按修改时间排序的不可执行文件。

What I have so far is:到目前为止我所拥有的是:

$ ls -lt | grep -i "...x......"

This is printing all of the files in the dir.这是打印目录中的所有文件。 Just starting to learn code, any help would be much appreciated.刚开始学习代码,任何帮助将不胜感激。

The way to go :要走的路:

for file in *; do test -x "$file" || echo "$file"; done

Thanks to not parsing ls output感谢解析ls输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM