From the computer of: qmchenry
(337 recipes)
Created: Oct 01, 2007
When confronted with the task of editing your .profile file, there are several options. For the seasoned veteran, editing this file is simply a matter of dropping to a shell, editing in vi, and :wq'ing. There is the pico editor which, for a command line editor, is a little friendlier than vi. For the majority of users, editing a text file is warmer and fuzzier using a GUI text editor like TextEdit.
The problem is that files starting with a period are hidden from listings in the Finder windows, so trying to find a hidden file to open using TextEdit will not get you very far. While many third party editors provide options for opening hidden files, if you don't have one installed, you can easily open these hidden files using TextEdit which is a part of OS X.
To open your .profile file, for example, start the Terminal application (searching for 'terminal' using Spotlight and clicking on the Terminal application is an easy way to do this). Since Terminal will put you in your home directory by default and .profile is in your home directory, you can edit .profile simply by typing:
If the file you want to edit is in another directory, you'll need to cd into that directory first or specify the full path name in front of the filename.
The open command used above uses the same mechanism to open a file using a default application that the Finder does when clicking on a file. If for some reason the default application for the file you are trying to edit has changed to something that doesn't work for editing, you can force open to use TextEdit by adding the -a option:
Make your changes to the file and save it and you're done. One compulsory note of caution: hidden files are often hidden for a reason. They tend to hold configuration information that, if incorrectly changed, could cause one or more applications to misbehave. Tread lightly and make backups before changing.
Subscribe to the Tech-Recipes Newsletter
You can get tips like this delivered in your email every week!
We will never, ever sell your email address or spam you.
1 Recipe comments: View comments
OS X: Easily edit hidden configuration files with TextEdit by davak
Related recipes:
OS X: Edit a file using TextEdit as root or superuser
OS X: Change your PATH environment variable
Mac OS X monitor messages during boot
Mac OS X gain root/superuser access using sudo
Mac OSX: Delete a user account
Mac OS X install gcc compiler
OS X Leopard: Flush or Clear the DNS Cache
Mac OS X change the default web browser
OS X Leopard: Create new user account with parental controls
Mac OS X enable fast user switching
Sponsored links
Login
Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.Search
Tech Recipes
· Home
· Mac OS X
· Solaris
· Windows
· Programming
· UNIX
· Cisco
· MySQL
· Google
· Instant messaging
· Add recipes
· Leave feedback
· Recommend us
· RSS Syndication
Hot recipes
Make XP look like Windows Vista / Longhorn for free!
XP: Small, Free Way to Use and Mount Images (ISO files) Without Burning Them
Hacks to Beat Rapidshare Download Limits and Waiting Time
How Do I Use or Open Bin, Cue, or ISO Files?
Vista: Should I Install 64-bit or 32-bit Version? (x64 vs x86)
XP: kill a Windows process from the command line with taskkill
MySpace: Hack to Download Any Song on MySpace
How to patch up your UXtheme.dll file in XP home or pro
Who's Online
There are currently, 2409 guest(s) and 1 member(s) that are online.
You are Anonymous user. You can register for free by clicking here
Information
Wish to advertise with us?
All logos and trademarks in this site are property of their respective owner. The comments and forum posts are property of their posters, all the rest © 2003-2007 by QD Ideas, LLC.
Users of this site are legally bound by the Terms and conditions and Disclaimer. Do not use this web site if you do not agree with these policies.
The members, admins, and authors of this website respect your privacy.
Page Generation: 0.77 Seconds
Fri Jul 4 6:08:06 2008