在linux命令行中列出文件

Ara*_*han -7 linux command-line

我正在使用 fedora 17,其中我使用命令“ls”列出当前目录下的文件,如下所示。

          [user@test test]# ls
Run Code Online (Sandbox Code Playgroud)

有没有办法在不改变当前目录的情况下列出另一个目录中的文件

我想要这样的东西

         [user@test test]# /usr/lib/ then list the files.
Run Code Online (Sandbox Code Playgroud)

mpy*_*mpy 5

我建议ls --help作为起点:

$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
[...]
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请查看手册页,该页可用于大多数 linux 命令。( man ls).

您的具体问题的答案非常简单,只需使用

ls /usr/lib
Run Code Online (Sandbox Code Playgroud)