我有一个目录,我想在其中列出所有内容(文件和子目录)而不显示符号链接。我在 Linux 上使用 GNU 实用程序。该ls
版本是8.13。
例子:
完整目录列表:
~/test$ ls -Gg
total 12
drwxrwxr-x 2 4096 Jul 9 10:29 dir1
drwxrwxr-x 2 4096 Jul 9 10:29 dir2
drwxrwxr-x 2 4096 Jul 9 10:29 dir3
-rw-rw-r-- 1 0 Jul 9 10:29 file1
-rw-rw-r-- 1 0 Jul 9 10:29 file2
lrwxrwxrwx 1 5 Jul 9 10:29 link1 -> link1
lrwxrwxrwx 1 5 Jul 9 10:30 link2 -> link2
Run Code Online (Sandbox Code Playgroud)
我想得到什么
~/test$ ls -somthing (or bash hack)
total 12
dir1 dir2 dir3 file1 …
Run Code Online (Sandbox Code Playgroud)