Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-26-2005, 02:22 PM   #1
LQ Newbie
Registered: Oct 2005
Posts: 3

Rep: Reputation: 0
Exiting vi and finding a .bashrc file

Hey everyone... well I'm fairly new to this, but I'm struggling to do 2 things.

I've managed to open a vi window, but can't recall how to save and close it. Is there a common listing of commands, maybe a url someone can point me in the direction of?

2. How do I find the .bashrc file? I have root access, but I am currently logged on as a normal user... and I need to find it asap.

Many thanks

Old 10-26-2005, 02:39 PM   #2
LQ Newbie
Registered: Oct 2005
Posts: 15

Rep: Reputation: 0
To close the vi editor (assuming your in a terminag);

first get to the editor command prompt by a :

to close a file :q!

to save a file :wq!

The .bashrc should be in you home directory. At the prompt do a cd
That will bring you your HD
Do a a ls -la <--that will list ALL files in you HD
To see just your "dot" files type the following, ls -ld .*

Hope this helps.

Last edited by ghostmac; 10-26-2005 at 02:40 PM.
Old 10-26-2005, 02:42 PM   #3
Pete M
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
Write and close


Close and abort changes

.bashrc is a hidden file in your home directory "." because the dot makes it hidden

To view on the command line

$ ls -a
Old 10-26-2005, 02:43 PM   #4
LQ Newbie
Registered: Oct 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Ghostmac... thank you very much! I have played with unix commands about 6 years ago... and it just came back to me as you were writing!

"To see just your "dot" files type the following, ls -ld .*" this I didn't know very helpful!

Cheers and plenty of beers for Ghostmac!
Old 10-26-2005, 02:46 PM   #5
LQ Newbie
Registered: Oct 2005
Posts: 3

Original Poster
Rep: Reputation: 0
And some beers for Pete M!!!

You guys are quick with responses and theyre accurate too... most forums are so slow... that I don't bother. So thank you.

Old 10-26-2005, 03:32 PM   #6
Registered: Mar 2005
Location: UK
Distribution: Slackware
Posts: 794
Blog Entries: 2

Rep: Reputation: 30
It's worth your while maybe running:


in a terminal. It's a really good tutorial.
Old 10-27-2005, 04:39 AM   #7
Registered: Aug 2005
Distribution: Ubuntu Intrepid and Meerkat, formerly used Debian 3.1 (Sarge) with Gnome Desktop
Posts: 353

Rep: Reputation: 37
or instead of using vi, use 'pico' instead. Pico is much easier to use.
Old 10-27-2005, 05:19 AM   #8
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Rep: Reputation: 144Reputation: 144
You can find an overview on vi shortcuts for example in the rute Linux tutorial. It shows many more tasks and comes very handy even if you tried vimtutor but forgot how to something in vi:
Old 10-29-2005, 05:17 PM   #9
Registered: May 2005
Posts: 378

Rep: Reputation: 33
The real way out of vi is "<ESC>ZZ" (the escape is optional if you *know* you're already in command mode). Using the colon method shows newbiness.
Old 10-29-2005, 05:18 PM   #10
Registered: May 2005
Posts: 378

Rep: Reputation: 33
Oh, and if you use "ls -A" it'll exclude . and .. from the dotted file list.


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
Bashrc file Gins Linux - General 19 09-06-2005 04:19 PM
can't the file bashrc Paxmaster Linux - Software 10 01-02-2005 07:58 AM
where could i find the file bashrc Paxmaster Linux - Software 4 07-15-2004 02:47 PM
where is the .bashrc file??? xenia Linux - Newbie 8 05-08-2004 01:11 PM
bashrc file Linvilidiot Linux - Newbie 3 03-11-2004 05:08 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:28 AM.

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