DESKTOP

The Terminal : Command line interface for the Mac, Unix foundation

8/12/2012 9:12:05 AM

Command line interface for the Mac

The Terminal is a command line interface for the Mac that will allow you to type in commands that access hidden features or preferences and is quite similar to the command prompt in Windows. Be warned, however. The level of control and customization is so great that you can do damage to your system if you do not know what you are doing. Disabling certain tools or settings may not always be a great idea. Despite these caveats, the Terminal is an invaluable tool that will beeter customize your Mac so you can personalize your experience fully.

Description: The Terminal is a command line interface for the Mac that will allow you to type in commands that access hidden features or preferences and is quite similar to the command prompt in Windows.

The Terminal is a command line interface for the Mac that will allow you to type in commands that access hidden features or preferences and is quite similar to the command prompt in Windows.

Unix foundation

According to Apple's Terminal page, the Terminal offers Mac users access to UNIX through its command-line infrastructure. OS X, the Mac operating system being employed in current Macs, is based on a UNIX foundation. OS X comes with a user interface layer over UNIX. Apple describes the relationship and the way the Terminal bridges the gap between the Mac user interface and traditional UNIX commands thusly:

"OS X is built on an industry-standard UNIX foundation. The Terminal application allows you to access the complete UNIX environment using standard commands, tools, and scripting languages. Terminal includes numerous shortcuts that will save you time. For example, you can copy and paste text commands, and if you drag files or folders into Terminal, the correct file path appears on the command line. You can customize Terminal with your favorite fonts and background colors, including transparent, as well as manage multiple sessions from a single window using tabs."

Description: Unix was an operating system founded in 1969 by AT&T's Bell Laboratories

Unix was an operating system founded in 1969 by AT&T's Bell Laboratories

Unix was an operating system founded in 1969 by AT&T's Bell Laboratories, according to Unix.org. In 2007, Apple's Mac OS X was certified to UNIX 03 with the release of Mac OS X 10.5 Leopard. This means that OS X is officially certified as an UNIX-based system and all the Mac machines running OS X are certified Unix systems. However, to truly access the UNIX foundation and environment, with all that it can offer, you will need to doit through the Terminal on OS X. There are other operating systems that are often called UNIX-like, but may not share certification or be considered in the same OS family at all. You can read more about the benefits of Unix certification here.

Description: The UNIX foundation makes them useful for other purposes as well that even IT types can benefit from.

The UNIX foundation makes them useful for other purposes as well that even IT types can benefit from.

This is why Macs are not just systems aimed at graphic professionals or creative types. The UNIX foundation makes them useful for other purposes as well that even IT types can benefit from. To put it plainly, when you open the Terminal, you are accessing UNIX. On the other hand, when you use the standard Mac interfaced and desktop in recent Macs, it's OS X. Keep in mind that in order to get the UNIX compiler, you will need to register with Apple as a developers and install XCode on you're Mac. Alternatively, you will need to install XCode tools from extra/optional tools on your Mac installer disc. XCode is a C development environment. It will allow you to develop in C or C++. You will be able to compile programs and do many other things beyond just simple command line options or changing fonts and the like. With that said, let's look at some basic commands the Terminal has to offer.

Navigating the terminal

In order to open the Terminal, go to your Applications folder on your Mac. Then, go to Utilities. If you are a Mac OS X 10.6 Snow Leopard user. If you use OS X 10.7 Lion, you can go to Launchpad and find it under utilities as its directory is /Applications/ Utilities/Terminal.app. The terminal icon looks like this and you can actually place it on your Mac's Dock:

Description: If you use OS X 10.7 Lion, you can go to Launchpad and find it under utilities as its directory is /Applications/ Utilities/Terminal.app.

If you use OS X 10.7 Lion, you can go to Launchpad and find it under utilities as its directory is /Applications/ Utilities/Terminal.app.

Once, you launch Terminal, you will be shown a command line interface that looks something like this:

Description: Terminal — bash 80x24
Terminal — bash 80x24

Now you will be able to type commands from the Terminal and have access to many new options. For instance, if you are a Lion user and want to empty out your Launchpad with a single command, rather than having to delete the apps one-by-one, enter this command line into the Terminal:

