Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 11-23-2005, 03:11 AM   #1
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


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

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

Rep: Reputation: 15
Try this one

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

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

find . -ls | less

Old 11-23-2005, 02:19 PM   #4
LQ Newbie
Registered: Nov 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you


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

All times are GMT -5. The time now is 09:42 AM.

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