Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'd like to show the contents of a folder without first changing into it. for example:

---- Documents
        |
        |
        L_ Essays

If I'm in Documents, how can I show the contents of Essays with a single command?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted
ls Essays/

works from within Documents. A tiny snippet of FreeBSD's ls man page:

 ls [ .... ] [file ...]

DESCRIPTION For each operand that names a file of a type other than directory, ls displays its name as well as any requested, associated information. For each operand that names a file of type directory, ls displays the names of files contained within that directory, as well as any requested, associated information.

share|improve this answer
    
Just add a slash? Really? –  Moshe Feb 9 '12 at 15:44
1  
just ls directory, the slash is not mandatory even, as, in your case, the file Essays is of type directory. –  sr_ Feb 9 '12 at 15:46
    
Oh, I see, so the name of the target directory is what does it. –  Moshe Feb 9 '12 at 15:48
1  
@sr_: the slash is required if the directory is a symbolic (soft) link. –  Hai Vu Feb 10 '12 at 5:59
    
@HaiVu: Thank you, I wasn't aware of this :) –  sr_ Feb 10 '12 at 8:21
add comment

If you want to include the directory name in the listing, too:

find Essays/ -maxdepth 1
share|improve this answer
add comment

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.