Path in computer file systems is in general the human-readable address of a filename or directory specifying a unique location in a file system, and expressed by a string of path components separated by a delimiter (most commonly the slash "/" or the backslash "\"). PATH (variable), is an ...

learn more… | top users | synonyms

168
votes
4answers
199k views

What are PATH and other environment variables, and how can I set or use them?

Questions about setting environment variables the PATH are very common here, and in most cases the answers are very similar to each other. In the future it would be nice to have a good Q/A for ...
109
votes
8answers
122k views

Where does $PATH get set in OS X 10.6 Snow Leopard?

I type echo $PATH on the command line and get ...
82
votes
8answers
22k views

Is there a convenient way to edit PATH in Windows 7?

I do not understand why Windows 7 is still adopting this stuffy dialog box? I feel uncomfortable when editing and looking-up a path in this narrow text box. Is there a convenient way to edit PATH ...
67
votes
14answers
20k views

Add directory to $PATH if it's not already there

Has anybody written a bash function to add a directory to $PATH only if it's not already there? I typically add to PATH using something like: export PATH=/usr/local/mysql/bin:$PATH If I construct ...
58
votes
2answers
30k 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?
56
votes
7answers
142k views

Using cd Command in Windows Command Line, Can't Navigate to D:\

This may be a stupid question, and I think I have looked elsewhere to find the answer... Might be a path issue, but when I open the command line and type from the C:\>: cd D:\ I cannot get to ...
55
votes
1answer
1k views

How is a program that's not in my path being run? [duplicate]

Possible Duplicate: Why am I able to execute a program that is not in my PATH environment variable? I was teaching a coworker about %PATH% and found that if I run "Firefox", it works, but ...
54
votes
4answers
30k views

Windows 7's PATH and environment variables are corrupted

I have no clue, but lately I've been having this problem. After running my workstation suddenly something destroys PATH and lots of stuff stops working. Initially, my path had MANY directories listed ...
45
votes
3answers
18k views

What is the longest file path that Windows can handle?

What is the longest file path that Windows can handle?
37
votes
3answers
5k views

Why is . not in the path by default?

On UNIX-like systems over the years (most relevantly to me, Linux), I've noticed that . (current dir) is never in the $PATH by default. Why is this? I recall reading years ago that it was a security ...
28
votes
4answers
10k views

which/whereis differences

What's the difference between which and whereis ?
20
votes
5answers
3k views

What is the technical term for current (.) and parent (..) directory?

I got a function that checks whether the passed in file name is . or ... But I don't know how to name it properly. Something like IsCurrentOrParentDirectory() is ambiguous, since the function takes a ...
20
votes
3answers
6k views

Best practice for Windows PATH/environment variables managing?

Right now, it's such a mess. Every time I install a new program that does something trivial in the command line, I have to add it to the path. In fact, I'm developing on Ruby and even gems ...
19
votes
4answers
54k views

What is the default PATH environment variable setting on fresh install of Windows 7

A user of ours cleared their path, thanks to some directions on the internet. What is the default path, I am a developer so I have tons of extra stuff in mine, what should my user get on a plain jane ...
19
votes
4answers
19k views

Restoring Windows XP PATH variable

I installed an application that screwed my PATH variable. Now I cannot run anything from the command prompt. Is there any way I can restore PATH variable?
18
votes
3answers
27k views

Can I change the PATH environmental variable in Windows 7 without restarting?

Is there anyway to change the PATH environment variable (or variables in general) on Windows 7 Exterprise (64 bit) and have it take effect in PowerShell or the command prompt (cmd.exe) without ...
17
votes
4answers
116k views

Easier way to change environment variables in Windows 8? [duplicate]

Possible Duplicate: What are PATH and other environment variables, and how can I set or use them? I know that I can edit my environment variables in windows 8 by going to Start -> All ...
16
votes
5answers
9k views

Adding an .exe to default path without adding the directory

For example, I want to add notepad++ to my PATH, however the directory also contains uninstall.exe and several other files/executables and I don't want them to "pollute" my path. Can I just add the ...
15
votes
3answers
20k views

Using relative paths for Windows shortcuts

Apoligies if this was already asked, but everything related i found seemed to be about starting a batch file in a relative path, which isn't what i want. I have a folder scheme like (highly ...
14
votes
2answers
11k views

Avoid unwanted path in Zip file

I'm making a shell script to package some files. I'm zipping a directory like this: zip -r /Users/me/development/something/out.zip /Users/me/development/something/folder/ The problem is that the ...
14
votes
4answers
22k views

How to start/open a file/folder that contains space in its name through command-line?

I'm trying to use the start command in the command prompt to open files and folders, but I'm unable to open files and folders that contain space(s) in their name. I have tried the following queries ...
14
votes
3answers
55k views

How to globally modify the default PYTHONPATH (sys.path)?

On a Ubuntu (10.10) system, I have a Python package that installs itself into /usr/local/lib/python2.6/site-packages/. This isn't contained in the default path (sys.path). How do I add this directory ...
14
votes
2answers
20k views

Environment variables in bash_profile or bashrc?

I have found this question [blog]: Difference between .bashrc and .bash_profile very useful but after seeing the most voted answer (very good by the way) I have further questions. Towards the end of ...
13
votes
5answers
27k views

How can I display the absolute path in bash prompt?

I currently have my bash PS1 set to something like this: PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m\h\e[0m'; else echo '\e[31m\h\e[0m' ; fi\`:\w\n\$ " How can I make it show the absolute path ...
13
votes
4answers
22k views

How To Add Python to the Windows Path

How do I add python to the windows PATH permanently?
12
votes
3answers
7k views

How do I hide the path in command line prompt on Windows?

I'm working on Windows 7 using the cmd console. How do I hide the path in the prompt?
12
votes
3answers
14k views

Mac OSX: conventional places where binary files should live

I'm only vaguely familiar with Unix and the filesystem convention for Macs, so sorry if this is a dumb/easy question. I've downloaded an application that is a command-line application, and want to ...
12
votes
2answers
14k views

How can I set user environmental variables (such as PATH) from a non-administrator account on Windows 7

How can I set user environmental variables (such as PATH) from a non-administrator account on Windows 7? On Windows XP I could go into the Advanced Settings in the System Control panel. However, on ...
11
votes
6answers
17k views

Can I add a shortcut to replace a path in Linux?

For example, I always go to this path: /user/something/somefolders/somewhere but I don't want to type cd /user/something/somefolders/somewhere in the terminal all the time, can I have ...
11
votes
4answers
56k views

How do I extend the maximum file path size in Windows 7? [duplicate]

Possible Duplicate: What is the longest file path that Windows can handle? Does anybody know if it is possible to extend the maximum path length in Windows 7 (64-bit)?
11
votes
4answers
14k views

Passing PATH through sudo

In short: how to make sudo not to flush PATH everytime? I have some websites deployed on my server (Debian testing) written with Ruby on Rails. I use Mongrel+Nginx to host them, but there is one ...
11
votes
1answer
25k views

How to permanently add current directory to PATH in Linux? [duplicate]

Possible Duplicate: Add folder to PATH I want to a add a directory to my bash to search in, and I am using the $PATH=.... it works however when I open a new command window it is not there. ...
11
votes
1answer
23k views

Windows 7 - User-specific %PATH%

I'd like to set up a system for Windows 7 where each user has their own private directory in %PATH%. I tried setting %PATH% to %HOMEDRIVE%%HOMEPATH%\Bin;%SystemRoot%\System32;[...] but it doesn't ...
11
votes
2answers
12k views

How to calculate a relative path from two absolute paths in Linux shell?

We have two paths. First one is directory, second either dir or file. /a/b/c and /a/d/e.txt Relative path from first path to second will be: ../../d/e.txt How to calculate that in Linux terminal? ...
11
votes
1answer
322 views

What does “C:2\” in a windows path string mean?

I got this pop-up from the Windows firewall. What is "C:2\" in the path? The real path is D:\Steam\SteamApps\common\... I tried cd /d C:2\ in cmd and got "The system cannot find the path ...
10
votes
5answers
514 views

What's the difference between filename and ./filename in Linux

What is the difference between filename and ./filename? Under what circumstances is one preferred to the other?
10
votes
7answers
13k views

PATH env variable on Mac OS X and/or Eclipse

When I print out the path in bash, it prints this: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin When I run System.out.println(System.getenv("PATH")); in Java running under Eclipse, it ...
10
votes
5answers
47k views

Different PATH environment variable for 32bit and 64bit Windows - is it possible?

Is it possible to have whole or part of PATH environment variable specific to the type of running process's image (32bit/64bit)? When I run some app from within 64bit cmd.exe I would like to have it ...
10
votes
4answers
4k views

$PATH is driving me nuts

OK, apologies if this is something dumb, but I'm running out of ideas. Goal: prepend /usr/local/bin to $PATH Problem: $PATH won't do what I want or expect How I got here: I want to start learning ...
9
votes
2answers
4k views

What is difference between %WinDir% and %SystemRoot%?

What is difference between %Windir% and %Systemroot% in Windows Path Location? Both of them show "Windows" folder location.
9
votes
8answers
5k views

$PATH in Vim doesn't match Terminal

I'm using MacVim and when I don't launch it from the Terminal (mvim) its $PATH does not include what I have set in my .bash_profile. It only seems to have the default values, ...
9
votes
2answers
6k views

Why are changes to my PATH not being recognised?

When I update my PATH using either the built-in Environment Variables dialog, or something like Path Editor, and then open up a command-prompt, the changes to my PATH will not register with the ...
9
votes
1answer
2k views

What is the “/.vol” directory for?

In Mac OS X, what is the /.vol directory for? I noticed that Excel usually reverences files (while investigating in instruments) using a /.vol path. Is it a folder for temporary files, or does it ...
9
votes
2answers
18k views

How does “PROGRA~1” path notation work?

Since my first Windows 98 (and even now on Win7), I could enter the first 6 letters (symbols) of a folder's name and add ~1 after it (when there was just one folder with those six letters in current ...
9
votes
3answers
6k views

Homebrew installation of git won't take precedence over system version (in /usr/bin/)

OS X (or Xcode) comes bundled with git 1.7.something, but after brew install git (1.8.0), which git keeps returning the old /usr/bin/git. This is what I get when I echo $PATH right now: ...
8
votes
3answers
22k views

“sudo: port: command not found” after installing MacPorts on Snow leopard

I have attempted to install MacPorts in order to upgrade my Rails version so that I can work my way through Agile Web Development with Rails, PragProg (4th, 2011). I have followed the directions in ...
8
votes
3answers
9k views

adding PATH with SETX or PATHMAN or something else?

I am trying to add a PATH from command line, as with SETX %PATH%... it always expands the PATH, which I don't want. PATHMAN is exactly for this purpose, but it doesn't work for me on Windows 7. It ...
8
votes
2answers
4k views

How can I print full path of an executable command in Windows?

At the moment when trying to run tf command and/or any other run-able command, I need to open Visual Studio Command to get it executable. I like to use the normal console and/or the alternative ...
8
votes
2answers
4k views

find command doesn't seem to work in cygwin

When trying to run find commands in cygwin, I keep getting the error "FIND: Parameter format not correct" However, the same commands run on linux. What's going on?
8
votes
1answer
4k views

“whereis” and “which” return different paths in Mac OS X

I've got the default OpenSSL 9.8 (Mac OS X 10.6.8) and decided to install the newest version (1.0.1) via MacPorts (sudo port install openssl). These are console output of which and whereis commands: ...