To get the full path of a file in Linux, you can use the realpath command. This command resolves the absolute path of a file or directory. Here’s the syntax:
realpath filename
For example, to get the full path of a file named example.txt:
realpath example.txt
Alternatively, you can use the readlink command with the -f option:
readlink -f filename
Both commands will return the absolute path to the specified file, resolving any symbolic links if applicable.