LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-23-2005, 02:11 AM   #1
tarja
LQ Newbie
 
Registered: Nov 2005
Posts: 8

Rep: Reputation: 0
Bash script about directories


Hello all,

First time posting here. I hope i'm posting this in the right place. lol

I'm using Bash and i'm in trouble! I'm trying to write a script using Bash to loop through a specific directory and all the subdirectories in it, and then outputing every file in them onto the screen with, possibly the 'ls' command[?] Is there any possible way of accomplishing this?

It would look something like :

User: george/x7
scriptfile
stuff
morestuff

george/x7/junk:
morejunkfiles


also, how would i pipe this thru a 'less' command?

Any help would be greatly appreciated. Thanks!
 
Old 11-23-2005, 04:00 AM   #2
prabuayyappan
Member
 
Registered: Sep 2005
Location: Coimbatore
Distribution: Prabuayyappan
Posts: 32

Rep: Reputation: 15
Try this one

ls -R | less
 
Old 11-23-2005, 06:35 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
Or this, depending on the output you want:

find . -ls | less

Yves.
 
Old 11-23-2005, 01:19 PM   #4
tarja
LQ Newbie
 
Registered: Nov 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you
 
  


Reply



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
finding empty directories with bash Iriel Solaris / OpenSolaris 10 02-18-2016 03:59 AM
Bash, LS, For loops, and whitespaces in directories jhrbek Programming 27 09-22-2010 05:17 AM
Bash - listing directories tarja Programming 8 12-03-2005 04:03 PM
Bash Scripting Directories with Spaces gtwilliams Linux - Software 3 07-06-2005 03:16 PM
Script to run script in multiple directories... seabass55 Linux - General 5 07-06-2004 12:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:06 AM.

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
Open Source Consulting | Domain Registration