The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to find all the files that contain any of the words present in another file tsanthosh Shell Programming and Scripting 4 05-21-2008 02:29 AM
creating a file with a list hinman UNIX for Dummies Questions & Answers 5 02-06-2007 04:25 PM
Creating User Accounts from a list in file Laila Saif Shell Programming and Scripting 8 12-21-2005 11:23 AM
How one can list only the name of directories present in the directory by using ls co amolpatil54321 UNIX for Dummies Questions & Answers 2 02-01-2004 12:38 PM
ksh: How to get latest file from a list of files in a directory Jayathirtha Shell Programming and Scripting 1 06-24-2003 10:23 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-26-2008
pranavagarwal pranavagarwal is offline
Registered User
  
 

Join Date: Oct 2007
Location: India
Posts: 29
Arrow ls > file - Creating file containing the list of all files present in a directory

Hi All,

I need to create a file which contains the list of all the files present in that directory.

e.g.,

Code:
ls /export/home/user/*.dat > list_file.dat
but what i am getting is:
Code:
$ ls /export/home/user/*.dat > list_file.dat
/export/home/user/*.dat: No such file or directory
But I have the following contents:
Code:
$ ls /export/home/user/*.dat
/export/home/user/a.dat
/export/home/user/b.dat
/export/home/user/c.dat

I am using KSH on a Sun Solaris 5.10 server. Please tell me in case more specifications are required.

Thanks,
Pranav
  #2 (permalink)  
Old 09-26-2008
RahulJoshi's Avatar
RahulJoshi RahulJoshi is offline
Registered User
  
 

Join Date: Aug 2008
Location: PUNE
Posts: 98
ls -1 /export/home/user/*.dat >file1

cat file1 ,u get :
/export/home/user/a.dat
/export/home/user/b.dat
/export/home/user/c.dat
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0