The tag has no wiki summary.

learn more… | top users | synonyms

69
votes
8answers
74k views

how to set global PATH on OS X?

I'd like to append to the global PATH variable on OS X so that all user shells and GUI applications get the same PATH environment. I know I can append to the path in shell startup scripts, but those ...
29
votes
4answers
72k views

Adding a directory to $PATH in CentOS?

We just got our new server(s) up and we're running CentOS on them all. After successfully installing Ruby Enterprise Edition, I would now like to add the REE /bin (located at ...
22
votes
2answers
11k views

How to keep the full path with rsync?

When backing up with rsync, How do I keep the full directory structure? For example, the remote server is saturn, and I want to backup saturn's /home/udi/files/pictures to a local directory named ...
19
votes
4answers
68k views

Get directory containing the currently executed batch script

I use %0 in batch file to get the containing directory of the batch file but the result is :- c:\folder1\folder2\batch.bat I want just directory, without batch file name, like this :- ...
9
votes
2answers
4k views

Environment Variables in PATH Not Expanded for non-Admin Command Prompt?

I have a Windows 7 machine which, when Command Prompt is run by a normal user, fails to expand environment variables in the %PATH%. If command prompt is instead run as administrator (right click, Run ...
8
votes
2answers
12k views

Windows Server 2012 GUI went missing after removing Active Directory

I'm sorry but i'm stuck in figuring out a problem i'm facing here. I removed the AD feature from server manager and after rebooting, my server 2012 gui wasn't there anymore. There's only command ...
7
votes
3answers
9k views

why can't macports find make

I am trying to run macports like thus: port install php5 When I do so, however, I get this error: Error: Unable to open port: can't read "build.cmd": Failed to locate 'make' in path: ...
7
votes
1answer
663 views

Can't find binary, but path included in $PATH

So I tried to install Mercurial on Ubuntu 10.04. First I used the ppa repo, but got a pythonpath error, which I gave up on. Next try was install from source, everything went well, except it can't find ...
6
votes
2answers
602 views

How to change back to previous path quickly?

This is a basic linux question I think, but I really want to know. For example, currently I am in /usr/bin: [x@localhost bin]$ pwd /usr/bin [x@localhost bin]$ cd / [x@localhost /]$ Now I want to ...
6
votes
5answers
23k views

How can I modify a user’s PATH environment variable without logging out?

The question pretty much says it all; I have users who do not have permission to edit their own PATH environment variable and if they need to have it modified for some reason, they need to log out so ...
5
votes
2answers
9k views

CentOS /usr/local/lib system wide $LD_LIBRARY_PATH?

I install custom software in /usr/local/lib. How do I set the PATH and LD_LIBRARY_PATH in CentOS 6 system-wide to use /usr/local/lib. I realize there may be more than one way. What's the simplest and ...
5
votes
1answer
242 views

remount /tmp for the current shell

I have a command which is hard-coded to use /tmp as its working directory. /tmp is rather small, and the command is certain to fill it up, which will cause problems for other system processes. I ...
5
votes
3answers
5k views

How does one escape the “ ` ” (accent grave/backtick) in a path?

I tend to prefix oft-used files and folders with the "accent grave" character (non-shift tilde, the back-tick, or plain-old accent, whathaveyou..), as it is easy to get at, and let's me sort things ...
5
votes
2answers
4k views

Windows: How do I add a program to the system's path environmental variable from the command line?

I'm looking to permanently add a directory to the %PATH% environmental available on a large number of Windows machines. Is there any way to do this from a command line (cmd) so I can script up a ...
5
votes
3answers
9k views

Window 256 characters path name limitation

after a long research, I finally found out that pathnames cannot be longer than 256 characters even in the latest Microsoft Windows 7. I really don't get it why there is such a stupid limitation, ...
5
votes
2answers
4k views

ErrorDocument in .htaccess, is it possible to use relative path?

This doesn't work: ErrorDocument 401 ../../src/wrong_pwd.php it renders the path as text, it really prints ../../src/wrong_pwd.php and doesn't output the real file. If I put the absolute ...
4
votes
3answers
612 views

Why is my $PATH variable for root different when I use su root

When I was trying to run chkconfig as an ordinary user (on CentOS 5) I realized that I could not access it because the directory, sbin, is not in my $PATH. When I su to root it still doesn't work. I ...
4
votes
5answers
2k views

Prune duplicate entries from PATH variable

I modify my .bashrc frequently and then source it. However, when I have things like export PATH="~/bin:~/perl5/bin:$PATH" in my file, then the PATH environment variable grows every time I source the ...
4
votes
2answers
216 views

Is `which` lying to me?

I installed git via apt-get, but found that the version was hopelessly outdated, so I then installed git from source. The end result is rather puzzling: $ git --version git version 1.7.0.4 $ which ...
4
votes
1answer
2k views

Make IIS see updated environment PATH variable

We've installed Oracle Express on a Windows 2003 Server and in the process it updated the PATH. We're trying to get IIS to see this change in the PATH but we can't figure it out. We've recycled the ...
4
votes
3answers
10k views

How do I set the global PATH environment in a batch file?

The group policy in our environment overwrites the PATH variable every time I log on and, as I run a 'non-standard' computer, it gets it completely wrong (C:\Windows vs C:\WINNT, missing directories ...
4
votes
1answer
3k views

IIS 7.5 (Express) applicationhost.config: Can a virtualDirectory's physicalPath be a relative path?

I'm configuring a site in applicationhost.config for IIS 7.5 Express: <site name="default" id="1" serverAutoStart="true"> <application path="/"> <virtualDirectory path="/" ...
4
votes
2answers
3k views

pkg-config on Mac Doesn't find Libraries

I have been installing a bunch of libraries lately from the GNOME sources on Mac. They use pkg-config. Every time I run a configure, it complains that it can't find library XYZ, which I installed to ...
4
votes
2answers
194 views

Preventing bash tab completion of an environment variable with a FS path value from removing the environment variable name

Friends, I am using GNU bash as my shell on Linux: $ bash --version GNU bash, version 4.2.45(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU ...
3
votes
4answers
395 views

How to avoid the ./ when executing a shell script?

I used to know a way to run my shell scripts just by typing there name as long as there were in my home folder or desktop. I hate having to type ./myscript.sh. I would like to be able to type just ...
3
votes
2answers
1k views

Running a program remotely with SSH, but it won't use my .bashrc and the PATH is wrong

I'm trying to run a command remotely with SSH, but my problem is that when I do that, my .basrhc doesn't get executed, and so the PATH is all wrong and my script is breaking. What I'm doing is ssh ...
3
votes
2answers
798 views

Where to set JAVA_HOME in Ubuntu

I am trying to configure Tomcat to know where JAVA_HOME is. I am used to Windows :) ...which file should I edit to add the Java info, and where is it located?
3
votes
2answers
2k views

Changing PATH Environment Variable for all Users. (Ubuntu)

I recently compiled Ruby Enterprise Edition (REE) on an Ubuntu 8.04 server. I would like to update my PATH to ensure this new version of Ruby (found in /opt/ruby_ee/bin) supersedes the older version ...
3
votes
3answers
4k views

Escaping spaces in a remote path when using rsync over a remote SSH connection

When using SSH to connect rsync to a remote server, how do you escape spaces and such in the remote path? A simple backslash escapes the space for the local bash prompt, but on the remote machine the ...
3
votes
1answer
2k views

PATH issues for init.d scripts on startup

I have a simple script that starts up a unicorn instance (on Ubuntu 12.04LTS). #!/bin/sh case "$1" in start) echo "starting" cd /path && bundle exec unicorn -c ...
3
votes
1answer
708 views

How do you use environment variables, such as %CommonProgramFiles%, in the PATH and have them recognized by services.exe?

I'm trying to add C:\Program Files\Common Files\xxx\xxx to the system PATH environment variable by appending %CommonProgramFiles%\xxx\xxx to the existing path. After rebooting, I open a command ...
2
votes
5answers
245 views

Run compiled c program from any location

Quick question. After compiling a program, I always have to explicitly tell it to run from the current directory by prepending ./ to the name. For example $ ./testprog -argument1 Is there a way to ...
2
votes
2answers
177 views

Using 'which' command in cron job

I have a cron job that runs once a day on a Linux server and in the script it executes there is a test: # Validate ffmpeg is installed if [ $(which ffmpeg | grep -c "ffmpeg") -eq 0 ]; then echo ...
2
votes
3answers
3k views

IP address of virtual server?

I have a virtual server (shared hosting), with a domain name (and several sub-accounts, each one a separate site also with its own domain name) I was wondering if there was a way to find out the IP ...
2
votes
3answers
3k views

Error - Unable to find `dot` command of the GraphViz package

Ubuntu precise (12.04.1 LTS) I'm rather new to PEAR. I installed PEAR. Then, using pear I installed phpdoc. It seems to be working great except for the graphing functions. I ran this command: ...
2
votes
3answers
388 views

How should I protect against relative paths in urls that try to access files outside of the served directories?

How can I make sure I am protected against relative paths like: ...
2
votes
1answer
215 views

Is is better to edit the paths file or exporting PATH in .bashrc/.bash_profile?

I have noticed that almost every website tells you to add something like export PATH=/usr/local/share/python:$PATH in your .bashrc or .bash_profile when modifying a PATH. When you want to know what ...
2
votes
2answers
107 views

Powershell - can I avoid typing .\ if I want to execute something from the current folder?

I'm trying to switch from cmd.exe to Powershell, but I'm very annoyed by the fact that if I try to execute something from the current folder, I have to type .\ before it, just like in Linux. Is there ...
2
votes
7answers
485 views

How do I figure out which file is being executed?

I have two files: abc.exe and abc.cmd - both along the path somewhere. abc.exe is a command-line utility. abc.cmd is a wrapper around abc.exe. When I type "abc" in the command prompt, how can I ...
2
votes
3answers
108 views

how to get [ current_path ] in shell bash prompt?

Is it possible to have the name of the current working directory in the prompt in shell ? Im working on OSX and CentOS in multiple projects under /srv/... and a mistake for wrong directory is quickly ...
2
votes
2answers
314 views

Apache Error Log - “Web Path” instead of Filesystem Path

I'm running Apache on Linux and I'm using OpenSSH to provide SFTP access to some customers so they can upload their pages and also look at their respective site logs (access & error). I'm using ...
2
votes
1answer
52 views

Command Line Script Issue

I've been working on a batchfile script for a few weeks now that should automate certain routine tasks I need to perform during my work. However, I've stumbled upon a problem which I haven't been able ...
2
votes
2answers
48 views

Unix how to determine if a program can be executed

I am writing a script to create the source environment. Handling the PATH part is easy. Though how should I check if a program can be executed correctly when its path is added into PATH? Using which ...
2
votes
1answer
1k views

Robocopy uses relative path for Source and Destination paths

I'm trying to use RoboCopy in my TFS Build Template to copy some files, but for some reason it inserts "C:\Windows\system32" in front of my Source and Destination paths, even though I am passing in ...
2
votes
4answers
165 views

Editing $PATH in Linux

I'm working on a linux client and I need to add my home directory path to $PATH but I was unable to do that. I tried to find .bash_profile file and also .bashrc file but both are missing. Please let ...
2
votes
2answers
3k views

How to set PATH variable on Mac OS so that even non-terminal apps see it?

I need to add a directory to my PATH variable on Mac OS. I added it in .bash_profile and .profile, and that works for the terminal. But Emacs (http://emacsformacosx.com) still does not use the new ...
2
votes
1answer
510 views

Setting Apache's PATH environment to match users

Using PHP 5.3 as an Apache module with Apache 2, on OS X 10.7. When I open Terminal and enter echo $PATH I get: ...
2
votes
2answers
4k views

Modify default PATH environment variable in Solaris 10

I know I could modify /etc/profile.. but is there a better way? I know /etc/profile will affect terminals but I want all processes to be affected. crontab, service manager, startup scripts, etc.. ...
2
votes
2answers
3k views

How to remove the path with an nginx proxy_pass

I have a running web-application at http://example.com/, and want to "mount" another application, on a separate server on `http://example.com/en. Upstream servers and proxy_pass seem to work, but for ...
2
votes
1answer
6k views

mklink to network share or UNC path or Mapped Drive?

Are there performance or permission or other considerations to think about when using a mklink path to a network share versus just a straight UNC path (or mapped drive for that matter). For example, ...