Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to change my profile so that I can execute programs in the current directory without ./.

In other words:

$ foo.sh

would accomplish what currently happens with:

$ ./foo.sh

I'm new to linux, so I'm open to hearing about why this is a bad idea, but this is for my personal machine.

share|improve this question
up vote 4 down vote accepted

This is generally considered a very dangerous idea because it introduces the possibility that you will be tricked into executing something thinking it is something else. Say for example that somebody puts an executable named "cd" in /tmp. Being able to run things in the current folder without specifying an explicit path might mean you inadvertently run that script (that could be malicious) as your user while expecting to just cd somewhere else on the system.

That being said you can affect this by adding ./ to your program execution path.

export PATH=$PATH:./

If you put that line in your ~/.profile it should be available in any new shells you open.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.