Tag Archives: SysAdmin

CLI – ln

The ln command allows you to make links in the filesystem. Specifically, it creates a local directory that points to the target file or directory. This allows you to

  • have a file or directory be virtually present in multiple locations, yet only have one copy taking up space and requiring maintenance
  • allow for content spread across multiple disk drives to appear as contiguous in the main drive.

The general use is with the -s option to specify a symbolic link. In the example below I create a symbolic link to the Pictures folder on the external drive D2, then show how it appears when the ls command is run.

Johns-Mac-mini:~ jpurvis$ sudo ln -s /Volumes/D2/Pictures Pictures
Johns-Mac-mini:~ jpurvis$ ls -l
total 8
drwx——   3 jpurvis  staff   102 Dec 28 14:32 Applications
drwxr-xr-x  71 jpurvis  staff  2414 Feb 19 23:43 Calibre Library
drwx——+ 13 jpurvis  staff   442 Mar 30 12:49 Desktop
drwx——+ 15 jpurvis  staff   510 Mar 29 16:38 Documents
drwx——+ 88 jpurvis  staff  2992 Mar 30 14:26 Downloads
drwx——@ 10 jpurvis  staff   340 Nov  6 11:22 Dropbox
drwx——@  8 jpurvis  staff   272 Mar 23 18:40 Google Drive
drwx——+ 71 jpurvis  staff  2414 Mar  6 09:24 Library
drwx——+ 12 jpurvis  staff   408 Nov  6 09:54 Movies
drwx——+  9 jpurvis  staff   306 Dec 15  2008 Music
lrwxr-xr-x   1 root     staff    20 Mar 30 14:45 Pictures -> /Volumes/D2/Pictures

The Apple Man page for the ln command can be seen here.


See my other CLI articles


The OS X Terminal

A key tool to the System Administrator or the more advanced user of any Unix/Linux/OS X system is the Command Line Interface (CLI) and that is accessed on OS X systems through the Terminal App. Apple includes the Terminal App with the Utilities. To open the Terminal App got to Finder >> Go >> Utilities >> Terminal.The OS X Terminal

When the Terminal opens by default it will be at the Home directory for the user. Now the user can enter any commands into the terminal for execution.

If you want to adjust the font size used, you can do so by using the Command+Plus (+) key combination to increase the font size, or Command+Minus (-) to decrease the font size. Using Command-Zero (0) will return the font size to the default.The OS X Terminal2

Through the Terminal Preferences you can also adjust the colors being used to find a background/foreground color combination to your liking. The example above is with the ‘Basic’ profile while the one below is using the ‘Homebrew’ profile.The OS X Terminal3

I find that the ‘Homebrew’ profile provied more contrast and makes the Terminal content easier to read.

A simple ‘Terminal Cheatsheet for Mac‘ gives an over view of keyboard shortcuts for the Terminal App., as well as the most common CLI commands you might use.


See my other SysAdmin articles