Linked Questions

20
votes
2answers
105k views

Setting PATH vs. exporting PATH in ~/.bash_profile [duplicate]

What's the difference and which is better to use when customizing my bash profile? Documentation on the export command is scarce, as it's a builtin cmd. Excerpt from version 1 of my ~/.bash_profile: ...
1
vote
3answers
26k views

Add PATH to .bashrc [duplicate]

I am trying to install Anaconda on my Linux machine. Right or wrong, at the end of the instructions they say to add this line to the file .bashrc in your home directory: export PATH="/home/...
0
votes
2answers
433 views

Path is there, but cannot call one program without specifying path [duplicate]

Possible Duplicate: How to correctly add a path to PATH? I installed "perf" on Linux. But I can only use it by specifying the path: ~/bin/perf I checked path by using echo and I found /bin is ...
1
vote
1answer
2k views

Adding Postgres bins to PATH: should I `export`? [duplicate]

I'm on a Mac, but this seems like a UNIX/Linux question. I just installed Postgres.app, and the documentation says to add the /bin directory that ships with Postgres.app to your PATH by adding the ...
1
vote
1answer
762 views

Program installed to `/home/username/bin` and added to path… not launching [duplicate]

I just installed newer versions of grep and vim to my local ~/bin directory. I have the path added via PATH=$PATH:$HOME/bin in my .bash_profile. When I try to run either, the version installed in /...
0
votes
2answers
417 views

Different PATH formats for .bash_profile [duplicate]

There are few different formats I have seen so far: With quotes and brackets: PATH="/usr/local/bin:${PATH}" With quotes only: PATH="/usr/local/bin:$PATH" None: PATH=/usr/local/bin:$PATH Export ...
0
votes
2answers
299 views

What is the difference between adding to PATH on the CLI vs in bashrc [duplicate]

In an online video lecture the teacher has explained how to add to PATH both on the command line and via .bashrc, and has indicated that the proper way of doing this is through .bashrc but has not ...
0
votes
1answer
259 views

How can I use ifuse command in a bash script? [duplicate]

When I enter this command in a terminal window, it works as expected: ifuse "/home/sadi/mnt" But it is ineffective when used in a bash script run via a .desktop file. What can I do to use it like ...
0
votes
0answers
332 views

How to edit $PATH? [duplicate]

After searching, I can't still figure out how to edit $PATH. Now its value is: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/hduser/hadoop/bin:/...
1
vote
0answers
29 views

Prepending vs. Appending $PATH [duplicate]

I've been installing some software to a new VM today, and started wondering about the PATH variable. Some of the installation scripts I poked through would append to $PATH, and others would prepend $...
0
votes
0answers
21 views

How to customize debian to run kali tools without using katoolin? [duplicate]

I was installing tools like Snort, Nikto,kismet and I was asked if to run those tools as a root user. But people are suggesting not to run as a root user and in debian these tools did not run as a ...
262
votes
4answers
203k views

Why does my shell script choke on whitespace or other special characters?

Or, an introductory guide to robust filename handling and other string passing in shell scripts. I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some ...
43
votes
16answers
25k views

Remove duplicate $PATH entries with awk command

I am trying to write a bash shell function that will allow me to remove duplicate copies of directories from my PATH environment variable. I was told that it is possible to achieve this with a one ...
111
votes
1answer
38k views

When is double-quoting necessary?

The old advice used to be to double-quote any expression involving a $VARIABLE, at least if one wanted it to be interpreted by the shell as one single item, otherwise, any spaces in the content of $...
55
votes
2answers
33k views

Where should a local executable be placed?

I have an executable for the perforce version control client (p4). I can't place it in /opt/local because I don't have root privileges. Is there a standard location where it needs to be placed under $...

15 30 50 per page