-7

I am using fedora 17 in which i am using the command "ls" to list the files under the current directory as follows.

          [user@test test]# ls

Is there any way to list files in another directory without changing the current directory

I want something like this

         [user@test test]# /usr/lib/ then list the files.

3 Answers 3

5

I recommend ls --help as a starting point:

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

For more information have a look into the man pages, which are available for most of the linux commands. (man ls).

The answer to your specific question is astonishing simple, just use

ls /usr/lib
4

Have you tried

ls /usr/lib ?

Is there a reason why that doesn't work, or am I missing something?

0

use

ls /usr/lib

as suggested above you can start by using man as man ls it will give you explanation of many linux commands

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .