Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.
share|improve this question

3 Answers 3

up vote 4 down vote accepted

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
share|improve this answer

Have you tried

ls /usr/lib ?

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.