LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I use an editor? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-use-an-editor-524629/)

staph 02-01-2007 05:31 AM

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

netstrider 02-01-2007 05:45 AM

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...

jimbo1954 02-01-2007 05:45 AM

Google is your Friend!
 
http://www.cis.ksu.edu/~bhoward/vi/

gVIM is a development from VIM is a development from vi....

hpoppe 02-01-2007 06:04 AM

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.

pixellany 02-01-2007 08:02 AM

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.

IndyGunFreak 02-01-2007 09:00 AM

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

staph 02-01-2007 01:43 PM

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?

pixellany 02-01-2007 01:50 PM

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


IndyGunFreak 02-01-2007 02:41 PM

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?

staph 02-01-2007 09:26 PM

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?

rickh 02-01-2007 09:38 PM

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.

wildar 02-01-2007 10:54 PM

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?

angel115 02-02-2007 10:12 AM

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.


All times are GMT -5. The time now is 06:19 PM.