LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-05-2013, 03:17 PM   #1
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Rep: Reputation: Disabled
question about bash, bashrc


Ok I am trying to view my bashrc file and am going crazy. I typed in ~/.bashrc and it tells me it is a directory and won't show me the directory or what it contains.
I am using virtual Fedora, would this be the reason or is it I am typing the wrong command. Is there a good place to learn these commands other than some cheesy ebook I downloaded? I copy and pasted the MAN but it is not helping me on the bashrc. I am sure I will like Linux but I sure hate it now. LOL I am ready to give up on it.
I looked here but it is not explaining this very well.http://www.giglig.com/technology/what-is-bashrc-file I think I need to take a class or something. This is frustrating me because all the commands seem to lead to nothing.
 
Old 05-05-2013, 03:21 PM   #2
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
computergirl121,

in order to VIEW the .bashrc file, you need to either do
Code:
cat .bashrc
or
Code:
more .bashrc
DON'T give up!!!

HTH
 
1 members found this post helpful.
Old 05-05-2013, 03:30 PM   #3
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
Ok I found a way to access bashrc directory. I typed in vi .bashrc
Is this the only way to access the bashrc directory?
 
Old 05-05-2013, 03:32 PM   #4
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
OHHHHH I see it is the same command but one is able to alter the command which is the vi and the cat shows the directory. I got it. Thank you so much
 
Old 05-05-2013, 03:37 PM   #5
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
no problem!!

Yes, vi is an editor (there are many others as well, but vi is my preferred editor). cat is short for concatenate which displays the contents of a file. more will display the contents of a file as well, put it will pause at the end of each page and allow you to advance line-byline (by pressing enter) or advance a page at a time (by pressing the space bar).

This is a great community for learning how to use Linux....hang in there, we are here to help!
 
1 members found this post helpful.
Old 05-05-2013, 03:38 PM   #6
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thank you
 
Old 05-05-2013, 03:39 PM   #7
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
So if I didn't have a bashrc directory then I could create one in the vi portion?
 
Old 05-05-2013, 04:17 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
~/.bashrc is not a directory. And yes, if you don't have one you can create it using any text-editor you want (or if you want even with commands like echo).

Last edited by TobiSGD; 05-06-2013 at 02:12 AM. Reason: fixed obvious nonsense caused by posting when tired
 
Old 05-05-2013, 04:21 PM   #9
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I doubt very much that it's a directory; that error was just an artifact of your previous mistaken command. bashrc is a text file, and yes, you can create one if it doesn't already exist.

vi (which is actually vim on Linux, it starts out in vi-compatibility mode), is a very complex mode-based text editor, and its style of workflow is almost certainly something you aren't used to. I highly recommend learning it, but the learning curve is very, very steep. You won't really be able to function effectively with it without several hours of training. Heck, most beginners can't even figure out how to close it again after they've started it ( type ":q!" ).

This is a good introduction to vim:
http://swaroopch.com/notes/vim/


And see this excellent little essay for why you should learn it:
http://www.rudism.com/s/vimcreep

You can also run vimtutor when you're ready to learn.

But anyway, for beginners I recommend using nano instead, which is a more traditional cli text editor that has decent on-screen help. Or open it up in whatever gui editor you have available, like gedit or kwrite.
 
1 members found this post helpful.
Old 05-05-2013, 06:16 PM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,342

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
As above, that's a file (not a dir) you're talking about.
For a dir, use the 'ls' cmd.
Bookmark & read
http://rute.2038bug.com/index.html.gz - cli tutorial
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

The vi cmd is usually aliased to the vim cmd. They are both editors: vim => vi Improved, basically more capable, but still contains all the vi cmds.
The learning curve can be a bit steep, BUT it (vi) is available/part of the default install in just about all versions of *nix (Linux, *BSD, HP-UX, Solaris, AIX, OS/X), so its worth learning the basics imho.
Ditto rescue environments will have vi built-in.
 
1 members found this post helpful.
Old 05-05-2013, 08:03 PM   #11
Fred Caro
Senior Member
 
Registered: May 2007
Posts: 1,007

Rep: Reputation: 167Reputation: 167
Dear computergirl121,
~/ is usually your home directory, so looking there for bashrc will not find it. Bashrc is in the /etc directory; so cd /etc followed by ls will show you all in the /etc directory, then 'cat' what is available to view it. You can then invoke a gui editor to change that file as root.

fred.
 
1 members found this post helpful.
Old 05-05-2013, 08:57 PM   #12
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
LOL, I meant file thanks for correcting me it keeps me on my toes. I will try what you recommended and see what happens.
 
Old 05-06-2013, 07:38 AM   #13
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
changing /etc/bashrc will force any changes to everyone that logs in. If you are only wanting to change the login for your personal profile, ~/.bashrc is the file you will want to change. This isn't a big issue on a personal machine at home, but it can be in the business world where many different users log into a specified machine.

The . in front of .bashrc makes it a hidden file, so you will not see it if you do an
Code:
ls ~/
you would have to use
Code:
 ls -la ~/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash not reading bashrc exvor Linux From Scratch 2 11-30-2009 12:04 AM
[SOLVED] .bashrc cant get rid of (bash 3.2#) hunnykhan3 Linux - General 11 08-24-2009 10:39 AM
Bash scripting question with find and grep and .bashrc - a multi year problem brfindla Linux - Software 9 08-24-2009 09:54 AM
/etc/bash.bashrc sulekha Ubuntu 1 11-05-2008 06:58 AM
/etc/profile vs. /etc/bash.bashrc jbrashear Debian 3 03-11-2004 03:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration