Possible Duplicate:
bash/fish command to print absolute path to a file
Say I'm in a directory /usr/temp/foo
, which has a file named bar.txt
How do I get the fullpath of bar.txt
? (which should be /usr/tem/foo/bar.txt
)
Possible Duplicate:
bash/fish command to print absolute path to a file
Say I'm in a directory /usr/temp/foo
, which has a file named bar.txt
How do I get the fullpath of bar.txt
? (which should be /usr/tem/foo/bar.txt
)
Try:
readlink -f bar.txt
Extra text to make SO happy.
realpath
isn't by default on my mint machine. I figured readlink
as part of the GNU tools, would be more common.
Commented
Sep 16, 2012 at 20:36
readline -f *.c
(all C-source files), but it didn't seem to work?
Commented
Sep 17, 2012 at 0:01
find . -name '*.c' -exec readlink -f {} \;
Commented
Sep 17, 2012 at 0:04
echo /usr/temp/foo/bar.txt
...?echo pwd ...
for all 1000 of thosebash
already has a variable$PWD
that stores the current working directory.