Use realpath
$ realpath example.txt
/home/username/example.txt
More Related Contents:
- Convert absolute path into relative path given a current directory using Bash
- Detect if PATH has a specific directory entry in it
- What is the most elegant way to remove a path from the $PATH variable in Bash?
- Correct Bash and shell script variable capitalization
- While loop stops reading after the first line in Bash
- Why equal to operator does not work if it is surrounded by space?
- “~/Desktop/test.txt: No such file or directory”
- Capturing Groups From a Grep RegEx
- How to put a line comment for a multi-line command [duplicate]
- Why does “local” sweep the return code of a command?
- Batch renaming files with Bash
- How to generate random number in Bash?
- Delete files older than 10 days using shell script in Unix [duplicate]
- Checking if output of a command contains a certain string in a shell script
- Bash conditional based on exit code of command
- How to make awk ignore the field delimiter inside double quotes? [duplicate]
- Add a bash script to path
- Get just the filename from a path in a Bash script [duplicate]
- Rename multiple files in shell [duplicate]
- Is there a way to make bash job control quiet?
- How do file descriptors work?
- Execute a shell function with timeout
- Convert Unix timestamp to a date string
- When does command substitution spawn more subshells than the same commands in isolation?
- Extract version number from a string
- How do I get both STDOUT and STDERR to go to the terminal and a log file?
- -bash: __git_ps1: command not found
- Use GNU find to show only the leaf directories
- docker entrypoint running bash script gets “permission denied”
- What does `kill -0 $pid` in a shell script do?