[英]How can I ignore the contents of /proc directory from the output of ls -lR command
我只想使用ls -lR命令列出系统中的所有文件。 但是我不想列出/ proc目录及其子目录,因为它们对我没有用。 但是当我执行ls -lR --ignore proc /时 。 即使它们在proc目录之外,它也会忽略所有文件名proc。 ls -lR --ignore / proc /也不起作用。 有什么办法吗?
您可以将ls
和extglob
一起使用:
shopt -s extglob
ls -lR -I proc@(/*|)
扩展glob模式proc@(/*|)
匹配proc
目录和所有的孩子proc
目录。
只需将grep与-v选项一起使用
ls -lR / | grep -v /proc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.