HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the full path

 
SOLVED
Go to solution
Manuales
Super Advisor

Getting the full path

How to get the full path of a file when i run "ls"?
5 REPLIES
James R. Ferguson
Acclaimed Contributor
Solution

Re: Getting the full path

Hi Manuales:

Specify the absolute pathname for a single file:

# ls -l /etc/rc.config.d/netconf

...or for directory searches:

# find /etc/rc.config.d -type f -exec ls -ld {} +

Regards!

...JRF...
Tingli
Esteemed Contributor

Re: Getting the full path

ls $PWD/*
Manuales
Super Advisor

Re: Getting the full path

how do you avoid getting directories names in the output?
i only need the files....

James R. Ferguson
Acclaimed Contributor

Re: Getting the full path

Hi (again) Manuales:

> how do you avoid getting directories names in the output?
i only need the files....

That's why I used '-type f' with the 'find()'.

Regards!

...JRF...
Mike Miller_8
Regular Advisor

Re: Getting the full path

ls -l -p | grep -v \/