Tagged Questions

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

2
votes
2answers
52 views

PATH work with relative directories

I'm trying to get a program to work that isn't in my distro's package manager. It doesn't provide a makefile or sources, just binaries. If I copy the whole folder to /usr/local and then add that to ...
3
votes
4answers
374 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 ...
8
votes
4answers
289 views

Why does the “which” command give duplicate results?

which -a ruby gives me /usr/ruby /usr/ruby /usr/ruby It gives the same path three times. Why does this happen?
14
votes
2answers
3k views

Is it safe to add . to my PATH? How come?

I've seen people mention in other answers that it's a bad idea to include the current working directory ('.') in your $PATH environment variable, but haven't been able to find a question specifically ...
2
votes
3answers
475 views

How to make GNU grep the default in FreeBSD?

I'm running FreeBSD 9.1-RELEASE. I've installed GNU grep with portmaster textproc/gnugrep. However the "default" grep for users is still FreeBSD grep. # /usr/local/bin/grep -V /usr/local/bin/grep ...
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 ...
1
vote
3answers
2k views

Cannot find lib in path

I am trying to start a program that relies on some libraries that are in my path, however, the program says it cannot find the files: 11:45:27 ~ > echo $PATH ...
2
votes
2answers
65 views

Why does “User Contributed Perl Documentation” show up when I look for 'man' pages

When I man -f <some string> in addition to the expected Unix man pages, I get a bunch of odd looking entries that all have the header "User Contributed Perl Documentation". For example man ...
1
vote
0answers
39 views

How do the various configuration files determine MANPATH on Darwin?

On Darwin (12.2.0, OS X 10.8.2, bash 3.2.48(1)) my MANPATH appears to be determined by my PATH rather than by the various configuration files associated with man and the man path, /etc/manpaths, ...
2
votes
1answer
290 views

How is the path to search for 'man' pages set?

I'm puzzled by how the path used for finding man pages is set. The "right thing" seems to happen magically. For example, if change my PATH from ...
5
votes
1answer
142 views

Correct handling of Python2 and Python3

What is the correct way running scripts that depend on python2.x but on a system where python3.x is aliased with python. The solution should take into account the following things : Python2 ...
7
votes
3answers
1k views

Is there a way to add a directory to my PATH in zsh only if it's not already present?

Is there an easy way in zsh to add a directory to my PATH only if it's not already present? (or, more generally, any environment variable). I've tried: PATH+=/my/directory ... but if that's ...
8
votes
3answers
494 views

Running an executable in PATH with the same name as an existing function

Sometimes I define a function that shadows an executable and tweaks its arguments or output. So the function has the same name as the executable, and I need a way how to run the executable from the ...
2
votes
2answers
40 views

Applying and linking all settings/binaries of one user to another user in Linux

In a linux machine, we may have to compile our programs with respect to that linux machine. Now, if we already have some other users (not root. A typical user.) who have already compiled many ...
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 ...
6
votes
1answer
153 views

What's the difference between “command directory” and “command directory/”? [duplicate]

Possible Duplicate: When should I use a trailing slash on a directory? Does the slash make any difference?
0
votes
1answer
362 views

Add USB space in conky

I'm setting conky and I'd like to add the usb space, I use: $font${color DimGray}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_free_perc /}% ${fs_bar /} for the full hdd, what should I write ...
2
votes
1answer
3k views

Wallpapers' s folder in XFCE4

I've just installed XFCE4 on Arch Linux, now I'd like to add an image in the wallpaper folder, someone know the full path. I'm searching, but I haven't found yet.
5
votes
3answers
2k views

Create a command for a Linux executable file

I'm using a program called node-webkit, but I can't start the program without specifying the full path to the executable file. Is there any way to associate a command (such as node-webkit) with an ...
1
vote
0answers
378 views

How to install Ruby Test to Sublime Text 2

I am quite new to Ubuntu, so I am running into some problems. I was following this tutorial to install Ruby Tests for Sublime Text 2: https://github.com/maltize/sublime-text-2-ruby-tests There is ...
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 ...
1
vote
1answer
502 views

Can I get correct $PATH when executing sudo -u db2inst -sh “db2”?

I need to run sudo -u db2inst1 sh -c "db2 connect to db; db2 set schema Edumate; db2 \"select * from edumate_settings\"" but I don't want to specify absolute path to db2 If I run sudo -u db2inst1 sh ...
6
votes
3answers
2k views

Added bin directory to my path, can't execute commands in it with 'sudo command'

I made a bin directory in my home folder where I place all my scripts. Then in my .bashrc I added the following: export PATH=$PATH:/home/myusername/bin So I could access files I placed in there ...
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 ...
3
votes
2answers
417 views

Make problem with includes [closed]