sqlite3 ~/Library/Application\ Support/ Dock/*.db "DELETE from apps; \DELETE from groups WHERE titleo"; DELETE from items WHERE rowid>2;" \&& killall Dock

Now, if you performed this command correctly, your Launchpad should be empty and you should be able to add the apps you want yourself. You do this by dragging them from your desktop to the Launchpad icon on your dock (if it is ocated there). To reset the Launchpad back to defaults, enter this command line:

rm ~/Library/Application\ Support/ Dock/*.db

If you are a Lion user, another useful Terminal command is to allow your graphical interface to show you the Library folder. Apple has hidden it in the home directory by default in Lion. A lot of your user data in apps, especially games, is stored in this folder, yet it is hidden from view by default. To make it visible, enter this command line in the Terminal:

chflags nohidden ^/Library

Now, let’s take a look at some commands that are not just for Lion users, but OS X users as a whole. If you want to hide specific folders, like the way that the Library folder is hidden for Lion users, you can enter this command line in the Terminal:

chflags hidden /path/to/folder/

This is a general path. To be more specific, if you have a folder named "Games" in your Desktop directory, you would enter this command in the Terminal:

chflags hidden ~/Desktop/Games/

The folder will even become hidden from the finder once you enter this command line. This will include other files associated with the folder or located inside it. You can hide it further, by excluding the folder from Spotlight indexing. To do this, go to Spotlight from system preferences in the Apple menu. Then, click on the Privacy tab and drag & drop the folder you want to exclude form indexing - as anything in that list is hidden. This is how this process should look like (you can read more about this here):

However, keep in mind that anyone who knows how to operate the Terminal will still be able to find the folders you've hidden.

To access the hidden folders, you will need to go to Finder. Once in Finder, enter these keystrokes: Command+Shift+G. This will bring up a "Go to the folder" window. Now, enter the same path as you did when you hid it:

If you want to see a list of all the hidden folders on your system from the Terminal, enter this simple command line:

LS/

This means either an uppercase "L" or a lowercase "I" (don't be confused by some guides with the I almost looking like a 1). Also make sure to have a space between the s and the / symbol.

Conclusion

There are endless when it comes to the Terminal it will truly allow you to open up your Mac and it will no longer feel like a propriety OS. Apple is often regarded as a company that has a closed ecosystem. However, for users who truly know learn how to navigate around the Mac environment with UNIX and the Terminal, this perception will change. There are many other commands to consider and look up if you want to truly learn how to use the Terminal. This was just a small taste what it can offer.

Other  
 
Most View
The Performance Review Of AMD Radeon HD 7790 And Nvidia GeForce GTX 650 Ti BOOST (Part 4)
That’s Online Entertainment (Part 2)
The Best Deals On Cool-Running Components And Passive Cooling Solutions
Samsung Galaxy Camera VS The Rest (Part 2)
Panasonic Lumix DMC-G6 Camera Review (Part 2)
Apple - Celebrating 7 Years Of Success
Windows 7 : Command-Line and Automation Tools - The MS-DOS Environment
Logitech T400 Zone Touch Mouse - Maybe A Little Rearranging?
Mac Application Security (Part 1)
Intel’s Next Unit Of Computing Review - The Future Desktop Or Another Nettop? (Part 2)
Top 10
SQL Server 2012 : Consolidating Data Capture with SQLdiag - Getting Friendly with SQLdiag (part 2) - Using SQLdiag as a Service
SQL Server 2012 : Consolidating Data Capture with SQLdiag - Getting Friendly with SQLdiag (part 1) - Using SQLdiag as a Command-line Application
SQL Server 2012 : Consolidating Data Capture with SQLdiag - The Data Collection Dilemma, An Approach to Data Collection
SQL Server 2012 : Troubleshooting Methodology and Practices - Data Analysis, Validating and Implementing Resolution
SQL Server 2012 : Troubleshooting Methodology and Practices - Data Collection
SQL Server 2012 : Troubleshooting Methodology and Practices - Defining the Problem
SQL Server 2012 : Troubleshooting Methodology and Practices - Approaching Problems
Windows 8 : Accessing System Image Backup and Recovery Functionality with Windows Backup, Cloud Backup
Windows 8 : Using the Windows 8 Recovery Tools (part 2) - Push Button Reset
Windows 8 : Using the Windows 8 Recovery Tools (part 1) - Creating a System Recovery Disc, Booting to the Windows Recovery Environment