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 came across this question in an exercise in a UNIX textbook and can't seem to figure it out

share|improve this question

closed as unclear what you're asking by Journeyman Geek, nerdwaller, Tog, Dave M, tapped-out Oct 26 '13 at 0:10

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
its pretty hard to understand what the question is. What's a bar? –  Journeyman Geek Oct 17 '13 at 5:54
    
You'll probably want to give some context to your question. While we can gather you are working in Unix (or reading about it, anyway), that question is very broad as it stands. I'm assuming bar is simply an example for the text, but give more context. Otherwise, you'll probably be closed. –  nerdwaller Oct 17 '13 at 5:57
    
@JourneymanGeek I've typed the question verbatim, as in the textbook, i'm guessing its a file or directory –  anakin Oct 17 '13 at 5:57
    
@nerdwaller yes its probably a file or directory, since its a chapter on File Attributes –  anakin Oct 17 '13 at 5:58

1 Answer 1

up vote 3 down vote accepted

bar is a directory and it contains 10 files/directories in it. One of them is named bar too. ls bar will show the contents of the directory bar.

user@Hostname:~/Desktop$ pwd
/home/user/Desktop
user@Hostname:~/Desktop$ ls
bar  surf  temp  tomato
user@Hostname:~/Desktop$ ls bar
1  2  3  4  5  6  7  8  9 bar 
user@Hostname:~/Desktop$ cd bar/
user@Hostname:~/Desktop/bar$ ls
1  2  3  4  5  6  7  8  9  bar
share|improve this answer
    
I just tried it out manually, yes it works –  anakin Oct 17 '13 at 6:13
    
heh, this seems to be the case, from my testing. Mind of I throw in an example of this as part of your answer? –  Journeyman Geek Oct 17 '13 at 6:18
    
@JourneymanGeek Yea sure, that would be helpful –  anakin Oct 17 '13 at 6:20

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