PATH (all upper case) is the name of an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are searched for.

learn more… | top users | synonyms

5
votes
1answer
1k views

How to identify executable path with its PID on AIX 5 or more

On AIX 5 or 6, `ps -ef` shows the executable full path randomly. Why and how to determine it? I find many thread through internet and also Unix & Linux and this stack overflow post about finding ...
5
votes
1answer
2k views

Reloading the $PATH from the GUI terminal

My machine is running Fedora 16 x86_64 I am trying to figure out why I can not get my GUI terminal window to refresh the path. I recently added a new location to the path (in .bash_profile), after ...
5
votes
1answer
141 views

Can non-canonicalized forms of filesystem paths be significant? (eg. “foo//bar”, “foo/./bar”, and “foo/../bar”)

I have a script for building a particular flavor of GCC cross-compiler. Throughout the script there are many paths that are not in canonical form, such as duplicate path separators (/xxx/foo//bar/yyy) ...
5
votes
1answer
316 views

zsh - fully expand binary path on <tab>

In my current zsh behaviour, hitting tab after typing "sudo" just adds a space. $ sudo ... What I really want is for the tab to fully expand to the path of the binary it is about to execute when I ...
5
votes
1answer
2k views

Global /etc/profile setenv or export overwriting user settings in .profile

I need to call a modified version of a program in /home/user_name/bin rather than the (older) version in /opt/program_name/current on a CentOS 5.3 cluster. The program creates a tcsh script using ...
4
votes
3answers
3k views

Adding to path vs. linking from /bin

Our sys admin installed a software (Maven) on the server, and told everyone to add the "/usr/local/maven/bin/" folder to their path. I think it could be more convenient to just link the few programs ...
4
votes
6answers
460 views

Will $0 always include the path to the script?

I want to grep the current script so I can print out help and version information from the comments section at the top. I was thinking of something like this: grep '^#h ' -- "$0" | sed -e 's/#h //' ...
4
votes
8answers
269 views

“which” with a little “grep”-like solution?

# which mkdir /bin/mkdir # which mkdi # How can I get the path of the e.g.: mkdir's binary without knowing the name of the binary file? (command). So that which mkdi would output the /bin/mkdir ...
4
votes
3answers
10k views

Adding directory to PATH through Makefile

I'm having some trouble in exporting the PATH I've modified inside the Makefile into the current Terminal. I'm trying to add to the PATH, the bin folder inside wherever the Makefile directory is. ...
4
votes
2answers
429 views

Basic commands in Unix not working i.e: -bash: ls: No such file or directory

I'm new to Unix and in the process of installing a program for my dissertation I must have played with the PATH for the basic Unix commands such as ls. Every time I type ls and the directory name I ...
4
votes
3answers
580 views

Does sudo a command temporarily change $PATH to be the root's?

When running sudo <command> under a user login session, will that change $PATH to be the root's $PATH during the running of sudo <command>? If <command> relies on the user's $PATH, ...
4
votes
4answers
2k views

List all files / binaries in current PATH

Is there an "easy" way of running an "ls -la" style command for listing all files / executable binaries in the current PATH? (I intend to pipe the output into grep, for looking for commands with ...
4
votes
6answers
411 views

List all binaries from $PATH

Is there one-liner that will list all executables from $PATH in bash.
4
votes
2answers
679 views

What does '//' mean in return from `which`

I have an executable script test under the full path /home/sawa/foo/bar/test. The directory /home/sawa/foo/bar is within $PATH, and has priority over the default ones including /usr/bin. When I do ...
4
votes
2answers
10k views

How to export LD_LIBRARY_PATH to all users and system services

I want to export LD_LIBRARY_PATH to system services and all users. System services are run before login, so .bashrc is not applicable. How to achieve this?
4
votes
2answers
2k views

Problem with $PATH and executable file

I am a complete unix noob so please forgive my simple question. I have a unix executable file located in a directory I generated. I believe I need to get this directory in my $PATH so that the unix ...
4
votes
1answer
179 views

Keep getting the same result after “export PATH”

I am doing this: $ which cabal /usr/bin/cabal $ export PATH=$PATH:$HOME/.cabal/bin $ which cabal /usr/bin/cabal I expect to get /.cabal/bin/cabal for $ which cabal (this path exists) after this. ...
4
votes
1answer
56 views

How to update 'command cache' after change of soft links?

I have changed multiple soft links on my system with ln -f -s. When I view the link with ls -l, I see they point to the right target. However, when I try to run the command, it still tries to use the ...
4
votes
4answers
4k views

Running python script from Linux Terminal

I have downloaded this script named, pyAES.py and put it in a folder name codes, inside a Desktop directory of my Linux, According to this example, ...
4
votes
3answers
1k views

Why is PATH reset in a sudo command?

After much frustrating head-brick-wall contact, I've discovered this: $ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/steve/bin $ sudo bash # echo $PATH ...
4
votes
3answers
6k views

How to add a path to system $PATH for all users's non-login shell for debian

After installing some programs in /opt/xxx/bin, I want to add /opt/xxx/bin to system $PATH for all users's non-login shell. What should I do?
4
votes
2answers
5k views

Adding a folder of jar files to my path

Unix newbie here. I have java tools that I need to use. The tools are in a folder full of jar files. I wanted to add this folder to my path, for the obvious reasons, but after I edit my .bash_profile ...
4
votes
1answer
573 views

mpirun fails to recognize program in $PATH

Somehow mpirun fails to acknowledge my $PATH. The program PyroDist, that I have in $PATH, works: $ PyroDist Can't find asked option -in PyroDist - pairwise distance matrix from flowgrams -in ...
4
votes
3answers
289 views

What's the right way to set “dynamic” PATH in bash? (for android sdk)

I have android sdk installed, and I want the binaries in build-tools/android-VERSION to be available in PATH, so I add few lines: ...
4
votes
2answers
1k views

How to add a path to system $PATH for all users's non-login shell and login shell on debian

I installed some programs in /opt/my-program/bin, I wanted to add /opt/my-program/bin to system $PATH for all users's non-login shell and login shell. What should I do? Changing /etc/environment is ...
4
votes
2answers
3k views

Change user and load entire environment in shell script

I'm having some trouble with an upstart script of ours that changes user and starts up a few ruby daemon processes. In the past i would simply bash -c "do the business" -l someuser making sure to use ...
4
votes
3answers
2k views

Add directory to path for all shells and users in SLES 11.1

I'm using a server running Suse Enterprise 11.1. I need to add some locations to the path for all users and for all the shells. Is there a nice and easy way to do this or do I have to modify the ...
4
votes
2answers
361 views

Inhibit Variable Expansion in Paths

How do I prevent Zshell (and Bash I assume) from expanding environment variables in paths be completed as shown in the following example: $PREFIX/alt/li should expand to $PREFIX/alt/lib and not ...
4
votes
1answer
712 views

Why do Mono applications only start from their own directory?

If I want to run the application monodevelop, I need to chdir to /usr/lib/monodevelop/Bin and then execute ./MonoDevelop.exe. This is the same for all other Mono applications such as banshee, tomboy, ...
3
votes
3answers
176 views

Exporting just a single file

To make scripts accessible from anywhere in the terminal, one can use the following sequence of commands: PATH=$PATH:some_path_here export PATH Which includes all files at the path sent in ...
3
votes
1answer
106 views

Why isn't the first executable in my $PATH being used? [duplicate]

I have a script called jsl in /usr/local/bin. Running which jsl finds it there. I want to temporarily use a different version, and when I echo $PATH I see that /usr/bin is earlier in the path. So I ...
3
votes
2answers
1k views

/etc/ld.so.conf doesn't contain /usr/lib

I am using pkg-config to help supply the correct libs during c++ compilation. As I understand it, it searches in directories supplied by /etc/ld.so.conf. My ld.so.conf references the following lib ...
3
votes
4answers
375 views

Decomposition of path specs into longest-common-prefix + suffix

Given any two absolute Unix path specs1, one could decompose each spec as the concatenation of a longest common prefix and a specific suffix. E.g., /abc/bcd/cdf -> /abc/bcd + cdf ...
3
votes
5answers
71 views

search a command in PATH with the same name of the script

For example, my script is $HOME/bin/sudo. I'd like to search for an executable in $PATH with the same name, sudo, and run it - but not the script $HOME/bin/sudo itself, otherwise I will run into an ...
3
votes
2answers
95 views

Recently installed applications missing from $PATH

When I install apps using apt-get or NVM or NPM on Ubuntu, I can type the command and it works. Then I log out of the shell and log back in. Now none of the things I installed work when I ask for ...
3
votes
3answers
351 views

Why can't I call this program using its full path?

I am trying to build a command line wrapper in Python 3 for an exiting command line tool called spooky and I am having a hard time understanding some strange behavior. If I type spooky on the command ...
3
votes
3answers
2k views

Why do 'ssh host echo $PATH' and printing the $PATH after ssh'ing into the machine give different results?

On a particular host, when I ssh into the machine and enter echo $PATH I get /home/wxy/bin64:/home/wxy/bin:/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin and if I ...
3
votes
1answer
59 views

Script not getting executed as per expectation

I have two Perl scripts at a predefined location in Unix. This predefined location is set in path variable ($PATH). Now when i try to run first script (from any location) the script runs successfully ...
3
votes
2answers
250 views

open a file using CDPATH and symlink

To quickly move around, I added a path to CDPATH that contains symlinks to different locations. I did this by adding the following line to .bashrc: export CDPATH=~/symlinks When working with ...
3
votes
2answers
201 views

Finding program name by wildcard pattern

I am trying to write a script that will attempt to find if a certain program is installed. Lets say that the program is called, myprog. The problem is that the program can be named in different ...
3
votes
2answers
1k views

path_helper and zsh

I read that Apple, instead of jamming more and more PATH variable variations to the end of shell profile file, created path_helper binary so that it could expand PATH variable automatically by reading ...
3
votes
2answers
129 views

Basic steps to develop python API in Unix environment

I am developing an API in Unix environment for virtual machines. Most of the modules are developed in python. I have few questions on this. I have the file extension as abc.py. I would like to make ...
3
votes
1answer
1k views

Find location of sourced shell script

Is it possible that a sourced shell script knows its location? I've read determining path to sourced shell script but the answers focus on bash and tcsh and fail if a POSIX shell is used. $0 is also ...
3
votes
1answer
448 views

How to set the path OSX applications use

I'm running Mountain Lion 10.8.4, and have my environment all customized through ~/.profile so that when I run GUI apps like Sublime Text or Eclipse from the command line open /Applications/Sublime\ ...
3
votes
2answers
2k views

(G)VIM uses a different $PATH than my system

Because Ubuntu provides no up-to-date packages for TeXLive, I installed it manually. However, some programs need TeXLive as dependency. So what I did is I installed the TeXLive package from the Ubuntu ...
3
votes
1answer
39 views

Bash ignoring my PATH and it's cache

I have installed pip in my ~/.local/bin/ directory. Here are the outputs of which, type and $PATH $ type pip pip is hashed (/home/bcc/pedros/.local/bin/pip) $ which pip /usr/bin/pip $ echo $PATH ...
3
votes
2answers
955 views

Installed sqlite3 v3.8, but mac terminal still runs old version 3.6 by default

I have a Mac running OS X 10.6.8, which comes pre-installed with SQLite3 v3.6. I installed v3.8 using homebrew. But when I type "sqlite3" in my terminal it continues to run the old pre-installed ...
3
votes
2answers
3k views

How does the path enviroment variable work in linux?

I'm confused how does the enviroment path work under linux, I'm a Linux Mint 15 user. First, I read about editing the /home/.bashrc file and doing a PATH=$PATH:/directory, but I also knew about ...
3
votes
1answer
1k views

ps command not giving output in home directory

I am logging into a solaris server, switching to bash, then switching to another user "sruser" and switching to bash. /home/batch/sruser/ is the home directory of the user "sruser". The issue is ps ...
3
votes
4answers
1k views

Bash script to output path to USB flash memory stick

How would I return (output) the path to any USB flash memory stick(s) connected to the local computer using bash (Ubuntu and Linux Mint)? Background: I'm providing users with an automated backup ...