1
vote
1answer
22 views

realpath (GNU coreutils 8.22) does resolve “.” symlink regardless of “-s”

I'm trying to use realpath in a script which has to ensure that it is located under a certain (possibly symlinked) path. Also the script has to be runnable from any location, so it cannot presume that ...
0
votes
0answers
21 views

Add a path in $PATH globally for every user

Do we have anyway to add a path globally so that each user gets it in $PATH. I want to add path of ANT so that each user doesn't need to add it in his $PATH variable.
1
vote
2answers
71 views

How can I list permissions of every component in a file path?

Sometimes it is necessary to determine on which directory in a path access rights are limited. Here is an example: $ ls /sys/kernel/debug/usb/devices ls: cannot access /sys/kernel/debug/usb/devices: ...
0
votes
1answer
426 views

Resetting $PATH in OS X 10.8

I was trying to install jhbuild earlier as part of a GTK+ install, and ran the command alias jhbuild="PATH=gtk-prefix/bin:$PATH jhbuild". Since then, I haven't been able to access many important ...
0
votes
2answers
359 views

How to make scripts run from anywhere on OS X?

I've correctly added my scripts folder to my $PATH. But I still cannot run the scripts from anywhere by simply calling them. How do I achieve this? Example. If I have ~/scripts/ in my path and in ...
1
vote
0answers
224 views

Unix set path not working

I installed a package s2cmd on my unix machine. It works fine when I run it from the folder it resides in, but it did not run from other locations so I set the PATH using the command export ...
1
vote
1answer
47 views

Escaping a directory in a $PATH-like list

I'm developing a wrapper for LibGit2, the Git library. And I come out with a problem: Many GIT functions accept path lists, that is, a string composed of a series of paths separated by a token, that ...
4
votes
4answers
2k views

What is the Unix PATH variable and how do I add to it?

Many programming tutorials ask users to add something to their PATH but don't explain what it is. The existing resources that explain the PATH to users new to the command line are not very good. ...
0
votes
2answers
288 views

Unix list absolute file name

Given an arbitrary single argument representing a file (or directory, device, etc), how do I get the absolute path of the argument? I've seen many answers to this question involving ...
1
vote
0answers
158 views

How do I search/replace symbolic links?

I've been having this issue for a long time, and I don't want to reinstall the whole system, yet. Now there's an app that runs on Java, and it doesn't even open. The logs says some cocoa files were ...
0
votes
1answer
287 views

Using shell script, I need to access a file placed in a location while the script is placed in a different location

I've placed a file in the location /tmp/parent_dir/child_dir/file_1 The script is placed in the location /usr/local/bin/file_load/load_data From this location ...
0
votes
2answers
2k views

Can't access Terminal anymore, only shows a cursor

I run OS X. Following these directions (Installing MySQL on Mac OS X) I added a file to /usr and the contents were PATH=/usr/local/mysql/bin:$PATH Actually I was trying to get the mysql command ...
3
votes
2answers
943 views

Linux: Specifying top level-directory when creating zip archive

