Skip to main content

All Questions

Tagged with
4 votes
1 answer
975 views

Are there alternatives to alias I'm not aware of?

Today I started to notice weird behavior running a local command for a binary installed through Go. It seems the command is aliased, but consulting alias, it isn't. The command buf somehow executes cp!...
Tim's user avatar
  • 1,054
0 votes
2 answers
65 views

How to find files with find tool in system path ($PATH)? Or alternatively, How to specify starting-point directory for find as an expression?

For example, I want to find all symlinks that reference to particular binary in all directories that belong to system $PATH. This can be successfully achieved with manual specification of all ...
Anton Samokat's user avatar
0 votes
0 answers
230 views

How can I echo/print the environment files of a directory/path in a Jenkinsfile during a build?

In a Jenkins file, I have the following code: #!/usr/bin/env groovy .... def env_prod = 'prod.env' def entrypoint = "${env.WORKSPACE} The above is then combined like this: ${env.WORKSPACE}/$...
Patrick_Chong's user avatar
1 vote
3 answers
758 views

How to do wildcard/glob expansion when the pattern and the resolved pathes contain spaces?

I need to expand some pathes using a POSIX sh or Bash: Here are two example patterns (I chose overly complicated patterns on purpose): $ npm pkg get workspaces | jq -r '.[]' apps/app* lib/{be,fe *} ...
Forivin's user avatar
  • 887
0 votes
4 answers
191 views

split PATH variable INTO few lines

I have split my PATH variable into few lines, in the file to make them easier to read because it's very long, as I had seen here. This is what I changed in my /etc/profile: # PATH="/usr/share/...
ant's user avatar
  • 29
0 votes
2 answers
166 views

Commands cannot be located after sourcing a bash script

I have a short bash script cdline that takes two arguments PATHS and LINE and changes directory to the respective LINE in PATHS: #!/bin/bash #command for changing directory to that in the given line......
gohomology's user avatar
0 votes
1 answer
220 views

Using '/usr/bin/cd' in a cron script fails while 'cd' works

