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

Similar Threads
thread Thread Starter Forum Replies Last Post
UUID Command in Terminal? cdoolittle17 Mac Programming 3 Feb 28, 2014 12:54 PM
Terminal Command to Set File Permissions SahtuDEC Mac OS X Server, Xserve, and Networking 3 Feb 28, 2014 12:24 AM
Mail command in Terminal lukestroh OS X Mavericks (10.9) 6 Dec 2, 2013 08:14 PM
Terminal command andynewfriends Mac Basics and Help 0 Jun 11, 2013 01:25 PM
Need command in terminal chadteetzen OS X 1 Jun 8, 2012 10:55 PM

Forum Jump

All times are GMT -5. The time now is 12:34 AM.

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

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