LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 10-26-2005, 01:22 PM   #1
htalbot
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

Hamish
 
Old 10-26-2005, 01:39 PM   #2
ghostmac
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 01:40 PM.
 
Old 10-26-2005, 01:42 PM   #3
Pete M
Member
 
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

Code:
:wq
Close

Code:
:q
Close and abort changes

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

To view on the command line

Code:
$ ls -a
 
Old 10-26-2005, 01:43 PM   #4
htalbot
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, 01:46 PM   #5
htalbot
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.

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

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

vimtutor

in a terminal. It's a really good tutorial.
 
Old 10-27-2005, 03:39 AM   #7
greengrocer
Member
 
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, 04:19 AM   #8
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,644

Rep: Reputation: 145Reputation: 145
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:
http://rute.2038bug.com/node9.html.g...00000000000000
 
Old 10-29-2005, 04:17 PM   #9
eddiebaby1023
Member
 
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, 04:18 PM   #10
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

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


Reply



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

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

All times are GMT -5. The time now is 01:03 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