I have a simple shell script that I am running via cron. I am using it to perform a scheduled git pull operation (yeah, I know there are probably better methods, but this is another team's repository ...
Nick S's user avatar
  • 103
1 vote
1 answer
266 views

Ideas for why PATH has these directories

In my .profile I have PATH="$HOME/.local/lib:$HOME/.local/bin:$HOME/.node_modules/bin:$HOME/.cargo/bin:$HOME/local/bin:/usr/bin:$PATH" In my .zshrc I have miniconda path stuff (export PATH=&...
squirrels's user avatar
  • 119
0 votes
0 answers
30 views

'-bash: line 1: rescanscsi: command not found' error even though script location is in PATH and other script runs fine from same folder [duplicate]

I'm new to linux, trying to switch over from Windows, and I could really use some help. This is actually my first time using a forum such as this so please forgive any errors I make. I'm using Linux ...
TT Radykal's user avatar
3 votes
1 answer
248 views

How to get under Linux Mint LMDE5, the path of a launcher through bash commands stored in the launcher?

Linux Mint LMDE5 is a Debian derivative. On the desktop you can create launchers p.e. via GUI, with which you can not only link something, but also store smaller bash code in it. After creating, the ...
Alfred.37's user avatar
  • 138
0 votes
1 answer
329 views

passing shell script file name as an command line argument java -jar /test.sh and gives me error Error: Unable to access jarfile /test.sh

java -jar /test.sh --name trigger Error: Unable to access jarfile /test.sh test.sh file contains #!/bin/sh jar_name="-Dspring.config.location=application-test.properties somejarFileVersion_1.0&...
R venkata's user avatar
-1 votes
2 answers
261 views

Why Can't I get the path of the root user with sudo

I've changed the PATH environment variable of the root user. The following command are there too show the PATH. su env | grep ^PATH PATH=/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/...
Pierre-olivier Gendraud's user avatar
0 votes
0 answers
72 views

Why do I have repeating lines in my default $PATH

Using CENTOS 7 and BASH, after creating a new user, the user has repeating lines in the path variable. I've looked at this site $PATH duplication issues but it's for a .zshrc. Also, this is for the ...
dave's user avatar
  • 11
0 votes
1 answer
134 views

Path resolution depending on pwd (symlinked dirs)

This sort of situation often occurs under the /sys/bus tree (bash-5.1) : Let's say I get some foo directory listing several symlinks to other directories, ls -ails pathto_foo displaying something of ...
MC68020's user avatar
  • 8,241
0 votes
1 answer
222 views

My $PATH differs from that stated in /etc/profile

This is my entire /etc/profile. # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "$(id -u)" -eq 0 ];...
lini37827's user avatar
1 vote
1 answer
898 views

-bash: /home/me/.profile: line 28: syntax error near unexpected token `('

I've spent the last week of my life trying to set up a development environment so I can learn machine learning. I have less hair now, not that I had too much before. Never mind. I am using WSL 2 ...
Kreative Zombie's user avatar
-1 votes
2 answers
92 views

What does ./ mean in shell?

I have a simple hello_world.c file from here. I figured it out how to do it. gcc -Wall -g hello_world.c -o hello is working however if I run bash hello there's an error: hello: hello: cannot execute ...
jian's user avatar
  • 577
2 votes
1 answer
7k views

ufw "command not found"- but as the root user!

My Debian 11 VPS is running now for about 2 weeks- and today I just wanted to analyse, why my traffic is ~70GiB (counted by bashtop). So somewhere in the net I read about nethogs, that this could help....
ubuntu4life's user avatar
0 votes
0 answers
99 views

Can't find a bash script anywhere in filesystem

I have a bash script that uses ssh and requires 1 positional argument. If I type the name partially, the bash-completion completes it and the script works. The issue is that I can't find it anywhere ...
Cruise5's user avatar
  • 526
3 votes
1 answer
540 views

Why is executable found without a full path despite its location not in search path?

This question is about understanding the reason(s) behind a perceived inconsistency between documented and actual behavior when calling an executable through sudo. When the secure_path option is ...
mesr's user avatar
  • 407
0 votes
1 answer
285 views

I am not sure about correct way to export PATH

I have Java and Springboot cli added to PATH however, when source /etc/profile it gives error. And on restarting PC, BASH is not loading. My export in /etc/profile export JAVA_HOME=/usr/lib/jvm/java-1....
Susobhan Das's user avatar
1 vote
1 answer
1k views

Path in script different than actual path

When I echo $PATH in a terminal window, it outputs: /home/charles/anaconda3/bin: /home/charles/anaconda3/condabin: /usr/local/sbin:/usr/local/bin: /usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/local/...
Charles Victorio's user avatar
2 votes
1 answer
2k views

Can't find where my PATH is set in MacOS

For the record, I am running ZSH, FISH and GNU Bash on my system. I've checked every imaginable location and I cannot find where my $PATH variable is set: $ echo $PATH /usr/local/bin /usr/sbin **/...
ATL_DEV's user avatar
  • 147
0 votes
1 answer
163 views

bash appear on top of my terminal

I don't know why but since this morning, I have the complete bash path in my terminal, every time I open it. I don't know how to remove it? thanks bash: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/...
James78's user avatar
  • 145
5 votes
3 answers
3k views

Wildcard in PATH (environment variable)

I have a bunch of apps installed locally in my home directory. In order for them to be globally available I add them to PATH in .bashrc: PATH="$PATH:/home/user/apps/app1/bin" PATH="$...
php_nub_qq's user avatar
2 votes
2 answers
759 views

Get the Absolute Path from feh

The feh command allows you to view images within a folder recursively: feh --recursive --auto-zoom While viewing images, it also allows you to associate custom commands with keys 0-9 on your keyboard....
Lonnie Best's user avatar
  • 5,175
1 vote
1 answer
481 views

Why not prepend user directory to PATH?

For user scripts, the usual advice is to append their directory to $PATH in one's .profile: PATH="$PATH:$HOME/.myscripts" # or .bin or whatever Apparently that is safer than prepending it: ...
Jortstek's user avatar
  • 243
0 votes
1 answer
543 views

`type` command inside bash script, is not showing all paths

When I type echo "${PATH}" | tr -s ':' '\n' | nl from inside a bash script and at the terminal I get the same result: 1 /home/nikhil/Documents/Git/Cs/Architecture/bin 2 /home/...
Porcupine's user avatar
  • 2,056
1 vote
2 answers
1k views

Accidentally over-wrote LD_LIBRARY_PATH

I'm operating Ubuntu 20.04 on WSL2, and a little new to the bash syntax. I overwrote the LD_LIBRARY_PATH when following a set of CUDA installation instructions, which specified to update as follows: $ ...
Sue Doh Nimh's user avatar
0 votes
1 answer
3k views

Unable to run file from command line after adding to PATH

So I have a function that I wish to run from my command line. cat foo.sh #!/bin/bash echo foobar I export it to my PATH variable and change to a different directory. export PATH=${PATH}:/home/usr/...
Ctat41's user avatar
  • 23
-2 votes
2 answers
470 views

Kali Linux - run './pycharm.sh' by running 'pycharm' in terminal

Currently I need to access the folder in my desktop, and then a bin subfolder to reach ./pycharm. So I want to automate all of: cd Desktop cd pycharm-community-2021.3.1 cd bin ./pycharm.sh to pycharm ...
ThomasReiner's user avatar
0 votes
1 answer
546 views

Adding directory path to a log file name

Am writing script using bash. I have a name for a log file log and want to prepend a directory path $destin. But $destin can either end with / or without /. log="$destin/$log"
Pietru's user avatar
  • 393
0 votes
0 answers
1k views

python virtualenv activation in bashrc causes environment variables to be overwritten

I have a virtual environment which I usually activate by default in my bashrc via source ~/.venv/env/bin/activate. This has been working fine on an old MacBook Air and Linux Desktops and servers (I ...
Joff's user avatar
  • 383
1 vote
1 answer
651 views

Need to set a new default path for command in Linux

Basically, what the title says. I'm setting up a new version of LUA and HAProxy under my user account in Redhat, so the bin directory that contains it is /home/user1/testing/usr/local/bin. I've ...
SVill's user avatar
  • 133
1 vote
2 answers
2k views

Fixing PATH on BASH / WINDOWS

I'm running Windows 10, and have BASH terminal in VisualStudioCode. My problem is that commands such as LS do not work. After some googling, i found that using this command fixes it: export PATH=/usr/...
Przemek's user avatar
  • 11
0 votes
0 answers
25 views

The weird order when concating variables and string with '_' [duplicate]

I want to concatenate a variable and a string. while read subject; do pathproc=/projects/guo_lab/cbis/users/yang/DICA_result echo ${pathproc}/${subject}"_"weight done < /projects/...
GUANGMING YANG's user avatar
3 votes
2 answers
1k views

Where is the login shell path set for /user/games etc..?

When I launch a terminal in ubuntu I get following path on echo $PATH /home/myuser/anaconda3/condabin:/home/myuser/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/...
Sreeraj Chundayil's user avatar
6 votes
1 answer
6k views

Command not found in zsh, but found in bash

I'm using zsh on ubuntu and I created a symlink for bat as so: ln -s /usr/bin/batcat /home/user_name/.local/bin/bat hitting ls -l from ~/.local/bin shows: lrwxrwxrwx 1 tux tux 15 May 19 13:47 ...
Haris Muzaffar's user avatar
1 vote
2 answers
463 views

This command: ". .bashrc" has resulted in: “-bash: /usr/bin/whoami: Argument list too long” whenever I try to execute any command

While following instructions at a forum post to install something over ssh at an external machine, I executed the following command without thinking: . .bashrc I have never seen the command before ...
Ant's user avatar
  • 121
0 votes
3 answers
953 views

How to change .profle and have the setting effective without sourcing .profile every time or needing to reboot?

If it is on the Mac or on Ubuntu, sometimes we have to add a path to PATH: https://stackoverflow.com/questions/33725639/npm-install-g-less-does-not-work-eacces-permission-denied # add the following to ...
nonopolarity's user avatar
  • 3,109
0 votes
0 answers
22 views

Enforcing native Python3 to show up when I enter Python in CentOS 7

I have installed both native Python 3 and Anaconda Python 3 however, at the moment, I want to use native Python 3 when I enter $ python. Do you know why it defaults to Anaconda Python 3 and how can I ...
Mona Jalal's user avatar
3 votes
2 answers
2k views

Debian 10: Setting PATH variable inside .profile does not work

I'm currently running Debian 10 Xfce and I would like to update my PATH variable to include /opt/bin and ~/.local/bin. As per these - 1 2 answers, I put the following lines in my ~/.profile file: if [ ...
RogUE's user avatar
  • 207
1 vote
1 answer
1k views

PATH execution via alias

I do not understand how PATH & $PATH is treated by the shell. Consider the following: alias testCMD=PATH=$PATH I can run $ testCMD vim But it would not work if I declared alias testCMD=$PATH Also ...
Marcellvs's user avatar
  • 111
1 vote
1 answer
420 views

How do i print the path of excuatable in echo [duplicate]

SO i have a Bash Script like this and goal is to determine the path of an executable file and i want to print it, here is what i'm doing #!/bin/bash exepath=which exe echo "$exepath" Now ...
The beginner guy's user avatar
0 votes
2 answers
423 views

I sourced my .bashrc file and now get: “-bash: /usr/bin/whoami: Argument list too long” so that I can't execute any commands. Using ssh

I use an external HPC system via ssh. Today I tried to install "ASE" a Python code for dealing with atoms. I followed instructions to modify my .bashrc file but kept getting ...
NTS's user avatar
  • 111
1 vote
2 answers
3k views

bashrc export path problem

I opened my .bashrc file using nano .bashrc in terminal. After that, at the end of the .bashrc file I added following lines export PATH= "$PATH:$HOME/moltemplate/moltemplate” export PATH= "$...
muzaffar rafique's user avatar
0 votes
0 answers
343 views

.bashrc modifications not taking effect

A very basic question that I can't figure out the answer to: in my $HOME/.bashrc I'm setting up all sorts of stuff including the PATH environment variable, e.g. via: export PATH="$PATH:$HOME/bin&...
Peter's user avatar
  • 205
0 votes
1 answer
345 views

PATH behaves differently in bash and csh when directory is execute only?

We have some applications in various subdirectories that we limit access to by unix group, and we want them to be execute only. So, for example, if we want members of the "chem" group to ...
Peter's user avatar
  • 3
0 votes
1 answer
1k views

Bash script fails with spaces in absolute path variables

I am running following script to copy files from CIFS share mounted on the system to another destination system. The absolute path of CIFS share contains few spaces and so it fails for that path, I ...
Bela's user avatar
  • 15
-1 votes
1 answer
4k views

Somethings wrong with .bashrc

I read a tutorial about how to add a folder to PATH. I added the below to the .bashrc file: export PATH=/opt/aseprite/build/bin When I tried to use source ./.bashrc from zsh I got this error /home/...
oreo-icecream's user avatar

15 30 50 per page
1
2 3 4 5 6