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 \/