Author Topic: How To Edit A File In Terminal  (Read 9427 times)

Petra

  • Newbie
  • *
  • Posts: 4
    • View Profile
How To Edit A File In Terminal
« on: April 25, 2006, 08:57:46 am »
Hello,

I'm a newbie using Terminal on the C3100.

In many How-To's the writer assumes that I should have enough experience in bash/sh and editing text files from the Terminal.
I've searched the internet and this user group for days but I still don't understand editing text files from Terminal or bash/sh stuff.

Please, can someone explain to me how it works?
Or perhaps do you have links to simple websites so I can learn it?

Thank you veeeeery much  

Petra

alijames

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • http://
How To Edit A File In Terminal
« Reply #1 on: April 25, 2006, 09:47:21 am »
Quote
Hello,

I'm a newbie using Terminal on the C3100.

In many How-To's the writer assumes that I should have enough experience in bash/sh and editing text files from the Terminal.
I've searched the internet and this user group for days but I still don't understand editing text files from Terminal or bash/sh stuff.

Please, can someone explain to me how it works?
Or perhaps do you have links to simple websites so I can learn it?

Thank you veeeeery much   

Petra
[div align=\"right\"][a href=\"index.php?act=findpost&pid=124490\"][{POST_SNAPBACK}][/a][/div]

Hi,

You can use 'vi'

Just type 'vi <filename>'

Key commands etc can be found via googling for 'vi commands'

Or if you prefer a GUI type editor, try Zeditor.

Cheers,

Alistair

SL-C3100 + Cacko 1.23
Netgear WLAN
Pharos LAN
Alistair James

C3100 PdaXii13 Akita (with Full Hdimage)
Ambicom CF WLAN
Pharos CF LAN
Socket CF Bluetooth
Kingston 2GB SD
ZTek USB->Serial

bluedevils

  • Hero Member
  • *****
  • Posts: 1284
    • View Profile
    • http://
How To Edit A File In Terminal
« Reply #2 on: April 25, 2006, 10:12:24 am »
The main new concept with using vi is that there are two modes.  edit mode and command mode.  Edit mode is when you whatever you type goes into your document and command mode is when whatever you type is used to position curser, enter into edit mode, delete characters, save the file, exit...

The cancel button on the zaurus acts as the esc button on a normal keyboard and will always exit you from edit mode back into command mode.
I'm now an iphone user and use my zaurii as serial terminals, perl and shell scripting and when I need 640x480 screens

sl-c3100/pda cacko 1.23 | sl-6000l/needs battery | sl-c760/server pdaxrom rc12 | Former sl-5500/tkcrom owner (sister's birthday gift)

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
How To Edit A File In Terminal
« Reply #3 on: April 25, 2006, 10:17:21 am »
just install pico. it's like the old DOS edit program  much easier to use than vi, but then again, not as powerful
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

bluedevils

  • Hero Member
  • *****
  • Posts: 1284
    • View Profile
    • http://
How To Edit A File In Terminal
« Reply #4 on: April 25, 2006, 10:22:23 am »
and vi is the default editor on many *nix systems including the Z.  The sooner you learn the basics of vi, the better you will be in the long run.
I'm now an iphone user and use my zaurii as serial terminals, perl and shell scripting and when I need 640x480 screens

sl-c3100/pda cacko 1.23 | sl-6000l/needs battery | sl-c760/server pdaxrom rc12 | Former sl-5500/tkcrom owner (sister's birthday gift)

uth

  • Full Member
  • ***
  • Posts: 106
    • View Profile
How To Edit A File In Terminal
« Reply #5 on: April 25, 2006, 10:25:54 am »
My personal favorite editor is 'jed'.  I'm going to have to compile it for the Z and post it one of these days.

jed is sort of a light-weight emacs clone.   It features color syntax highlighting, and also has a menu accross the top so you don't need to remember the emacs key-strokes.

The two-mode concept of vi drives me nuts.  Can't tell you how many text files I screwed because I forgot that I wasn't in edit mode.    

Quote
and vi is the default editor on many *nix systems including the Z. The sooner you learn the basics of vi, the better you will be in the long run.

I agree it's worth learning vi, since it's always going to be available when nothing else is.  That doesn't mean you have to like it.    
« Last Edit: April 25, 2006, 10:27:25 am by uth »

jfv

  • Sr. Member
  • ****
  • Posts: 437
    • View Profile
How To Edit A File In Terminal
« Reply #6 on: April 25, 2006, 10:35:09 am »
The reason this information is not easily found on this forum and why perhaps the OP did not find it on the web is because it is not Zaurus specific but common to all Linux (indeed Unix) systems. Searching on google for linux basics or linux introduction is likely to produce thousands of hits.

Felipe
SL 5000 D  and C860 Sharp ROM
Too many accessories...

bluedevils

  • Hero Member
  • *****
  • Posts: 1284
    • View Profile
    • http://
How To Edit A File In Terminal
« Reply #7 on: April 25, 2006, 10:54:42 am »
And that is the truth.  On my linux boxes I usually use kwrite for things (fluxbox menu config) that I edit often and use alot of cut and paste.

Quote
I agree it's worth learning vi, since it's always going to be available when nothing else is.  That doesn't mean you have to like it.   
[div align=\"right\"][a href=\"index.php?act=findpost&pid=124513\"][{POST_SNAPBACK}][/a][/div]
I'm now an iphone user and use my zaurii as serial terminals, perl and shell scripting and when I need 640x480 screens

sl-c3100/pda cacko 1.23 | sl-6000l/needs battery | sl-c760/server pdaxrom rc12 | Former sl-5500/tkcrom owner (sister's birthday gift)

Cresho

  • Hero Member
  • *****
  • Posts: 1609
    • View Profile
    • http://home.earthlink.net/~cresho/
How To Edit A File In Terminal
« Reply #8 on: April 25, 2006, 01:46:57 pm »
now if you really don't want to mess with the terminal and preffer an editor instead, just install either

zeditor_3.2.2english_arm.ipk
hold icon down for a few seconds to open a pop up window and check "execute with root privilege" remove checkmark magnify.  when you start it up, change the font size. and now you can edit your files like in notepad.

or you can also use
simple-edit_1.0.3_arm.ipk
hold icon down for a few seconds to open a pop up window and check "execute with root privilege" and use the pull down to "view all files" when you search and it will allow you to view all files in directories and you can pretty much edit anything.
Zaurus C-3200 (internal 8gb seagate drive) with buuf icon theme, cacko 1.23 full,  and also Meanie's pdaxqtrom-Debian/Open Office
Zaurus SL-5500 Sharp Rom 3.13 with steel theme
pretec pocket pc wi fi
ambicom bt2000-cf bluetooth-made in taiwan
simpletech 1gb cf
pny 1gb sd
patriot 2gb
ocz or patriot 4gb sd(failed after 2 weeks)only on z
creative csw-5300 speakers in stereo
DigiLife DDV-1000 for video, Audio, Picture recording playable on the zaurus
Mustek DV4500-video recorder, pictures, voice record on sd for z

zaurusthemes.biz | ZaurusVideo | Zaurus Software

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
How To Edit A File In Terminal
« Reply #9 on: April 25, 2006, 02:55:27 pm »
simple edit is really, really nice, I had a segfault occur with pico running with sudo, so I switched to nano, wich to me looks the same. vi's dual mode, is a bit of a pain, no way of telling where the hell your at.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

Petra

  • Newbie
  • *
  • Posts: 4
    • View Profile
How To Edit A File In Terminal
« Reply #10 on: April 25, 2006, 04:38:29 pm »
Thanks to you all!
This helps me a lot.