<p>I am writing a shell script that takes file paths as input.</p>

<p>For this reason, I need to generate recursive file listings with full paths. For example, the file <code>bar</code> has the path:</p>

<pre><code>/home/ken/foo/bar
</code></pre>

<p>but, as far as I can see, both <code>ls</code> and <code>find</code> only give relative path listings:</p>

<pre><code>./foo/bar   (from the folder ken)
</code></pre>

<p>It seems like an obvious requirement, but I can't see anything in the <code>find</code> or <code>ls</code> man pages.</p>

<p>How can I generate a list of files in the shell including their absolute paths?</p>

If you give
```
find
```
an absolute path to start with, it will print absolute paths. For instance, to find all .htaccess files in the current directory:
```
```
find "$(pwd)" -name .htaccess
```
```
or if your shell expands
```
$PWD
```
to the current directory:
```
```
find "$PWD" -name .htaccess
```
```
```
find
```
simply prepends the path it was given to a relative path to the file from that path.
Greg Hewgill
also suggested using
```
pwd -P
```
if you want to resolve symlinks in your current directory.