Posts Tagged ‘command line’

Terminal: Browsing Applications

Mac OS X has an elegant way of installing and uninstalling applications, just drag an drop and application to your desired folder and you are done. But once in a while every 10 years or so you need to make a change manually but there aren’t any files to edit it was a just a single file. Well it isn’t, its actually a folder OS X just treats them differently then regular folders on you computer. If you need to edit a setting inside an application manually you can do so in command line (terminal).

To do it, open up a terminal and browse to the folder where the application is you can use the change directory command “cd”, you also don’t need to type the whole folder name just type a few characters and hit tab and it will complete it for you. Following is how Firefox looks on the inside.

$ ls /Applications/
.               Info.plist      PkgInfo         Resources
..              MacOS           Plug-Ins

Most applications has the same structure when it comes to organizing files.

$ ls /Applications/
CodeResources     Resources/
Info.plist                 PkgInfo                    version.plist
MacOS/                     PlugIns/

Files and executables are under ‘MacOS’ folder. This is where you should look for the file you are looking for. Another neat trick is, you don’t need to run an application from GUI (Graphical User Interface aka aqua). If you need to run Firefox from command line you can use…

$ /Applications/

Terminal: Stuck Trash

Ever empty your trash but stuck with a full trash icon or can not empty your trash because finder is complaining that files in it are in use.

If you want to get rid of it fire up a terminal and type

rm -rf .Trash/

A word of coution “rm -rf” will delete everything starting from the
provided folder without warning. it will not complain if the directory is
not empty. A typo like “rm -rf /” will cost you your whole drive.