Question: Suppose there is a bash file named "`uploadme`" in the `/usr/bin` folder.

*I am using that file as a command*, and passing the **file names** as a **command line argument**, in any subdirectory of my home directory.

Suppose I am in the directory directory`/home/John/documents/`. In that directory, there is only one file that exists, named "Hello.txt". I will use the command as:

```
uploadme Hello.txt

```

So, the bash file will get one argument as "Hello.txt", but **I want the full path of the file without mentioning it in the argument.**

How can we do that?

Answer: 
You can use `readlink -f`:

```
readlink -f "$1"

```
If you're trying to get the path to the command, rather than to the file argument, you can use the `which` command. If, inside the scripted command, you want to know where the command is (rather than the current working directory or the full path to a parameter file), you can look at `which $0` (for scripts) or `argv[0]` (for compiled programs).