列出除以外的所有文件的命令. (点)和..(点) [英] Command to list all files except . (dot) and .. (dot dot)
本文介绍了列出除以外的所有文件的命令. (点)和..(点)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试找到一个列出所有文件(包括隐藏文件)的命令,但必须排除当前目录和父目录.请帮忙.
I'm trying to find a command that would list all files (including hidden files), but must exclude the current directory and parent directory. Please help.
$ ls -a \.\..
推荐答案
阅读 ls(1)文档(也许使用man ls
).至少要养成尝试的习惯
Read ls(1) documentation (perhaps with man ls
). At least, take the habit of trying
ls --help
或更好(因为ls
可能是别名,例如在您的~/.bashrc
中)
or better yet (since ls
might be aliased, e.g. in your ~/.bashrc
)
/bin/ls --help
您将从以下内容开始:
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
-b, --escape print C-style escapes for nongraphic characters
等...
您想要ls -A
或更好的/bin/ls -A
(不包含的任何其他自变量,例如.*
)
You want ls -A
or better yet /bin/ls -A
(without any additional argument such as .*
)
这篇关于列出除以外的所有文件的命令. (点)和..(点)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文