Questions tagged [path]
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 environment variable specifying a list of directories where executable programs are located.
1,248
questions
411
votes
5
answers
1.1m
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 this....
302
votes
9
answers
1.3m
views
Using cd command in Windows command line, can't navigate to D:\
This may be a silly 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 the ...
209
votes
8
answers
400k
views
How to delete a file in Windows with a too long filename? [duplicate]
My wife has several files and folders that somehow ended up having filenames that have caused them to be undeleteable (can't be deleted) by normal means or via the command line. I believe the ...
179
votes
23
answers
67k
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 ...
175
votes
10
answers
69k
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 in ...
157
votes
5
answers
56k
views
which/whereis differences
What's the difference between which and whereis ?
145
votes
8
answers
172k
views
Where does $PATH get set in OS X 10.6 Snow Leopard?
I type echo $PATH on the command line and get
/opt/local/bin:/opt/local/sbin:/Users/andrew/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/pear/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/...
115
votes
2
answers
71k
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?
110
votes
5
answers
720k
views
How do I add Python to the Windows PATH?
I want to be able to run Python commands from the Windows CMD. However, if I don't specify Python's full path for each command, I get an error saying "Python is not recognized as an internal or ...
106
votes
3
answers
105k
views
Mac OS X: conventional places where binary files should live
I've downloaded an application that is a command-line application, and want to put it somewhere where I can run it from the command-line without having to type the path explicitly.
What are the ...
97
votes
4
answers
75k
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 (...
82
votes
4
answers
105k
views
How to set path for sudo commands
If I issue
sudo my-command
how does Linux look for that my-command?
The my-command is in my PATH. I can invoke it without any problem. However, when I invoke it with sudo, I'll get command not found.
...
77
votes
8
answers
241k
views
Using relative paths for Windows shortcuts
I have a folder scheme like (highly simplified version):
New Files
>Tools
>Scripts
Tested Files
>Tools
>Scripts
... and I'd like to have a shortcut in each folder from the "New Files"...
76
votes
5
answers
140k
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 ...
76
votes
2
answers
276k
views
Path Environment Variable Windows 10. Echo %Path% on command prompt shows only %Path% [duplicate]
My variable value in path is as follows
C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program ...
72
votes
6
answers
81k
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 ...
72
votes
5
answers
25k
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 ...
65
votes
4
answers
430k
views
How to add a line to .bash_profile
I just installed Homebrew on bash on my Mac and now I need to do this:
Once you’ve installed Homebrew, insert the Homebrew directory at the top of your PATH
environment variable. You can do this by ...
64
votes
5
answers
54k
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 the current directory included in the search when a ...
59
votes
4
answers
39k
views
What is the longest file path that Windows can handle?
What is the longest file path that Windows can handle?
57
votes
1
answer
2k
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 was ...
54
votes
5
answers
268k
views
What does "/" , "./", "../" represent while giving path?
What does "/" , "./", "../" represent while giving path?
54
votes
3
answers
35k
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.
51
votes
4
answers
87k
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 ...
49
votes
9
answers
294k
views
How to restore the Path environment variable I deleted?
I accidentally deleted the Path environment variable by creating a new one with Path name. How can I restore my old Path environment variable?
49
votes
3
answers
75k
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 ...
46
votes
5
answers
163k
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 ...
44
votes
5
answers
40k
views
Docker / GCloud | How to fix docker-credential-gcloud not installed or not available in PATH?
I am trying to do a simple docker-compose command. But the console errors with that:
Building patch-panel
Traceback (most recent call last):
File "bin/docker-compose", line 6, in <module>
...
44
votes
6
answers
29k
views
How to remove a path from $PATH variable in fish?
I am using fish as my shell in Debian and recently (after some upgrade) whenever I try to use command completion I have:
set: No such file or directory
set: Could not add component /usr/lib/x86_64-...
44
votes
4
answers
118k
views
Access to a disk drive using volume ID instead of a drive letter in Windows
Can I access to a disk drive using volume ID instead of a drive letter in Windows? It could be very useful for external drives.
42
votes
9
answers
121k
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 some ...
40
votes
5
answers
5k
views
Does the Windows Command Prompt search somewhere other than those locations specified by the PATH variable when launching application programs?
I tried the following experiment.
Before I start, I checked the PATH variable from cmd, which has the following value:
Path=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS ...
39
votes
4
answers
139k
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 ...
38
votes
4
answers
173k
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 ...
37
votes
3
answers
52k
views
What are invalid characters for a file name under OS X?
I am having trouble finding this information, and trial and error is telling me that there may not be any. What are invalid characters for a file name on OS X Lion (10.7)?
35
votes
6
answers
5k
views
A more comfortable way to edit a long $PATH?
I want to add, in ~/.bashrc, a few directories to my $PATH.
My $PATH is quite long so it's a bit hard to see what directories it contains and in what order.
I know I can modify my ~/.bashrc to be:
...
34
votes
8
answers
178k
views
How to fix truncated PowerShell output, even when I've specified -width 300
I'm trying to get a list of all the directories and files on an external hard drive, with one fully-qualified directory/file path per line. I'm using PowerShell on Windows 10 to achieve this. This is ...
33
votes
3
answers
49k
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?
33
votes
5
answers
56k
views
How to change a symlink in OS X?
How do I change where a symlink points to, without deleting and creating a new one (with ln -s "/path/to/point/to" "/path/where/symlink/is")?
When I tried doing that to Java's "Current" symlink, Java ...
33
votes
2
answers
90k
views
In zsh on mac OS, where is the source of $PATH? I cannot find it in .zshrc
When I run echo $PATH, my output is:
/usr/bin:/bin:/usr/sbin:/sbin
But in my .zshrc, $PATH is commented out:
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/...
32
votes
2
answers
97k
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 ...
32
votes
1
answer
44k
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:
...
30
votes
2
answers
102k
views
How does "PROGRA~1" path notation work? [duplicate]
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 ...
28
votes
4
answers
157k
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 ...
27
votes
6
answers
141k
views
Where are the user profile directories of Google Chrome located in?
Where are the user profile directories of Google Chrome located in?
It may seem like a very simple question, but I couldn't find it.
I checked inside %APPDATA%, but there were noting relevant there.
...
27
votes
5
answers
11k
views
How do I stop a Windows shortcut from updating its path?
While developing my product, my test device has several versions of the application installed at the same time. However, in order to get the absolute paths that my application is using to work, I need ...
27
votes
4
answers
206k
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 Apps -&...
27
votes
5
answers
36k
views
How do I bypass restrictions on the length of the PATH variable
System Properties
This environment variable is too large. This dialog allows setting values up to 2047 characters long.
I use/have used a lot of software, and my PATH has grown as a result. When ...
27
votes
5
answers
131k
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 (...
27
votes
3
answers
18k
views
Prevent Windows System %PATH% from being prepended to user %PATH?
I know how to set system or user specific environment variables:
Now, the problem is that the PATH variable is treated such that the value you enter for the user PATH will be automatically appended ...