Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

where is the file .bashrc or .zshrc? #1107

Closed
jameshentai opened this issue Aug 23, 2016 · 8 comments
Closed

where is the file .bashrc or .zshrc? #1107

jameshentai opened this issue Aug 23, 2016 · 8 comments
Assignees
Labels

Comments

@jameshentai
Copy link

I all done till this part: Add to your .:

export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"

i can't find file name .bashrc or .zshrc. Do you know where that localed, basiclly?

@rwhogg
Copy link
Contributor

rwhogg commented Aug 23, 2016

Your home directory (i.e. $HOME). It may not exist if you use a shell without any customizations, in which case you can just create it.

What shell do you use? We don't explicitly list files for every shell in known use, but Bash and zsh aren't the only options.

@jameshentai
Copy link
Author

summaly, .bashrc or .bash_profile?

@rwhogg
Copy link
Contributor

rwhogg commented Aug 23, 2016

.bashrc.

My mistake, the current recommendation is to use .bash_profile

@jameshentai
Copy link
Author

Can you help me this question; http://superuser.com/questions/1116635/how-can-i-complete-the-tutorial-install-linuxbrew-on-linux, that my question

@rwhogg
Copy link
Contributor

rwhogg commented Aug 23, 2016

Yes, .bashrc is a hidden file (and so are .zshrc, .bash_profile, etc. - basically any file starting with a period).

That means it won't show up in nautilus by default. IIRC the default key command to show hidden files in Nautilus is Ctrl-h.

As for the permissions issue, try chmod +w on the file you're trying to edit.

Are you trying to do a system-wide installation for the benefit of multiple users, or just for your own personal use? If you're trying to do it for just yourself, you should not need sudo at all. If you're doing it for the benefit of multiple users, it may make more sense to put the instructions in a system-wide file like /etc/profile than in $HOME/.bash_profile.

(EDITED: I thought .bashrc was the recommended file to use. It's actually .bash_profile.)

@jameshentai
Copy link
Author

Can you tell me again step by step that part ( my first question ). Add 3 line to .bashrc or .bash_profoile? why in http://linuxbrew.sh/ , it say : echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.bash_profile ,( not .bashrc) !!?
Is i edit that 3 line and put "blueberry" into, is i'm right? i actually did it. but it don't work. like you see, http://imgur.com/a/BF2YJ.

@rwhogg
Copy link
Contributor

rwhogg commented Aug 23, 2016

My apologies; I'm having difficulty understanding the question is all.

There are some differences between putting the lines into .bashrc vs. .bash_profile, but either should work.

Editing the 3 lines to say "/home/blueberry" instead of "$HOME" is perfectly fine, since you've installed Linuxbrew into /home/blueberry/.linuxbrew. If blueberry is the username of the user you normally use, then doing this is unnecessary but harmless. If blueberry is a username that you reserve for administrative use, and you intend to use Linuxbrew from a different user (for example, james), then changing "$HOME" into "/home/blueberry" is actually necessary.

Are you confused because .bashrc (or .bash_profile, etc.) does not exist in /home/blueberry/.linuxbrew? Assuming you use blueberry for normal day-to-day use, it should exist at /home/blueberry/.bashrc, not /home/blueberry/.linuxbrew/.bashrc.

One other thing: you need to either quit or reload your shell after executing the instructions before you can start installing stuff with brew. The easiest technique is to just quit your terminal emulator and then start it up again.

I hope you're not getting frustrated. We try our best to make Linuxbrew a comfortable experience for new users, but occasionally that can be kind of difficult.

@maxim-belkin
Copy link
Contributor

@jameshentai:

  1. echo is a shell command. (shell is bash or zsh or whatever)
  2. echo command is used to write something to the terminal (so that you can read it).
  3. echo 'something' > file writes something to file. If file exists, this command overwrites it
  4. echo 'something' >> file appends something to the end of the file. That is, it does not overwrite it.
  5. .bashrc and .bash_profile are special files used by bash shell. Like any other .something file in Linux, these files do not show up by default in programs like nautilus. Use terminal (konsole in KDE, terminal in GNOME) and type ls -a to see ALL files, including these "hidden" ones.
  6. .bash_profile on Linux systems is read only once - when you log in. Variables defined in this file will be "lost" unless you export them using the export command.
  7. .bashrc is read every time you launch terminal/konsole.
  8. $HOME is an environment variable that is equal to /home/$USER
  9. $USER is your username. Hence, no need to write bluberry (which is your username). Use just $HOME.

Assuming that you installed linuxbrew in your home directory ($HOME) and used the standard "hidden" folder .linuxbrew, open a terminal and type (line by line):

(
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
) >> ~/.bashrc

If you do that, you can start using linuxbrew right away. You CAN use .bash_profile instead of .bashrc but remember that in that case you would have to log out (Ctrl + Alt + Backspace) and log back in for changes to take effect.

@maxim-belkin maxim-belkin self-assigned this Aug 24, 2016
@rwhogg rwhogg closed this as completed Feb 23, 2017
@Linuxbrew Linuxbrew locked and limited conversation to collaborators Mar 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants