The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
output of command rup kiranrasane UNIX for Advanced & Expert Users 1 03-27-2008 06:31 AM
if command not having the right output filthymonk Shell Programming and Scripting 9 05-22-2007 10:11 PM
Output of ps -ef command dbrundrett UNIX for Advanced & Expert Users 6 01-06-2005 10:48 AM
Output of ps command ls1429 UNIX for Dummies Questions & Answers 1 02-03-2003 06:40 AM
Output command berty007 Shell Programming and Scripting 4 11-29-2002 01:27 PM

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

Join Date: Jan 2007
Posts: 14
ls command output

Hi,

If I give ls -m /temp/tempusr/P*.* command,
I am getting the list of filenames with comma as delimiter but along with this I am getting the file path as well. i.e I am getting output as

/temp/tempusr/P1.log,/temp/tempusr/P2.log,/temp/tempusr/P3.log etc

Is there a way in which I display only the filenames not the path?

i.e P1.log,P2.log,P3.log etc.

I know I will get the results if I do cd /temp/tempusr and then ls -m P*.*
but the problem is I have to mention the path in ls command. so please suggest an alternate method.

Thanks & Regards
Sheshadri
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-20-2007
Registered User
 

Join Date: Aug 2007
Posts: 14
Quote:
Originally Posted by arsheshadri View Post
Hi,

If I give ls -m /temp/tempusr/P*.* command,
I am getting the list of filenames with comma as delimiter but along with this I am getting the file path as well. i.e I am getting output as

/temp/tempusr/P1.log,/temp/tempusr/P2.log,/temp/tempusr/P3.log etc

Is there a way in which I display only the filenames not the path?

i.e P1.log,P2.log,P3.log etc.

I know I will get the results if I do cd /temp/tempusr and then ls -m P*.*
but the problem is I have to mention the path in ls command. so please suggest an alternate method.

Thanks & Regards
Sheshadri
Try this Code...

Code:
ls /temp/tempusr/P*.* | awk 'BEGIN {FS="/"}{print $4}'
Thanks
Sam..,
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:48 PM.


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