LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-01-2007, 06:31 AM   #1
staph
LQ Newbie
 
Registered: Feb 2007
Posts: 7

Rep: Reputation: 0
Question How do I use an editor?


Hello,

I'm somewhat new to linux. I've been experimenting with different distributions over the past few years and I have now come to have debian on my computer. My hda is already partitioned correctly for a dual boot, so I am OK there. I am trying to get my computer to mount my fat32 and ntfs partitions on boot, and I need to edit /etc/fsab to do that. I opened up fstab in the editor "gvim" that debian came with to try and add my other partitions, but I'm not really sure how to use gvim. I have no experience with editors at all.

Can anybody tell me the basics or tell me where I can learn the basics of using an editor?

Thanks
 
Old 02-01-2007, 06:45 AM   #2
netstrider
Member
 
Registered: Jan 2007
Location: South Africa
Distribution: Debian 4.0 Etch
Posts: 71

Rep: Reputation: 15
An editor is just another 'Notepad' some have more features though but for editing fstab you will need nothing more than your most basic text-editor because you're only going to add a line or two then save the file.

Personally I like nano...
 
Old 02-01-2007, 06:45 AM   #3
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
Google is your Friend!

http://www.cis.ksu.edu/~bhoward/vi/

gVIM is a development from VIM is a development from vi....
 
Old 02-01-2007, 07:04 AM   #4
hpoppe
LQ Newbie
 
Registered: Oct 2004
Location: Oslo, Norway
Distribution: Debian / BackTrack
Posts: 12

Rep: Reputation: 0
If you're serious about

learning how to work in a non-GUI environment, or just would like to know how to use an editor you have several choises. The absolutely oldest is ed. I'd stay away from this... Most people end up in a flame war over the two most well known editors vi(m) og emacs. I'm not going to go into that, it's a matter of choise and preference. My choise is vi or vim (VIsual or VIsual iMproved). Most people, if you like vi will install vim and then you will have vim pretend to be vi, or you can invoke vim and have more choises.
Install vim (on a Debian sysem: apt-get install vim vim-doc (and perhaps ctags if you will be writing code). If you are not using a Debian based distro, maybe you should consider doing so, or find out how to install packages on your system. There is not packaging system that beats apt. ;-)
Once this is done go to a command line, write vim-tutor (enter).
This will start the vim-tutor, it takes an hour or two to go through thoroughly, but it is very well worth the time. It's important to notice that the vim-tutor is ment to be teaching interactively, that means you should DO THE THINGS IT TELLS YOU TO ;-) Perhaps more than once too...
Other choises are nano, joe, jed, emacs and more.
The good thing about vi or vim is that you will find it on almost any *nix system, and it's very powerful.
 
Old 02-01-2007, 09:02 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
OP just wants a simple editor---I second the choice of nano--seems to be on every distro I have installed lately.
What's in the GUI menus?--eg kate, kedit, or gedit? All of these can be called (as root) from the command-line to edit a config file.
 
Old 02-01-2007, 10:00 AM   #6
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptops: Debian Jessie XFCE, NAS: OpenMediaVault 3.0
Posts: 1,355

Rep: Reputation: 70
Quote:
Originally Posted by pixellany
What's in the GUI menus?--eg kate, kedit, or gedit? All of these can be called (as root) from the command-line to edit a config file.
Thats what I usually do, and it has always worked fine for me.

IGF
 
Old 02-01-2007, 02:43 PM   #7
staph
LQ Newbie
 
Registered: Feb 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for all the help- I think I am going to try the tutor program soon. However, I tried opening fstab in gedit and noticed that it was listed as being Read Only. Is there any way I can change that so I can actually edit fstab?
 
Old 02-01-2007, 02:50 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by staph
Thanks for all the help- I think I am going to try the tutor program soon. However, I tried opening fstab in gedit and noticed that it was listed as being Read Only. Is there any way I can change that so I can actually edit fstab?
You have to run it as root.
Code:
su to become root
gedit /etc/fstab
OR
sudo gedit /etc/fstab
 
Old 02-01-2007, 03:41 PM   #9
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptops: Debian Jessie XFCE, NAS: OpenMediaVault 3.0
Posts: 1,355

Rep: Reputation: 70
Quote:
Originally Posted by staph
Thanks for all the help- I think I am going to try the tutor program soon. However, I tried opening fstab in gedit and noticed that it was listed as being Read Only. Is there any way I can change that so I can actually edit fstab?
What distro are you using?
 
Old 02-01-2007, 10:26 PM   #10
staph
LQ Newbie
 
Registered: Feb 2007
Posts: 7

Original Poster
Rep: Reputation: 0
I'm using debian.

I was able to edit fstab as root, but not so succesfully. The partition I am trying to access from debian is hda5, which is a fat32 partition. Here's what I added to the fstab:

/dev/hda5 /mnt/hda5 vfat
defaults,errors=remount-ro 0 1

I basically copied what it said to mount hda2 (which is where debian is installed) and changed it to de/hda5, changed the mount point, and changed the fs type to vfat. When I try to mount this from a terminal using the command "mount /mnt/hda5" it tells me:

mount: wrong fs type, bad option, bad superblock on /dev/hda5,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Hmm?
 
Old 02-01-2007, 10:38 PM   #11
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Quote:
I've been experimenting with different distributions over the past few years...
Obviously, you haven't experimented very vigorously. There are a lot of easier distros than Debian for a person who doesn't know how to use an editor. I think Ubuntu and some of the others recognize all the partitions and write out the fstab for you.
 
Old 02-01-2007, 11:54 PM   #12
wildar
Member
 
Registered: Jan 2007
Distribution: Mandriva 2008, Mandrake 2005, Ubuntu 8.04.1
Posts: 239

Rep: Reputation: 30
In my opinion, need to take a step back and not fuse with fstab till resolve why hda5 wont mount.
Quote:
mount: wrong fs type, bad option, bad superblock on /dev/hda5
If system responds with wrong fs type, need to verify the file type. This can be done using fdisk from root, just be careful not to delete any partitions.
Code:
# fdisk /dev/hda
command (m for help): p
This should list the partitions on /dev/hda. Here's what mine looks like as an example:
Code:
Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        2567    20619396    f  W95 Ext'd (LBA)
/dev/hda2   *        2568        4526    15735667+   7  HPFS/NTFS
/dev/hda3            4527        7296    22250025    7  HPFS/NTFS
/dev/hda5               1        2551    20490844+  83  Linux
/dev/hda6            2552        2567      128488+  82  Linux swap / Solaris
Look at your hda5, what's the file type?
 
Old 02-02-2007, 11:12 AM   #13
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 532

Rep: Reputation: 78
To learn how to use the "VI" editor
Code:
vimtutor
Why do i recommand this editor?
Because it's nearly the only one which will be available in all linux distributions by default.
It will probably look weird to use at the begining but you will see, it's extremely powerfull.

Angel.
 
  


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
about the vi editor zwylinux Programming 12 05-28-2006 01:35 PM
vi editor IwantLINUX Linux - Newbie 8 06-28-2005 11:28 AM
What editor can be used on RH 9.0 satimis Red Hat 2 06-17-2004 06:36 PM
VI Editor rakriege Linux - General 2 02-04-2004 08:57 PM
Which editor? keymoo Linux - Newbie 26 11-11-2002 12:46 AM


All times are GMT -5. The time now is 08:05 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration