LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 10-24-2007, 02:40 PM   #1
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
Command to display /dir, /dir/sub, /dir/sub/files


Hi,
is there one command which can show every single "thing"(sub directories) under the current directory.

#ls -something /dir
1 3 4

1/a b c
2/ d a b

Like tree kind of command but in ls format.

Thanks.
 
Old 10-24-2007, 02:44 PM   #2
Samotnik
Member
 
Registered: Jun 2006
Location: Belarus
Distribution: Debian GNU/Linux testing/unstable
Posts: 471

Rep: Reputation: 40
ls -something /dir/*
 
Old 10-24-2007, 02:46 PM   #3
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Rep: Reputation: 30
ls -Ra /wherever
 
Old 10-24-2007, 03:43 PM   #4
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
ls -Ra worked fine.


Now can some tell me how filter name out?
Like I only need names to feed to some scripts.
I could use sed or awk.
 
Old 10-24-2007, 07:20 PM   #5
LlNUX
Member
 
Registered: Oct 2007
Location: Sydney, Australia
Distribution: Debian
Posts: 63

Rep: Reputation: 15
Not sure what exactly you want but you can also use find command to search for desired files and then execute script on them. Check find command: Linux commands.
 
Old 10-24-2007, 08:48 PM   #6
hanrelan
LQ Newbie
 
Registered: Jun 2004
Posts: 12

Rep: Reputation: 0
Code:
man ls
It'll give you all the options you'll ever need for listing a directory
 
Old 10-25-2007, 03:04 PM   #7
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by LlNUX View Post
Not sure what exactly you want but you can also use find command to search for desired files and then execute script on them. Check find command: Linux commands.

That is a good idea. Find the directory and apply commands on them.
Thanks.
 
Old 10-25-2007, 03:06 PM   #8
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by hanrelan View Post
Code:
man ls
It'll give you all the options you'll ever need for listing a directory
Dude! I am not THAT new in linux. Have been using it as my primary system for 7 years.
 
Old 10-25-2007, 03:39 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
No offense - but in that case you shouldn't have to ask a
question of that level :}



Cheers,
Tink
 
Old 10-25-2007, 03:57 PM   #10
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by Tinkster View Post
No offense - but in that case you shouldn't have to ask a
question of that level :}



Cheers,
Tink
Well My question was more for getting an idea, then a just a ls command. User LINUX gave me good suggestion.

Thank you all.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compress dir keep file/dir permissions powadha Linux - General 1 11-14-2006 08:07 PM
Display Files Under DIR (Fedora 5) bryanviper Linux - Software 4 10-29-2006 11:15 PM
Q. moving /bin dir files to /dev dir?? Texas_student Linux - Software 2 03-27-2006 12:42 AM
Share configuratin dir (.dir) for 3 accounts on local computer LiNuXkOlOnIe Linux - Software 5 01-08-2006 04:36 AM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 08:54 PM


All times are GMT -5. The time now is 10:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration