Thank you Jeff and Mike

To ask another question if I may?

Does it matter if no existing PATH entry is seen in /home/paul/.bashrc at this time?

Where do 'echo $PATH' varibles come from are they built into bash upon installation of the OS?
 --------> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games <--------

Will placing 'export Path=$PATH:/opt/firefox' in the '/home/paul/.bashrc' file at the bottom of the .bashrc file or top or middle matter?

Allow me to not get the 'firefox not installed use apt-get to install' message when I try to load firefox from the bash terminal?

Does it matter if Path-PATH is lower case or upper case at the beginning of the string?

Thanks,

Date: Tue, 25 Mar 2014 17:11:03 -0500
From: chapinjeff at gmail.com
To: tclug-list at mn-linux.org
Subject: Re: [tclug-list] About Firefox 28 on Ubuntu 10.04

Replies inline.


On Tue, Mar 25, 2014 at 3:58 PM, paul g <pj.world at hotmail.com> wrote:




You have helped tremendously 

paul at paul-desktop:~$ sudo updatedb
paul at paul-desktop:~$ locate -b firefox
/home/paul/.cache/mozilla/firefox
/home/paul/.mozilla/firefox
/home/paul/.mozilla/firefox/bkbapzwn.default/extensions/firefox at ghostery.com.xpi

/home/paul/.mozilla/firefox/bkbapzwn.default/jetpack/firefox at ghostery.com
/home/paul/Downloads/tor-browser_en-US/.mozilla/firefox
/home/paul/Downloads/tor-browser_en-US/App/Firefox/firefox

/home/paul/Downloads/tor-browser_en-US/App/Firefox/firefox-bin
/opt/firefox
/opt/firefox/firefox
/opt/firefox/firefox-bin
/usr/share/app-install/desktop/firefox-greasemonkey.desktop
/usr/share/app-install/desktop/firefox-launchpad-plugin.desktop

/usr/share/app-install/desktop/firefox-ubuntu-it-menu.desktop
/usr/share/app-install/desktop/firefox-webdeveloper.desktop
/usr/share/app-install/desktop/firefox.desktop
/usr/share/app-install/icons/firefox-greasemonkey.xpm

/usr/share/app-install/icons/firefox-installer.png
/usr/share/app-install/icons/firefox-launchpad-plugin.xpm
/usr/share/app-install/icons/firefox-themes-ubuntu.xpm
/usr/share/app-install/icons/firefox-ubuntu-it-menu.png

/usr/share/app-install/icons/firefox-webdeveloper.xpm
/usr/share/icons/firefox.jpg
/usr/share/ubuntu-docs/common/prepare-firefox-startpage-translations
/usr/share/ubuntu-docs/libs/img/firefox-3.5.png
paul at paul-desktop:~$ 

 
paul at paul-desktop:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 

Obviously /usr/opt is not shown in the above output. 

paul at paul-desktop:~$ sudo updatedb
paul at paul-desktop:~$ locate -b bash

/bin/bash
/bin/rbash
/etc/bash.bashrc
/etc/bash_completion
/etc/bash_completion.d
/etc/apparmor.d/abstractions/bash
/etc/bash_completion.d/bash-builtins
/etc/bash_completion.d/gvfs-bash-completion.sh

/etc/bash_completion.d/pk-completion.bash
/etc/skel/.bash_logout
/etc/skel/.bashrc
/home/paul/.bash_history
/home/paul/.bash_logout
/home/paul/.bashrc

to add the entire following line----> export Path=$PATH:/opt/firefox


Do I include the word 'export'? 

Yes. PATH is simply a variable used to hold the list of directories. You *can* do just 'PATH=$PATH:/usr/opt', but including the export is a better, more recommended way to do it. This will immediately change the value for the currently logged in shell session *only*



For a deep system wide approach would '/home/paul/.bashrc' be the correct file to edit in this case that sticks for all sessions?


Editing '/home/paul/.bashrc'  would be *account* wide -- all *new* shell sessions you open will have the updated value -- but not the existing ones. This should also include the shell used in Alt-F2, but I don't use that feature, so I am not sure.


To go 'system wide' you would usually edit /etc/bashrc or add a new script to /etc/profile.d/ with the changes you want. These correspond to .bashrc and .bash_profile -- the .bashrc in your home directory will *include* /etc/bashrc, so these changes will appear for all users. Various distrobutions handle these two files differently. I am used to Red Hat based systems, and I have always been told use the bashrc files for functions and aliases, and .bash_profile for environmental variables -- but I tend to put everything in .bashrc anyway. 


These two files behave slightly differently, and rather than explain it myself, I am going to refer you to a resource I found via my good friend Google:
http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html


Jeff



I am not seeing a '.bash_profile' file after using 'locate -b bash' I read you said I could edit either of the 2 files. Maybe the .bash_profile file is on different distro's I do not know yet.




 Thanks






> Date: Tue, 25 Mar 2014 12:54:39 -0500
> From: mbmiller+l at gmail.com
> To: tclug-list at mn-linux.org

> Subject: Re: [tclug-list] About Firefox 28 on Ubuntu 10.04
> 
> On Tue, 25 Mar 2014, Jeff Chapin wrote:
> 
> > On Mon, Mar 24, 2014 at 5:45 PM, paul g <pj.world at hotmail.com> wrote:

> >
> >> why when I do a 'locate firefox' in terminal many entries show up? A 
> >> few more than listed below but this is the just of it.
> >
> > The 'locate' command uses a pre-created database of file names. If you 

> > have not re-run 'updatedb' after creating a file, 'locate' will not know 
> > about it. Locate will return any file that matches the pattern you gave 
> > it.
> 
> Also, with "locate", the default is to match any pattern in the entire 

> path to a file or directory.  Example:
> 
> locate bin | less
> 
> The name of the file or directory itself, excluding parent directories in 
> its path, is called its basename.  There is an option in "locate" to 

> search only the basename.  From "man locate":
> 
>    -b, --basename
>          Match only the base name against the specified patterns. This
>          is the opposite of --wholename.

> 
>    -w, --wholename
>          Match only the whole path name against the specified patterns.
>          This is the default behavior.  The opposite can be specified
>          using --basename.

> 
> I have a lot of small files on my system, but I still see a very dramatic 
> drop in the number of matches when I use the -b option:
> 
> $ locate bin | wc -l
> 28241
> 
> $ locate -b bin | wc -l

> 4826
> 
> 
> It's not quite relevant to the question about "locate", but I'll mention 
> that there is a program called "basename" (and another called "dirname"):

> 
> 
> Usage: basename NAME [SUFFIX]
>    or:  basename OPTION
> Print NAME with any leading directory components removed.
> If specified, also remove a trailing SUFFIX.
> 
>        --help     display this help and exit

>        --version  output version information and exit
> 
> Examples:
>    basename /usr/bin/sort       Output "sort".
>    basename include/stdio.h .h  Output "stdio".
> 

> 
> 
> Usage: dirname NAME
>    or:  dirname OPTION
> Print NAME with its trailing /component removed; if NAME contains no /'s,
> output `.' (meaning the current directory).
> 

>        --help     display this help and exit
>        --version  output version information and exit
> 
> Examples:
>    dirname /usr/bin/sort  Output "/usr/bin".
>    dirname stdio.h        Output ".".

> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list

 		 	   		  

_______________________________________________

TCLUG Mailing List - Minneapolis/St. Paul, Minnesota

tclug-list at mn-linux.org

http://mailman.mn-linux.org/mailman/listinfo/tclug-list




-- 
Jeff Chapin
President, CedarLug, retired
President, UNIPC, "I'll get around to it"
President, UNI Scuba Club
Senator, NISG, retired


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list at mn-linux.org
http://mailman.mn-linux.org/mailman/listinfo/tclug-list 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20140325/410b4a68/attachment-0001.html>