Finding the absolute path of any file
jc
-
Pseudo -
Pseudo -
How to find the absolute path of any file in Unix?
By running ll -R | grep machin, it does not show where the file is located
thank you
By running ll -R | grep machin, it does not show where the file is located
thank you
Configuration: Windows XP Firefox 2.0.0.1
4 answers
-
Hi,
There is no shortage of possibilities:find / -name "le_fichier" whereis le_fichier which le_fichier type le_fichier locate le_fichier
See the "man" pages for "find, whereis, and which" and the "man bash" for the other 2...
;-))
--
Z'@+...che.JP: Zen, my Nuggets! ;-) Knowledge is only valuable if shared.
-
Hi
thanks for your response, but concerning:
whereis -> it only looks for commands
which -> it only searches in certain directories
with find it's perfect
thanks- Well, for my part, when I type find / -name "mon_fichier"
I do get the absolute path of mon_fichier displayed, but this command also returns many other lines, which does not allow me to retrieve the path of this file to then manipulate it using a variable "the_path_of_my_file"
Thank you for your response.
-
-
-
`pwd` to get the full path of the directory you are in. With an `ls`, a well-placed `grep`, and a bit of string concatenation, you'll achieve your goal.
-
Hello,
whereis -> it only searches for commands
which -> it only searches in certain directories
More specific from shell beginner's usage guide
The difference between whereis and which
* whereis - searches for executable files, source files, and manual pages of a command
* which - searches in the PATH variable for executable files
--
lami20j