5
votes
Accepted
Set PATH in .bashrc depending on shell
My tests show that r appears in $- after rbash reads ~/.bashrc, as if the shell was not restricted during processing the file. This corresponds to what the manual says about restrictions:
These ...
- 66.5k
3
votes
Accepted
What is the path to the `dir` program on Windows from `cmd.exe`?
What is the path to the dir program?
It doesn't have one.
dir is one of several commands that are internal to the cmd shell.
The full list can be found at Internal commands - Windows CMD - SS64.com ...
- 150k
3
votes
Most effective way to add custom script to /bin? & best practices
some caveats to your question
Firstly, aliases and adding to the PATH only effect the shell you have configured. There are central system files that will effect multiple accounts, but even then you'...
- 540
2
votes
What does asterisk "*" mean in a unix PATH environment variable?
This other answer states your $PATH is invalid, but I disagree.
That's because, in bash at least, it won't cause any errors - either when you set it, or when the shell tries to resolve a command via $...
- 237
2
votes
how to change install location of "winget"?
you can use "Progra~1" for "Program Files" and "Progra~2" for "Program Files (x86)". this is an error caused by powershell or cmd syntax, and not because of ...
- 21
2
votes
Accepted
Support of the \\?\UNC\server\share syntax in Windows
The \\?\UNC\server\share\path\file syntax is only valid for single file commands such as CreateFile, GetFileAttributesEx, ... and is required if you want to access server files which exceed the ...
- 161
2
votes
How do I bypass restrictions on the length of the PATH variable
Create a new variable, path2, and place that variable in your path variable. That should work. Also, I'm using an app called PathCopy to shorten all my path names in my path. That is helping also.
I'...
- 21
2
votes
Accepted
is there an 'upwards' find?
Existing answers unsufficient (details below).
#!/usr/bin/env bash
DIR=$(readlink -f "$1")
# Alternative: use current working dir; but then also replace ${@:2} with $@ on line 8
# and $1 ...
- 134
2
votes
Where is studio64.exe located in Windows 10?
Windows will suggest the removal of invalid entries from the
Start menu, if the executable in question is not found.
Evidently, you had Android Studio installed at some time, then you
uninstalled it. ...
- 438k
2
votes
Accepted
Windows: How to make cygwin bash.exe to take precedence over wsl in command line?
When you say "command line", I'm going to assume you mean the CMD shell, although you could potentially mean PowerShell.
For CMD, the easiest way to do this is probably with a doskey alias ...
- 14.6k
2
votes
PYTHONPATH defined on multiple vs single line in fish shell
When you add to PYTHONPATHS on two lines, set is handling it & it knows that there are two Items : this will work.
When you add to PYTHONPATHS on one line, you have included a space, set is ...
- 1,227
2
votes
How to run apps from Windows' command line like in Linux
using setx from CMD will probably cause mayhem in the long run
This is absolute rubbish - there is nothing wrong with setx.
Why windows doesn't automatically add newly installed programs to PATH?
...
- 438k
2
votes
How to run apps from Windows' command line like in Linux
In Linux is just so easy: you install an app and it's just automatically callable from the shell!
That only applies to apps that install to standard locations like /usr/bin or /usr/local/bin. If you ...
- 25.2k
2
votes
Accepted
Copy Java installation to another system
How would we create a completely portable version of Java in this way?
You can do this with a cmd script:
Copy the complete Java installation to the new system.
Set JAVA_HOME to point to the root ...
- 150k
1
vote
Force python to be globally linked to /usr/bin/python3 on macOS (non-alias)
For me, it actually helped to look at these instructions here.
Here are the steps:
get location of developer tools: xcode-select -p. For me this was at /Applications/Xcode.app/Contents/Developer
...
- 111
1
vote
Accepted
Create shortcut from a link to a specific paragraph in OneNote document: the URL seems too long for a shortcut
I just tried the following and it seems to work. Not sure if my machine/OneNote has any specific configuration which makes this possible, but maybe it's worth a try.
Go to the OneNote paragraph you ...
- 5,455
1
vote
Accepted
File Explorer "forgetting" contents of PATH variable after several hours
The reason for this happening are unknown, perhaps some installed add-on
to Explorer or an interference by some installed program.
This perhaps can be checked by booting in Safe mode (if the problem
...
- 438k
1
vote
Accepted
Powershell $env:path changing depending on how it is opened (PowerToys Run)?
A child process inherits the environment of its parent.
It seems like PowerToys Run modifies its PATH variable before executing
PowerShell.
The only way to avoid it might be to set up a script that ...
- 438k
1
vote
How to determine if a file with a trailing space exists?
I found out the problem isn't Powershell - it's Windows. However, Windows does have a way to force a literal string: prepend \\?\ to a path:
For file I/O, the "\\?\" prefix to a path ...
- 79
1
vote
How to find folder paths that have existed in the past on a PC's hard drive
Two things to try:
Look in the last disk image you made. Just mount the image as a drive, using whatever tool you used to make it. Search on that image... slow, because unindexed, but certain to find ...
- 23.4k
1
vote
Where is studio64.exe located in Windows 10?
Assuming that Android Studio is still there on your Windows Installation, you have 3 or 4 or "MORE" ways :
(1) Check in recycle bin (Quick Check)
(2) Windows Desktop Search on whole C:\ (...
- 1,227
1
vote
Accepted
zsh: command not found: brew while it exists
Hypothesis: somewhere in your startup scripts there is something like:
PATH=/usr/local/opt/gradle@6/bin:”$PATH”
which should be like:
PATH=/usr/local/opt/gradle@6/bin:"$PATH"
At this point ...
- 66.5k
1
vote
Accepted
How do package installers make packages available anywhere without adding them to the Environment Variables' path?
There are no miracles - the PATH variable (or its equivalents) is used
in all operating systems.
If a package is instantly available after installation, it's because it
installed itself into a folder ...
- 438k
1
vote
How to specify relative path in 7-zip command line?
Yes, you can.
First you define the root directory relative to which you will create the list of files (for example, C:\RootDir).
Next, you create a list of files to be archived, with paths relative ...
- 11
1
vote
Accepted
Debian Linux PATH variable repeats path
You probably have a local ~/.profile file that also appends the $HOME/.local/bin piece to the PATH environment variable, in addition to the global /etc/profile. On my Debian machine for example, there ...
- 936
1
vote
Accepted
Setting user PATH environment variable on Windows 10 has no effect
You can set environment variables from Windows Command Prompt using the set or setx command. The set command only sets the environment variable for the current session. The setx command sets it ...
- 49
1
vote
What does path designator .: stand for?
Nothing. The : is a separator between paths; the parameter lists two locations, . and /usr/share/php.
- 408k
1
vote
\\wsl$\Ubuntu is not accessible anymore from File Explorer
Also do check that nothing has turned off the Virtual Machine Platform behind your back - as following the above steps and then doing this solved the issue for me.
- 11
1
vote
Installing Software with Missing Library - libusb1.0
I had the exact same problem. My solution was to do the following:
sudo apt install libusb-1.0-0
sudo apt install libusb-1.0-0-dev
I then tried a few times but cmake wouldnt work, even though libusb ...
- 11
1
vote
%SystemRoot% and C:\WINDOWS in path
Removing the hard-coded one and leaving the %SystemRoot% one in will protect you in the rare (and almost unimaginable) instance of your windows being moved to a different drive/folder. I don't know ...
- 161
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