Advanced

The Meaning of dot slash for Running an Executable in Linux

Posted by linuxsavvy on · 3 comments
TechNonStop; By Abdullah Chougle
Mail this story
Print this story

This is a short article in which the author explains the meaning of ./ which is often used to run executables in the current directory.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (3)

Quoting:If you prefix the dot and the slash, the absolute path is passed to the shell...


Correct me if I'm wrong but I thought
$ ./filename 
was a relative path and not a absolute path.

It would have been nice if the author would have mentioned the security implications of having your home directory as part of the PATH environment variable.
Yeah, I think the ghist is that if you specify a relative path, then $PATH has no involvement.

Agreed, having '.' in your $PATH is a pretty bad idea, particularly so for root.
smallboxadmin wrote: I thought $ ./filename was a relative path and not a absolute path.


Thanks for the comment - the path is certainly relative to the current directory. I've edited the article accordingly.

I've also included a warning to refrain from adding '.' to the PATH permanently.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post