I am installing imagick-v3.1.0RC2 package on CentOS 5.5. I have ImageMagick 6.7.9-9 installed as well and have a problem on the make step. Problem is that its cannot find included file: ...
4
votes
2answers
357 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
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 ...
1
vote
1answer
747 views

How to force a particular version of Java?

I am on a RHEL 5.5 64 bit box. The systems engineer installed the 64-bit Java VM under /usr/bin ; however, I needed a 32 bit VM which he installed in /opt/jdk1.6.0_35. But now, everytime I do java ...
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?
7
votes
3answers
991 views

My `which` command may be wrong (sometimes)?

I've compiled the last emacs version from the source code (v24.2) because the version installed on my machine is (quite) old for me (v21.3). I've done the usual: $configure --prefix=$HOME make make ...
2
votes
1answer
1k views

update PATH variable in .bashrc using sed

I've been trying to update my PATH variable permanently by putting it in my .bashrc file. However, I don't want to just append it to the file, but rather replace the current PATH=........ with the ...
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?
6
votes
2answers
3k views

Why Bash unable to find command even if $PATH is specified properly?

I am specifying path to my command in the file /etc/profile: export PATH=$PATH:/usr/app/cpn/bin My command is located in: $ which ydisplay /usr/app/cpn/bin/ydisplay So, when I performing "echo ...
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 ...
10
votes
2answers
343 views

Why do so many programs live in PATH?

One thing that puzzles me about desktop Linux, at least, is that just about everything is in my PATH. By everything, I mean every desktop application, including things like gnome-character-map and ...
8
votes
2answers
7k views

What is the difference between PATH and LD_LIBRARY_PATH?

I am having some difficulties understanding the difference between PATH and LD_LIBRARY_PATH. I have an installation setup that needs a file pkg.tcl and I am not where to add the path to it: should it ...
14
votes
3answers
7k views

How do I get rid of Cygwin's /cygdrive prefix in all paths?

I'm switching to Cygwin from the bash shell that ships with Git for Windows, and encountering a strange problem. Someone thought it would be a good idea to add /cygdrive/ to all paths, while I think ...
0
votes
2answers
738 views

.profile in SCO

Where can I find the .profile in my user's logon in SCO? I am needing to edit it, so I can add a PATH to it, so that my PATH loads up in start up. I have to add: echo $PATH ... as I have already ...
1
vote
2answers
13k views

changing an environment variable like PATH forever [duplicate]

Possible Duplicate: How do I set a user environment variable? (permanently, not session) to change the amount of PATH variable , I use : export PATH=... but when I close the terminal, the ...
1
vote
2answers
17k views

How to set environment variable JAVA_HOME that will be saved on exit? [duplicate]

Possible Duplicate: How do I set a user environment variable? (permanently, not session) I use Suse. First was installed jdk7, so JAVA_HOME remains like: /usr/java/jdk1.7.0_05/ After I ...
2
votes
0answers
442 views

Can I apply real time Linux kernel patch on Android kernel?

I would like to apply real time patch on the Android kernel (given I've found Kernel patch for corresponding Kernel version). Is it possible or should I create a patch specifically for the purpose of ...
1
vote
1answer
194 views

How to find/correct error in a path

It's often that a long path is mistyped or you get a log file entry that a path does not exist. Is there a command or shell function that navigates the path hierarchy until it finds a matching path? ...
2
votes
1answer
382 views

How to use whitespace in procmailrc recipe destination path?

I use Mutt Maildir for storage mails. I created one mailbox like this Stack Exchange/. (whitespace between Stack and Exchange here) procmailrc recipe: :0 * From: .*Stack\ Exchange Stack Exchange/ ...
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 ...
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 ...
1
vote
0answers
514 views

Having a problem installing snort on fedora 17 [closed]

I've installed the latest versions of libpcap and libdnet. There is however a problem with daq. I configured snort with --wth-daq-libraries=/usr/local/lib/daq and --with-libpcap-libraries=/usr/lib ...
22
votes
12answers
4k views

Remove duplicate $PATH entries with awk command

I am trying to write a bash shell function that will allow me to remove duplicate copies of directories from my path environment. I was told that it is possible to achieve this with a one line ...
1
vote
1answer
240 views

Using emacsclient with custom emacs in $PATH

I want to use emacs command as a substitution for emacsclient -c -a "", which according to man connects to an existing emacs daemon, or creates a new daemon and connects to it otherwise. So i created ...
3
votes
3answers
2k views

A system-wide way to set or get $JAVA_HOME in Ubuntu?

I wonder whether Ubuntu itself provides a system-wide way to find the current JAVA_HOME or whether there is right place for setting JAVA_HOME. Mac OS X does well in this, for /usr/libexec/java_home ...
1
vote
1answer
1k views

What is wrong with my JDK installation?

I tried to compile a Hello world example in java and got a gcc error. As far as I understand it, gcc is trying to compile my java class (and for some reason failing to find the main method, but that's ...