The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to print the files names that being searched umen Shell Programming and Scripting 2 12-25-2007 10:49 PM
search for the contents in many file and print that file using shell script cdfd123 Shell Programming and Scripting 3 10-07-2007 07:17 PM
compare 2 file and print difference in the third file URG PLS evvander Shell Programming and Scripting 3 09-24-2007 03:52 AM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 01:25 AM
Need to print file names in a certain date range using ls Shamwari UNIX for Dummies Questions & Answers 2 10-08-2001 04:14 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-09-2007
Registered User
 

Join Date: Feb 2007
Location: Bangalore
Posts: 105
[Urgent]how to print the file names into a txt file???

HI,

I have a folder with some 120 files...i just want to print all the file filenames(not the content or anything else) onto a file say .txt.

please help me with this command

Thanks a lot.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-09-2007
Registered User
 

Join Date: Jan 2004
Posts: 17
Code:
cd directory; find . -type f > file.txt
Reply With Quote
  #3 (permalink)  
Old 03-09-2007
Registered User
 

Join Date: Sep 2006
Posts: 1,423
Code:
ls -1 > file.txt
Reply With Quote
  #4 (permalink)  
Old 03-09-2007
cfajohnson's Avatar
Registered User
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 449
Quote:
Originally Posted by kumarsaravana_s
I have a folder with some 120 files...i just want to print all the file filenames(not the content or anything else) onto a file say .txt.
Code:
printf "%s\n" * > txt
Reply With Quote
  #5 (permalink)  
Old 03-09-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Code:
echo * > file
Reply With Quote
  #6 (permalink)  
Old 03-09-2007
Am not alone now!!!!
 

Join Date: Feb 2007
Location: Cochin, India
Posts: 242
find <directory> -type f -maxdepth 1 -print >temp_file
Reply With Quote
  #7 (permalink)  
Old 03-10-2007
srikanthus2002's Avatar
Registered User
 

Join Date: Sep 2006
Location: Can u guess...!
Posts: 160
Quote:
Originally Posted by anbu23
Code:
echo * > file
anbu23,,,,

good to know above command

can we know what it does(logic)...pls
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0