List of files in a folder inclusive subfolder


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting List of files in a folder inclusive subfolder
# 1  
Old 11-28-2012
List of files in a folder inclusive subfolder

Hi,

I need to list the names of existing files in a specific folder. I have written a script for that, but the problem is, it is also picking up name of a subfolder that is there in that folder. I need only the list of files and not that subfolder. How to go about that ? Can anyone plz help...
# 2  
Old 11-28-2012
Maybe it will fit your need :
Code:
find . -type f

# 3  
Old 11-28-2012
If you do not want to descend into sub directories:-
Code:
find $DIR/* -type f -prune

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies

2. Shell Programming and Scripting

Need help in finishing a bash script for listing subfolder by size in a large folder

Greetings everyone. I have seen that you do wonders here. I have a large folder on a Ubuntu linux. Organization main folder, inside 20 000 subfolders, and inside those subolders many other like 5-6 folders and files. I am interested to create an output to a txt file under the bash... (2 Replies)
Discussion started by: ultimo
2 Replies

3. UNIX for Dummies Questions & Answers

removing files in a given subfolder

Hello, im new to this forum and directly start with a problem... :) I have a folder structure like : /folder/01/1/oldfiles /folder/01/2/oldfiles /folder/02/1/oldfiles /folder/0x/y/oldfiles Every Month a new folder adds automaticly from the system. Now i need an idea how to search... (6 Replies)
Discussion started by: Hugi
6 Replies

4. Shell Programming and Scripting

Create subfolder within folder in one command

suppose if i am checking folder g as shown below path a/b/c/d/e/f/g ,and some directory c,d,e,f,g not present then is there anyway to create directory in one command or i need to use mkdir for everyfolder (3 Replies)
Discussion started by: lalitpct
3 Replies

5. Shell Programming and Scripting

Link multiple files from different subfolder to a new subfolder

Hi, I have the following subfolder with files: /data/a/1/xxx.txt /data/b/2/yyy.txt /data/c/3/zzz.txt And i have a set of new folders which have exactly the same structure as above but different disk without the files: /data_02/a/1/ /data_02/b/2/ /data_02/c/3/ Now i would like to... (6 Replies)
Discussion started by: total_ysf
6 Replies

6. UNIX for Dummies Questions & Answers

How to Get the count fo files in each subfolder

Hi is there a command to get the count of files inside each sub directory in a directory. example: in a directory like this /opt/:> ls subdir1 subdir2 subdir3 I need to see the count of files in sub directories like this: /opt/subdir1: 3 files /opt/subdir2: 5 files /opt/subdir3: 10... (1 Reply)
Discussion started by: sanjangr
1 Replies

7. Shell Programming and Scripting

Command to view folder subfolder and its capacity

Can any one tell how to view folder and subfolder with its capacity df -k will cannot be used it shows only the parent folder while du -k will show all subfolder and files but not show the capacity and also i dont want view any files Thank you!!!! (1 Reply)
Discussion started by: shivu
1 Replies

8. Shell Programming and Scripting

How to read a subfolder one by one in parent folder?

Hi friends, I am getting some trubles in folder reading. I am having 10 subfolders inside server7 folder. i wanna to read a subfolder name first and check if the foldername gets started with "http". if so , i need to read a file inside that folder. This willl continue for... (1 Reply)
Discussion started by: kamatchirajan
1 Replies

9. Shell Programming and Scripting

How list of files apart from *.class files in certain folder

Hi Friends How to list of all files in a particular directory structure, with out listing a particular file extn. I mean to say in a folder structure I have many files ..I want to list them with out *.class files. Please help Thanks Joy (3 Replies)
Discussion started by: itsjoy2u
3 Replies

10. UNIX for Dummies Questions & Answers

Basic Q: getting list of all files of type within folder & subfolders

A painfully rudimentary UNIX question for somebody. I've been puzzling over this for the last hour but can't find the right command. I'm simply trying to get a list of all files - and their full paths - within a folder & subfolders which have extension .php and .js. That's it! No amount of... (1 Reply)
Discussion started by: AtomicPenguin
1 Replies
Login or Register to Ask a Question