Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Mac Basics and Help

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 15, 2006, 11:18 AM   #1
tidyboy
macrumors newbie
 
Join Date: Dec 2006
Location: Coventry UK
Command to edit a file in terminal

hey guys

how do I edit a file in a terminal. What is the command?


Many Thanks
tidyboy is offline   0 Reply With Quote
Old Dec 15, 2006, 11:20 AM   #2
Queso
macrumors 603
 
Join Date: Mar 2006
Depends on what text editor you want to use. Personally I use vi, but it's a bit UNIX-y for traditional Mac folks.

Command would either be "vi <filename>" or "sudo vi <filename>" for system config files.

You can also use the Open command to open TextEdit, although that's not strictly in the Terminal, it just opens TextEdit from within it. "Open /Applications/TextEdit.app <filename>" will do the biz there.
Queso is offline   0 Reply With Quote
Old Dec 15, 2006, 11:22 AM   #3
yellow
Moderator
 
yellow's Avatar
 
Join Date: Oct 2003
Location: Portland, OR
If you prefer an editor that isn't used to spell 'evil', then try using pico.
For example:

sudo pico /etc/named.conf

Last edited by yellow; Dec 15, 2006 at 11:29 AM.
yellow is offline   0 Reply With Quote
Old Dec 15, 2006, 11:23 AM   #4
tidyboy
Thread Starter
macrumors newbie
 
Join Date: Dec 2006
Location: Coventry UK
Quote:
Originally Posted by dynamicv View Post
Depends on what text editor you want to use. Personally I use vi, but it's a bit UNIX-y for traditional Mac folks.

Command would either be "vi <filename>" or "sudo vi <filename>" for system config files.

You can also use the Open command to open TextEdit, although that's not strictly in the Terminal, it just opens TextEdit from within it. "Open /Applications/TextEdit.app <filename>" will do the biz there.
Thankyou :-)
tidyboy is offline   0 Reply With Quote
Old Dec 15, 2006, 11:46 AM   #5
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
tidyboy, since you have been asking about terminal commands, you may find this site valuable as you learn. Its just a bunch of man pages for the various commands.

http://www.ss64.com/osx/
jeremy.king is offline   0 Reply With Quote
Old Dec 15, 2006, 11:49 AM   #6
yellow
Moderator
 
yellow's Avatar
 
Join Date: Oct 2003
Location: Portland, OR
Or this one if you're new to command line life, a Darwin specific tutorial:

http://osxfaq.com/Tutorials/LearningCenter/index.ws
yellow is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Mac Basics and Help

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Need Command for Opening Files in Terminal Catfish Jones OS X 7 Sep 29, 2011 04:00 AM
App to edit .string files in iPad fa.ce iPad Apps 2 Aug 6, 2011 02:33 PM
"Permission Denied" when trying to open a file in Terminal Juventino OS X 11 Feb 12, 2011 04:46 PM
Edit a file in Terminal from Boot disc? bushtucker Mac Basics and Help 1 Sep 21, 2009 04:18 AM
how to compile Obj-c file in terminal uaecasher Mac Programming 18 Jul 30, 2009 08:41 AM


All times are GMT -5. The time now is 02:13 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC