
08-20-2007
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 14
|
|
Quote:
Originally Posted by arsheshadri
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..,
|