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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-24-2007, 01:40 PM
|
#1
|
Member
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324
Rep:
|
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.
|
|
|
10-24-2007, 01:44 PM
|
#2
|
Member
Registered: Jun 2006
Location: Belarus
Distribution: Debian GNU/Linux testing/unstable
Posts: 471
Rep:
|
ls -something /dir/*
|
|
|
10-24-2007, 01:46 PM
|
#3
|
Member
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299
Rep:
|
ls -Ra /wherever
|
|
|
10-24-2007, 02:43 PM
|
#4
|
Member
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324
Original Poster
Rep:
|
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.
|
|
|
10-24-2007, 06:20 PM
|
#5
|
Member
Registered: Oct 2007
Location: Sydney, Australia
Distribution: Debian
Posts: 63
Rep:
|
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.
|
|
|
10-24-2007, 07:48 PM
|
#6
|
LQ Newbie
Registered: Jun 2004
Posts: 12
Rep:
|
It'll give you all the options you'll ever need for listing a directory
|
|
|
10-25-2007, 02:04 PM
|
#7
|
Member
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324
Original Poster
Rep:
|
Quote:
Originally Posted by LlNUX
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.
|
|
|
10-25-2007, 02:06 PM
|
#8
|
Member
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324
Original Poster
Rep:
|
Quote:
Originally Posted by hanrelan
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.
|
|
|
10-25-2007, 02:39 PM
|
#9
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
No offense - but in that case you shouldn't have to ask a
question of that level :}
Cheers,
Tink
|
|
|
10-25-2007, 02:57 PM
|
#10
|
Member
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324
Original Poster
Rep:
|
Quote:
Originally Posted by Tinkster
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.
|
|
|
All times are GMT -5. The time now is 07:12 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|