Old 06/14/2009, 03:40 AM   #1 (permalink)
Member
 
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Opening files within command line?

Hey everybody, sorry for the amateurish question, but how do you get a file open from within the command line?

For instance, i want to edit the devmode enabler to make it visible, and i know i have to edit this file: /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js


but, when i enter the command
root@castle:/home/user# vi /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js

it simply displays the contents within the command window, leaving me unable to edit it. How do I get them to open within a text editor or something?
sspster is offline   Reply With Quote
Old 06/14/2009, 03:49 AM   #2 (permalink)
Member
 
Join Date: May 2009
Posts: 446
Thanks: 27
Thanked 246 Times in 50 Posts
Default

I was wondering the same thing. I was going to enable SFTP, but I don't think I should have to, just to edit a file.
buyrihn is offline   Reply With Quote
Old 06/14/2009, 03:50 AM   #3 (permalink)
Member
 
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I'm just rooting via usb on a mac. Hopefully it won't have to get that complicated. Most of the instructions i see imply that no file browser is needed.
sspster is offline   Reply With Quote
Old 06/14/2009, 04:15 AM   #4 (permalink)
Member
 
Join Date: Jun 2009
Posts: 226
Thanks: 8
Thanked 46 Times in 22 Posts
Default

You just have to learn how to use vi, it has an insert mode to change the actual file. I would suggest finding a vi tutorial online if you really want to learn the basics of how it works.
joshewah is offline   Reply With Quote
Thanked By 2:
Old 06/14/2009, 04:20 AM   #5 (permalink)
Member
 
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

So if i install a VI client, entering

vi /usr/palm/applications/com.palm.app.devmodeswitcher/appinfo.json

should open the file within Vi instead of just displaying the contents in the terminal window?
sspster is offline   Reply With Quote
Old 06/14/2009, 05:20 AM   #6 (permalink)
Member
 
mdmogren's Avatar
 
Join Date: Jun 2009
Posts: 382
Thanks: 29
Thanked 35 Times in 26 Posts
Default

Quote:
Originally Posted by sspster View Post
So if i install a VI client, entering

vi /usr/palm/applications/com.palm.app.devmodeswitcher/appinfo.json

should open the file within Vi instead of just displaying the contents in the terminal window?
when you see the contents you are using vi - vi defaults to command mode - move to the location where you want to make an edit and press i to change to insert mode - start by googling: vi how to
mdmogren is offline   Reply With Quote
Old 06/14/2009, 05:23 AM   #7 (permalink)
Member
 
Join Date: Jun 2009
Posts: 226
Thanks: 8
Thanked 46 Times in 22 Posts
Default

Quote:
Originally Posted by sspster View Post
So if i install a VI client, entering

vi /usr/palm/applications/com.palm.app.devmodeswitcher/appinfo.json

should open the file within Vi instead of just displaying the contents in the terminal window?
sspster,
It has vi built in. You just need to know what to type to edit what its displaying is what I meant.

I found a tutorial on youtube:
YouTube - Vi - Vim Tutorial. Howto video for the amazing vim editor.
(vi on the pre won't have the line numbers like theirs but it should work the same)

vi in 10 minutes - part 1
There are lots more tutorials on the web if that ones not clear enough.
joshewah is offline   Reply With Quote
Old 06/14/2009, 10:22 AM   #8 (permalink)
Member
 
Join Date: Jun 2009
Posts: 198
Thanks: 2
Thanked 7 Times in 7 Posts
Default

Does the pre allow sftp connections? I was trying to transfer some files but couldn't seem to connect. If I transfer a file through usb where is this in root so I can move the file?
hchavarria is offline   Reply With Quote
Old 06/14/2009, 11:12 AM   #9 (permalink)
Member
 
Join Date: Jun 2009
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Personally, I find vi incredibly difficult to use (the thing you're missing is both having perms to edit the file -- sudo will fix this, and you need to hit i in vi in order to enter INSERT mode).
But jove (a slimmed down emacs build) is available in the optware repo, so I would recommend that if you're looking for something a little easier. And nano is there as well, which I would say is the simplest of the unix command line editors.
apolzon is offline   Reply With Quote
Old 06/14/2009, 01:38 PM   #10 (permalink)
Member
 
Join Date: May 2009
Posts: 446
Thanks: 27
Thanked 246 Times in 50 Posts
Default

Quote:
Originally Posted by apolzon View Post
Personally, I find vi incredibly difficult to use (the thing you're missing is both having perms to edit the file -- sudo will fix this, and you need to hit i in vi in order to enter INSERT mode).
But jove (a slimmed down emacs build) is available in the optware repo, so I would recommend that if you're looking for something a little easier. And nano is there as well, which I would say is the simplest of the unix command line editors.
I tried to use nano on the Pre, but it didn't work. You mention it being available in the optware repository- could you explain?
buyrihn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:16 PM.

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0