Set Paths, Colors, Fonts & Aliases on a Linux System on a Macintosh

This article was provided by wikiHow, a wiki building the world's largest, highest quality how-to manual. Please edit this article and find author credits at the original wikiHow article on how to set paths, colors, fonts & aliases on a linux system on a macintosh. Content on wikiHow can be shared under a Creative Commons License.

Grade C Views 126
Last edited 2 months ago

Are you used to using a Linux machine and recently switched to Mac? If so, do you miss colored files (blue directories, green executables, etc.) and Emacs GUIs? Then you may want to customize your .cshrc file to make your life easier. These steps have been tested on a Mac running Mac OS X 10.4.9 and X11 (default installation).

Step 1  

Check the version of OS X running on your Mac. If it is different than the one listed above, these steps may not work or may need to be modified.

Step 2  

Download Emacs for free from http://www.gnu.org/software/emacs/.

Step 3  

Install X11.

Step 4  

Open your existing .cshrc file, usually located in /Users/

Step 5  

Copy the contents into a text file using TextEdit and save as custom_cshrc.txt. If you haven't modified it, the only thing that should be in there is: set path = ( /sw/bin $path /abin /usr/local/bin)

Step 6  

Next, set your colors.  

  • setenv TERM xterm-color
  • setenv CLICOLOR true
  • setenv LSCOLORS ExDxHxAxCxegedabagacad
 

Step 7  

You can customize these colors by changing the case (upper=bold, lower=normal) and the actual color.  

  • a black
  • b red
  • c green
  • d brown
  • e blue
  • f magenta
  • g cyan
  • h light grey
  • x default foreground or background

Step 8  

The order of the attributes are as follows:  

  • directory
  • symbolic link
  • socket
  • pipe
  • executable
  • block special
  • character special
  • executable with setuid bit set
  • executable with setgid bit set
  • directory writable to others, with sticky bit
  • directory writable to others, without sticky bit

Step 9  

The default is "exfxcxdxbxegedabagacad", i.e., blue foreground and default background for regular directories, black foreground and red background for setuid executables, etc.

Step 10  

Now set your aliases where 'alias' specifies that what follows will be an alias, 'la' is what you want to call it and ' 'ls -aF' ' (this MUST be in single quotes) is the actual command. Information beyond those characters, such as 'list all and file types', must be commented out using the pound sign if they are to be included.  

  • alias ls 'ls' list all files
  • alias la 'ls -aF' list all and file types
  • alias ld 'ls -ld' list directories
  • alias ll 'ls -lF' list <dir> style
  • alias lx 'ls -lXB' sort by extension
  • alias lk 'ls -lSr' sort by size
  • alias lc 'ls -lcr' sort by change time
  • alias lu 'ls -lur' sort by access time
  • alias lr 'ls -lR' recursive ls
  • alias lt 'ls -ltr' sort by date
  • alias lm 'ls -al | more' pipe through 'more'
  • alias . 'pwd' shows current directory
  • alias .. 'cd ..' goes back one directory
  • alias ../ 'cd ../' goes back one directory
  • alias ... 'cd ../..' goes back two directories
  • alias .../ 'cd ../../' goes back two directories
  • alias - 'cd -' goes to previous directory
  • alias / 'cd /' goes to the root directory
 

Step 11  

These are fun to play around with, use whatever alias you like that you will remember.

Step 12  

Finally, alias your programs so you don't have to type out the entire path every time you want to call a program.  

  • alias matlab '/Applications/MATLAB74/bin/maci/StartMATLAB.app/Contents/MacOS/StartMatlab'
  • alias emacs22 '/Applications/Emacs.app/Contents/MacOS/Emacs'

Step 13  

These locations are dependent on where you install Matlab and Emacs, these are simply default locations that the programs usually use to install.

Step 14  

Now save your text file again and move it to /Users//

Step 15  

Change the name of your original file from .cshrc to original_cshrc.txt.

Step 16  

Change the name of your custom file from custom_cshrc to .cshrc. This will allow you to revert back to the original if the custom file does not work.

Step 17  

To use this new startup file without restarting the program, type source .cshrc. If this doesn't work, simply type csh at your prompt and repeat the previous step of sourcing your file.

Step 18  

Your new custom modifications should now be set and working!

Tips

  • If your new custom file doesn't work and you can't figure it out, just rename your .cshrc file back to custom_cshrc.txt and your original_cshrc.txt back to .cshrc.
  • When setting colors, choose colors you can see clearly. If you have a white background don't use yellow, etc.
  • If the alias names specified above aren't logical, change them! Just make sure that the command doesn't already exist. You might be writing over a command...VERY bad.
  • By using the alias emacs22, you preserve the preset alias emacs to open the bundled version. This is important and 22 is used as the version number. So if you download Emacs version 25, alias it as emacs25.
  • Write down your new aliases on a sticky and affix it to the frame of you computer monitor until you learn them. DO NOT affix the sticky to your actual monitor, especially if it is a flat panel. This will RUIN the finish on the screen.

Warnings

  • Don't alias dangerous commands such as rm -rf or anything that could lead to changing settings or removing files. This could damage your data and or system. Just don't do it.
  • Have basic working knowledge of UNIX and computers before trying this, you must know how to troubleshoot problems else be stuck with a fried computer.
  • Always save your original so you can revert back if things go wacky.
  • Check your OS X version, if it doesn't match the one above things might not work.

Things You'll Need

  • Mac OS X Installation Disc 1 (to add on X11 if you haven't already).
  • Connection to the Internet (to download Emacs).
  • Some UNIX knowledge.

Via wikihow

DIY Ocular Assault Weapon

The latest in Graffiti-tech: How to write with your eyes. Via Instructables, "Behold the latest ocular assault weapon from the Graffiti Research Lab, openFrameworks, The Fat Lab and The Ebeling ...

Retro Electronics Papercraft For the Brazil '66 Crowd

Dan McPharlin has created some super-sweet retro electronics papercraft models. Click through to Dan's Flickr page to view the entire collection. Beautiful handmade cardboard models. Previously ...

Cai Guo-Qiang's (Literally) Explosive Art

Attention all WonderHowTo explosive-lovers, here is an artist that just may awe and inspire... China's Cai Guo-Qiang opts for more thrilling materials than traditional paint, clay or plaster, say ...

Roly-Poly Bridge

Heatherwick Studio's London based rolling bridge is an engineering marvel. Lots of fun, and immensely satisfying to watch (via YouTube, assuming you can't see it in person). From Heatherwick Studio: ...

Master Nerd Births Perfect Copy Cat Bot

Can't help but smile at this goofy, endearing nerd "master" (Vitalijus Rodnovas) guiding his copy-cat protege robot (coined Waldo). The rig allows Waldo to mimic Rodnovas' body movements in ...

loading...