98
votes
Accepted
How to set path for sudo commands
This is normally set by the secure_path option in /etc/sudoers. From man sudoers:
secure_path Path used for every command run from sudo. If you don't
trust the people running sudo ...
- 51.9k
71
votes
Docker / GCloud | How to fix docker-credential-gcloud not installed or not available in PATH?
I had the same exact issue. Deleting ~/.docker/config.json fixed it for me right away. See here: https://github.com/docker/for-linux/issues/383.
- 811
65
votes
Path Environment Variable Windows 10. Echo %Path% on command prompt shows only %Path%
PowerShell uses a different syntax than Windows Command Prompt.
Use $Env:Path or Get-ChildItem Env:Path to retrieve the PATH variable.
Source: Creating and Modifying Environment Variables - ...
- 27.3k
56
votes
Accepted
How to invoke a program in Windows from command prompt?
You need to add the path of the folder containing notepad2.exe not the full path to the actual exe. So use:
C:\Program Files\Notepad2\
NOTE: Changes you make to your PATH (or any other Environment ...
- 62.1k
55
votes
How to remove a path from $PATH variable in fish?
The 'fish' way of setting the $PATH variable is to actually use set --universal fish_user_paths $fish_user_paths /new/path/here. Then $fish_user_paths is actually prepended to the $PATH variable when ...
- 1,394
52
votes
How to change a symlink in OS X?
ln -hfs newlocation existinglink
or
ln -nfs newlocation existinglink
will change the existing link to point to newlocation
(the -n and -h are identical in operation)
From man ln
-h If the ...
- 621
49
votes
Accepted
Changed the PATH, now I'm getting "command not found" for everything
What can I do to regain control?
Run /bin/vi and revert the changes you made to /etc/environment and /etc/sysconfig/httpd .
- 150k
45
votes
Accepted
Does the Windows Command Prompt search somewhere other than those locations specified by the PATH variable when launching application programs?
At first, I thought that cmd only looks for executables in the directories contained in the PATH variable, so I randomly picked an application - winword.exe (Microsoft Word) and tried to launch it ...
- 40.9k
42
votes
Docker / GCloud | How to fix docker-credential-gcloud not installed or not available in PATH?
Opening ~/.docker/config.json and removing the credHelpers object fixed it for me.
- 533
36
votes
Where are the user profile directories of Google Chrome located in?
To get a straight answer, visit chrome://version/. Your complete, ready to copy-and-paste profile path will be there, under Profile Path, along with other useful info about your chrome install.
- 6,603
32
votes
Changed the PATH, now I'm getting "command not found" for everything
You can set your PATH without an editor. Just type this in the shell:
export PATH=/usr/local/bin:/usr/bin:/bin:$HOME/bin
- 1,031
32
votes
Accepted
How to fix truncated PowerShell output, even when I've specified -width 300
Pipe output to Format-Table commandlet, e.g. as follows:
Get-ChildItem 'E:\' -Force -Recurse | Select-Object FullName | Format-Table -AutoSize
or
(Get-ChildItem 'E:\' -Force -Recurse).FullName | ...
- 12.5k
32
votes
Accepted
Multiple Installations and Understanding $PATH
Bash caches the full path to executables so that it doesn't have to look through $PATH every time.
You can see what is in the cache using the hash command:
deltik@node51 [~]$ hash
hits command
...
- 19.2k
32
votes
Accepted
What does the path '/../' mean?
Lets break /../ down piece by piece
The first (leftmost) /indicates the root of the file system.
This is the topmost level of the filesystem.
.. means the parent folder
However, since we are at the ...
- 71.3k
30
votes
Accepted
No such file or directory after typing $PATH in terminal
$PATH is a variable, which I am sure you're aware of. When that variable is resolved, it would be the same as typing in :/home/bo/bin:/usr/local/bin:/usr/sbin:/usr/local/sbin:/usr/bin:/sbin:/bin: and ...
- 524
27
votes
How do I stop a Windows shortcut from updating its path?
Stop and disable the service: Distributed Link Tracking Client (TrkWks).
Distributed Link Tracking tracks links in scenarios where the link is
made to a file on an NTFS volume, such as shell ...
- 27.3k
26
votes
Accepted
Can't use homebrew installed git
Shells maintain a cache of the paths where executables were found in the $PATH variable. So it cached /usr/bin/git rather than /usr/local/bin/git, because the latter didn't exist when your shell ...
- 476
25
votes
Accepted
A more comfortable way to edit a long $PATH?
I use a set of convenience functions for prepending or appending a path to a variable. The functions come in the distribution tarball for Bash in a contrib file called "pathfuncs".
add_path will add ...
- 948
25
votes
Path Environment Variable Windows 10. Echo %Path% on command prompt shows only %Path%
Since Windows 10 Insider Build 14971 Microsoft changed the default command shell to be PowerShell instead of cmd.
PowerShell handles environment variables differently to cmd.
To display their values ...
- 150k
23
votes
Accepted
How do I bypass restrictions on the length of the PATH variable
Microsoft's documentation says that an environment variable on Windows is limited to
only 32,767 characters
(link),
but does not say how to create such a long variable.
The problem here is that the ...
- 437k
22
votes
Accepted
Standard value of PATH variable Windows 10
This is copied from a Win 10 Enterprise 64Bit System I set up yesterday (no programs installed yet):
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\...
- 1,732
20
votes
Is there a convenient way to edit PATH in Windows 7?
This is implemented in the Windows 10 update released on November 2015.
I understand the question specifically calls for a Windows 7 solution. However, I've posted this answer for the benefit of ...
- 45.4k
20
votes
How to remove a path from $PATH variable in fish?
As Elijah says, best practice is to modify the fish_user_paths rather than the global PATH. To avoid ever having to Google this again…
Create a couple of functions that only modify fish_user_paths
...
- 1,073
19
votes
Does the Windows Command Prompt search somewhere other than those locations specified by the PATH variable when launching application programs?
From the command prompt, if you just enter WinWord it fails to run.
If you enter START WinWord it runs.
The Start command is key here.
When you try to execute a file through the start command, ...
- 1,014
19
votes
How do I alias python3 on Windows?
I want to alias python3 to python on Windows.
You haven't mentioned what release of Python you are using (e.g. "vanilla" Python, Anaconda, SciPy, etc.), but if I am not misunderstanding, ...
- 16.1k
18
votes
In zsh on mac OS, where is the source of $PATH? I cannot find it in .zshrc
There are many possibilities, but some are likelier than others.
When starting Zsh, it will source the following files in this order by default:
/etc/zsh/zshenv Used for setting system-wide ...
- 437k
17
votes
Accepted
Path enviroment variable editor BUG
I was having the exact same issue, and finally figured this out via trial-and-error. The issue is that there is a bug in the Windows 10 Path environment variable parser. In my case, the first entry ...
- 358
15
votes
Where are Windows 10 desktop wallpapers stored?
Open regedit and go to HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General key
The name of the key you are looking for is WallpaperSource
- 15.4k
15
votes
Accepted
How do I stop a Windows shortcut from updating its path?
You can use PowerShell! This little script whacks the LNK file to produce the same effect as using the classic shortcut utility.
$linkfile = Resolve-Path $args[0]
$bytes = [IO.File]::ReadAllBytes($...
- 39.5k
14
votes
PATH env variable on Mac OS X and/or Eclipse
For those of you looking for an answer years later (Neon, Oxygen):
Some of my node and angular/angular2 tooling in eclipse failed due to missing $PATH entries in the MacOS terminal. Your tooling ...
- 241
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
path × 1223windows × 324
environment-variables × 241
linux × 192
command-line × 177
bash × 158
macos × 133
windows-7 × 121
windows-10 × 114
python × 52
terminal × 44
shell × 44
unix × 43
powershell × 42
cmd.exe × 41
ubuntu × 39
java × 39
windows-explorer × 25
mac × 24
zsh × 24
cygwin × 23
windows-8 × 20
batch-file × 20
symbolic-link × 18
installation × 17