Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [path]

PATH (all upper case) is the name of an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are searched for.

0
votes
0answers
28 views

Why is my PATH so small when opening SSH session through python subprocess?

I'm currently working on a project that requires me to use a python subprocess to execute "i2cset" on a Raspberry Pi2 through SSH but my code keeps telling me that my Raspberry Pi can't find "i2cset". ...
0
votes
2answers
44 views

Confused about Configuring Linux Path Environment /etc/profile.d/*.sh being Executed Twice?

I am trying to set PKG_CONFIG_PATH to CentOS here are the code I tried export |grep PKG_CONFIG_PATH no output, normal... echo "$PKG_CONFIG_PATH" :/usr/local/lib/pkgconfig why there is output here??...
1
vote
2answers
39 views

Correcting PATH after dist upgrade?

After a dist upgrade (Debian 9 to Debian 10) some things stopped working. For example, iwconfig, losetup, ifconfig, poweroff, pm-hibernate. These commands work if I type the full path like /sbin/...
0
votes
1answer
26 views

How to run different python version based on project location? [on hold]

My system is 5.0.9-2-MANJARO I've already set the python scripts workaround described in archwiki ➜ ~ cat /home/nfl/bin/python #!/bin/bash script=$(readlink -f -- "$1") case "$script" in (/opt/...
1
vote
1answer
42 views

how to avoid mounting directories with overcomplicated paths?

Background: I am accessing a remote directory like this: smb://serv.erNa.me/storage/directory/ Accessing it, is not an issue. Through the file manager I copy paste the path, press Enter, insert ...
2
votes
0answers
30 views

Add file to PATH only when in specific directory [duplicate]

Is it possible to make executable appear in the global search path when I am entering to the some specific directory and get it removed once directory changed again?
0
votes
1answer
37 views

Specifying a Shebang path in a shell script

I am running a VM with Ubuntu on it. In a very simple script I wrote I defined the shebang as: #!/bin/zsh However, zsh also exists in /usr/bin/zsh. Does it matter which path I use?
0
votes
0answers
17 views

Copy specific named directories, where content changed the last 24 hours

I can recursively find and copy all my test-directories (with content) of the current directory: find . -name test ! -path "./my_dest/*" -exec cp -r --parents {} /path/to/my_dest \; But now I want ...
-2
votes
1answer
66 views

Conan: Command Not Found

I'm using a RPI 3B uname -a returns: 4.14.98-v7+ #1200 armv71 OS is stretch gcc version is 4.9.3 I'm attempting to setup my RPi to be a BLE gateway as per this project on hackster.io. I executed ...
0
votes
0answers
48 views

Do programs added to PATH not work with the source tool?

I have mix added to my bash_profile like so: export PATH="$PATH:~/.mix" This gives me access to rebar, and it works correctly: chris$ rebar -V rebar 2.6.2 R15B03 20160628_123811 git 2.6.2 However, ...
1
vote
1answer
53 views

How to reset $PATH after accidentally setting it to something nonsense?

I'm on Mac OS X High Sierra. I was doing an scp command, repeated several times so I wanted to be clever and just set the variable $IMAGE for the image name and $PATH if I needed to add an extra path ...
1
vote
1answer
41 views

Does using ./ in paths make sense with common Unix tools?

Throughout the years I've been using ./ in front of absolute paths more and more. For example: mv ./file /target/ rm ./something/else # compared to mv file /target/ rm something/else I've seen it ...
0
votes
2answers
39 views

Script runs command fine, but fails when trying to save output to variable

I have a shell script with the following contents. I call it with ./script.sh. Echo successfully runs, but not when I try to save its output to a variable. The same is true for all commands I've ...
0
votes
1answer
18 views

After re-connecting hard disk, terminal commands stop working

The current working directors is, e.g. /media/username/ExtHDD/. When disconnecting and re-connecting that HDD, commands such as ls do not work properly anymore. $ -????????? ? ? ? ? ...
1
vote
1answer
44 views

Portable way to run command without PATH from bash script

cron calls my bash script (it's a backup script) with a very sparse PATH of /usr/bin:/usr. As a result, while a line like lvcreate --size 1G --snapshot ... works just fine when I run the script from ...
1
vote
1answer
36 views

How to check $PATH for installed software in a bash script?

Recently one of my bash scripts failed because cmake and zip / unzip were not installed on a system. What would be a convenient way to check for installed packages in $PATH env? I would like to ...
1
vote
2answers
67 views

Is it safe to add new python version to PATH?

Is there any danger to adding a new version of python to PATH? i.e. will some important system programs break? Suppose this is without deleting the old python2, but effectively changing the command "...
0
votes
1answer
49 views

Whether wild card symbol can be added to path variable?

Scenario: Parent folder contains, many sub-folders (say in a few hundreds) containing executables or source programs. Say, parent folder, bin contains many sub-folders, mod1, mod2, ... modn (for ...
0
votes
1answer
37 views

“$PATH” being exported as literally “$PATH” [closed]

So in a bash_config profile I have export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk export JAVA_PATH=$JAVA_HOME export PATH=$PATH:$JAVA_HOME/bin But rather than appending the PATH it is setting it ...
-1
votes
1answer
141 views

How to access external hard drive from Ubuntu Shell and Python code [duplicate]

I am running out of space in my local device. I have external hard disk. I want to point my python code to write to directory there. How can I know the full path for the hard disk? I tried to go to ...
0
votes
1answer
114 views

Trying to export a path from inside a bash script [duplicate]

I am trying to put my whole environment set up into a single bash file. I am only hitting one issue. When I try to export a new path from inside the file it is not setting the path in the environment ...
0
votes
1answer
44 views

Why is program not found in PATH [duplicate]

I've installed ipython inside virtualenv on my macOS. My PATH environment variable also shows virtualenv path to be at the beginning. which command also shows that ipython at the correct location. ...
1
vote
1answer
161 views

How to persist environment variables in ash, the Almquist shell?

How can I get ash to load some environment variables on startup? Just put them in /etc/profile /etc/profile is only read for login shells; what about non-login shells, as frequently pop up when ...
4
votes
1answer
163 views

Bash can't find scripts in $PATH [closed]

I'm setting up a completely new, fresh Ubuntu 16.04 Minimal system, and have run into a weird problem. Even after adding $HOME/bin to the $PATH, bash can't seem to find any of the scripts in it, at ...
12
votes
1answer
1k views

Executable file named 'test' is in $PATH but won't run

I have a file in $HOME/bin (before you ask, yes, it is in my path) called test which I've confirmed can be executed fine when I run it with the full path to the file. However, I get a really weird ...
1
vote
0answers
31 views

Make programs in /opt searchable from launcher

I've installed Telegram and I've the folder "tsetup.1.3.10", where executable files reside, into Download folder. I don't want my programs in Download folder, so I moved they in /opt folder. But, ...
0
votes
0answers
32 views

Changing Path variable

I am not able to permanently change my PATH variable. I tried changing .bash_profile file but, the changes were reverted (however the .bash_profile file had the path which I wrote) when I closed the ...
3
votes
1answer
79 views

Remove executable from path [duplicate]

I have a script called teleport in my path. When I type tele and hit tab, I'd like for tab-completion to complete this to teleport. However, there's another program installed on my system: telepathy-...
6
votes
1answer
125 views

Adding path to .profile safely using a script

I want to add a directory to the $PATH environment variable through an install script. I have written a few programs, all present in one directory. They need a lot of other packages installed to run. ...
2
votes
1answer
92 views

cannot find package with running go build

root@kali:~/subfinder# go build main.go:15:2: cannot find package "github.com/subfinder/subfinder/libsubfinder/helper" in any of: /usr/lib/go-1.11/src/github.com/subfinder/subfinder/libsubfinder/...
1
vote
1answer
63 views

Messed up environment variables in Centos 7

When I am running my maven build I am getting this error: Error: JAVA_HOME is not defined correctly. We cannot execute /usr/bin/bin/java I have edited .bashrc, .profile, /root/.profile and /root/....
0
votes
3answers
288 views

Bash script with limited path

I'm trying to write my first bash script to essentially install a bunch of dependencies and then execute a script. I'm struggling debugging this with the user b/c I'm a dev which means I already have ...
0
votes
0answers
16 views

Can run the command when specify the path, but cannot run it by name although PATH points to it [duplicate]

I have the following setup: $ which pip3.7 /py36env/bin/pip3.7 $ sudo pip3.7 list sudo: pip3.7: command not found $ sudo /py36env/bin/pip3.7 list Package Version ------------------...
3
votes
2answers
323 views

Could PATH contain newlines?

It is known that a path could contain newlines in any of its components. Should we conclude then that the environment variable $PATH could contain newlines ? If so, how to split the $PATH into its ...
1
vote
1answer
42 views

Linux's command line behaviour (Ubunto/Deb) in running an executable file [duplicate]

@user-123:~$ Downloads/execfile-3.4/execfile @user-123:~$ @user-123:~$ cd Downloads/execfileparentdir-3.4/ @user-123:~/Downloads/execfileparentdir-3.4$ execfile execfile: command not found @user-123:~...
2
votes
2answers
59 views

Set $PATH as OpenLDAP attribute

I need to set $PATH for OpenLDAP users (CentOS6/7). Not in .profile, not in .bashrc on client machine, but as attribute in LDAP on the LDAP server so it is set whenever the user logs onto any host via ...
0
votes
1answer
50 views

Searching files in $PATH

I have some folders specified in my PATH environment variable. How do I list all the files in these folders?
0
votes
0answers
78 views

Include directory not found after installing xtensa compiler

I followed these steps to install ESP8266 SDK and Xtensa toolchain separatedly (make STANDALONE=n) on fresh Lubuntu LTS distro. The installation was successfull, I added $HOME/esp-open-sdk/xtensa-...
1
vote
1answer
30 views

How can I write out the path of 0 size files

How can I modify my query (below) to get the (absolute) path of all the 0 sized files within a directory? find ./ -size 0 -print
1
vote
1answer
27 views

“Right” way to deal with adding packages to path

I downloaded and installed the Haskell Platform. And It got installed (default) to /usr/local/haskell/ I want to add the binarys inside /usr/local/haskell/bin/ to my path. But I dont want (if ...
-3
votes
1answer
39 views

Gnu/Linux: Listing files, with certain characters in the file-name, while in a different directory

How do I list all files and directories in the /etc/ directory, which have one or more digits in its file-name, and save the output to a file, in the home directory. The output must have the full ...
0
votes
1answer
58 views

Is there a command that preloads `open()`, `fopen()`, etc. functions like `proxychains`?

I learnt that we can use LD_PRELOAD to preload open() function to fake a path to a process. I learnt it from here: Is it possible to fake a specific path for a process? I am wondering if there is a ...
1
vote
2answers
595 views

Whose PATH value is the default PATH value in a crontab file? [duplicate]

root's default PATH is $ sudo su # echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games After creating /etc/cron.d/myjob 35 * * * * tim ( date &&...
0
votes
2answers
319 views

Removing root slash with `-p1` and so forth [duplicate]

I understand that patch allows patching applications when some path components are removed. While -p0 argument will treat a path as is: /var/www/html/example.com -p1 will remove the root slash, so ...
0
votes
1answer
32 views

Run programs from a different set path

I already read many of the ways to run a program when it is installed in a different address than the $PATH. I have a different problem. On PC0, a set of packages (libraries and executables) were ...
0
votes
3answers
147 views

Cut path to first four directories

I have several projects where I have to use the same command. The projects always are in /home/[username]/public_html/[prjectname]/ I'd like to run this command from every directory of my projects, ...
0
votes
1answer
304 views

RHEL 7: Add PATH variables globally

Under my profile and the .bashrc file. I have added several environment variables. Example: export HADOOP_HOME=/app/hadoop-2.7.3 When I try to run any "hadoop" command I get command not found. ...
0
votes
1answer
120 views

Ubuntu 14.04.2 LTS: 'find' not found in PATH or not executable

I am trying to install some graphics libraries with the following command: sudo apt install jpegoptim optipng It however fails to run with stating the following: Reading package lists... Done ...
0
votes
2answers
37 views

Properly feed paths to executables in bash script

Hello all I have a text file (1.txt) that contains full paths to binaries which I need to execute a command (val_bin) for each path in the file. 1.txt Example: /source/ed/dev/ed/ab/ed_len/comercial/...
0
votes
2answers
1k views

Where is Cygwin set its PATH variable?

If I write echo $PATH in my Cygwin window (mintty) I get a list of paths. That list does not match the Windows Envirnonement variables list. I cannot find a file, where is the variable $PATH set. None ...