LinuxQuestions.org
Review your favorite Linux distribution.
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-16-2003, 01:04 PM   #1
eddcrossman
LQ Newbie
 
Registered: Jan 2003
Posts: 21

Rep: Reputation: 15
command line editing


this may be a very stupid question but how can i edit a file from the command line, ie when xwindows isn't running??
 
Old 02-16-2003, 01:07 PM   #2
Silent Bob
Member
 
Registered: Feb 2003
Location: Ireland
Distribution: Debian
Posts: 56

Rep: Reputation: 15
cd to the directory with the file in it and then type
pico <filename>

OR you can type pico /full/path/to/file from any directory.

There are lots of different editors you can use:

pico or nano are probably your best bet when you are still getting used to GNU/Linux

You might also want to try vim or emacs when you get more comfortable. They both take time to get used to but are very powerful editors.
 
Old 02-16-2003, 01:16 PM   #3
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Some distros may not have pine installed by default (pico is part of the pine package).

You may have midnight commander installed. Command mc, navigate to the file and press F4 for a nice editor.
 
Old 02-16-2003, 02:25 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
Some advice: Learn vi , it may be the only editor available if something wrong happens to your system at times.
 
Old 02-16-2003, 02:53 PM   #5
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Quote:
Originally posted by trickykid
Some advice: Learn vi , it may be the only editor available if something wrong happens to your system at times.
Mandrake is one of these distros
 
Old 02-16-2003, 03:01 PM   #6
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Some quick tips to get you started with vi:
vi filename # opens 'filename' in vi
i # begins edit mode, when you are done:
[esc] [:]
wq # save and exit
w # save but don't exit
q! # exit but don't save
 
Old 02-16-2003, 03:11 PM   #7
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Learning vi
 
Old 02-16-2003, 08:37 PM   #8
yngwin
Member
 
Registered: Dec 2002
Location: China
Distribution: Arch
Posts: 359

Rep: Reputation: 33
I personally like nano, and I'm happy Gentoo uses it as standard editor. It's small and you can easily add it to your system.
 
  


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
Command Line Image Editing fractal_chaos Linux - Software 8 10-03-2005 06:33 PM
scheme interpreter w/ command-line editing nazdrowie Programming 1 12-03-2004 09:20 AM
vi style command line editing in gnuplot 3.7 sirclif Linux - Software 0 09-20-2004 01:47 PM
editing XF86Config from command line flum Linux - Newbie 4 09-10-2003 05:12 PM
Editing files at command line Goatdemon Linux - Newbie 15 08-12-2002 12:56 PM


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