I have project with the usual directory structure (src/, bin/, ...), i.e project-name/ |-- bin |-- lib |-- src `-- Makefile And would like to create an archive with the following directory ...
1
vote
1answer
166 views

How do I create a command to run with sudo?

I have created a file called svrestart in /home/gab/bin (which is a folder that should be automatically be added to path on startup) which contains: /etc/init.d/nginx restart /etc/init.d/php5-fpm ...
1
vote
1answer
325 views

What does Eclipse/Java call your homedir? Since ~ and $HOME does not work

When you install Eclipse he always ask me where to put the workspace and here I noticed that Eclipse do not understand normal unix stuff like ~ or $HOME. What does Eclipse/Java call your homedir? ...
1
vote
3answers
6k views

How can I find the path for a given file?

How can I find the directory for a file? In my Unix shell, I know how to use the ls command, but it shows just the name of the file. I need the path too. How do I get it?
3
votes
1answer
6k views

How can I permanently add a path to my bash profile? [duplicate]

Possible Duplicate: How do I set PATH and other environment variables? I would like to put the path of a binary in my bash profile which is not present in the usual location like /usr/bin ...
3
votes
3answers
209 views

Where to put libraries and headers on windows (coming from unix?)

When a unix/linux program requires "stuff", I usually put (or dpkg puts for me) libraries and headers in /usr/lib and /usr/include, respectively. I recently downloaded a library that I wish to use on ...
6
votes
2answers
680 views

Potential issues with adding /usr/local/[s]bin to root's path?

I've noticed that the root account $PATH does not include /usr/local/bin or /usr/local/sbin by default. Are there any potential issues that could arise from adding those directories to the path? If ...
0
votes
4answers
464 views

Changing $PATH variable

I used this to add to PATH: APXS2=/usr/local/apache/bin/apxs PATH=$PATH:/usr/local/apache/bin passenger-install-apache2-module and my PATH now looks like this: ...
3
votes
4answers
4k views

How does unix search for executable files?

When a file is executed, how does UNIX search for it? If there are multiple executable files in PATH with the same name which one is preferred? Is current directory included in the search when file is ...
1
vote
1answer
760 views

Python version priority in OSX/UNIX PATH environment variable

I want my system to use /usr/bin/python, but it's currently using /opt/local/bin/python, which points to /usr/bin/python2.6. I tried modifying the PATH variable in my .bashrc as PATH=~/bin:$PATH ...
2
votes
2answers
5k views

How do I add a location to my path in Unix?

I am new to Unix. I am using a default installation of FreeBSD, with the C shell (csh). Suppose I have a command I can run by executing this: /sbin/abc, but cannot run by executing abc. How can I set ...
1
vote
2answers
344 views

Fail cronjob with /usr/bin/env

I have a script that works perfectly if I execute it from the command line manually. However, when it runs via cron, the job fails with the following error: /usr/bin/env: escript: No such file or ...
3
votes
4answers
252 views

Why is it bad to add '.' to PATH?

I've read one explanation saying it can allow malicious executables that are in the cwd to run in place of similarly named built-ins and core utilities. For something to wreak true havoc, wouldn't ...
45
votes
2answers
22k views

Why does Windows use backslashes for paths and Unix forward slashes?

It annoys me having used Unix in college and now working on the Windows side. What's the history behind this decision? Anyone know why it worked out this way?
0
votes
2answers
783 views

Setting default path in Unix

I just installed valgrind on my Fedora12 machine. $ valgrind // 1 $ valgrind: Command not found. //error $ /usr/local/bin/valgrind // 2 works fine My $PATH has ...
4
votes
2answers
19k views

How do I reset the $PATH variable on Mac OS X?

I've messed up my path variable, and now some apps that I run raise errors saying Command Not Found (error 127) for commands like date and sleep. These commands work fine when executed directly in the ...
1
vote
6answers
885 views

Is there a POSIX pathname that can't name a file?

Are there any legal paths in POSIX that cannot be associated with a file, regular or irregular? That is, for which test -e "$LEGITIMATEPOSIXPATHNAME" cannot succeed? Clarification #1: pathnames By ...
1
vote
1answer
994 views

Basic *nix Question (Mac OS X): Where is my path being set?

I have a path that starts like this PATH=/opt/subversion:/usr/bin:/bin:/usr/sbin:/sbin [etc] and this is wrong (at least opt/subversion needs to be opt/subversion/bin). Where is this being set? I ...
1
vote
3answers
949 views

How can I prevent macports from taking over my PATH?

How can I prevent macports from taking over my PATH? I still want to have the installed software show up, but I want things in the standard system paths (/bin, /sbin, /usr/bin, ...) to have precedence ...
3
votes
3answers
964 views

How to uninstall preinstalled UNIX software on Mac OS X?

Hey i want to uninstall some applications shipped with Mac OS that are a part of UNIX. My plan is to uninstall most of the default stuff to install it via Macports. That would make upgrading, ...
19
votes
4answers
7k views

which/whereis differences

What's the difference between which and whereis ?