Learning Unix for OS X: Going Deep With the Terminal and Shell
Format: PDF / Kindle (mobi) / ePub
Think your Mac is powerful now? This practical guide shows you how to get much more from your system by tapping into Unix, the robust operating system concealed beneath OS X’s beautiful user interface. OS X puts more than a thousand Unix commands at your fingertips—for finding and managing files, remotely accessing your Mac from other computers, and using freely downloadable open source applications.
If you’re an experienced Mac user, this updated edition teaches you all the basic commands you need to get started with Unix. You’ll soon learn how to gain real control over your system.
- Get your Mac to do exactly what you want, when you want
- Make changes to your Mac’s filesystem and directories
- Use Unix’s find, locate, and grep commands to locate files containing specific information
- Create unique "super commands" to perform tasks that you specify
- Run multiple Unix programs and processes at the same time
- Access remote servers and interact with remote filesystems
- Install the X Window system and learn the best X11 applications
- Take advantage of command-line features that let you shorten repetitive tasks
. . . . . . . . . . . . . . 153 Running a Command in the Background Checking on a Process ps top Canceling a Process kill killall Launching GUI Applications open Useful Starting Options for Use with open Making open More Useful 154 155 155 157 160 160 161 163 163 165 165 8. Taking Unix Online. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Remote Logins Web Access Remote Access to Other Unix Systems Transferring Files scp and
application has to wait its turn. In that case, your session will resume after a few moments. You should not try to “un-hang” the session by entering extra com‐ mands, because those commands will all take effect after the Terminal comes back to life. If your display becomes garbled, press Control-L. In the shell, this will clear the screen and display the prompt. In a full-screen program, such as a text editor, this keyboard shortcut redraws the screen. If the system doesn’t respond for quite a
already in the /etc directory, let’s look to see if there’s any mention of firewalls by using grep: $ grep firewall *conf asl.conf:# Facility com.apple.alf.logging gets saved in appfirewall.log asl.conf:? [= Facility com.apple.alf.logging] file appfirewall.log file_max=5M all_max=50M Within the set of configuration files, there were two matches, as shown. In the output, the matching filename is shown, followed by a colon, followed by the actual matching line in the file. You can search a lot
your keyboard while you’re learning vi is unquestionably the Escape key (Esc), located at the upper-left corner of your keyboard. If you’re in Insert mode, Esc switches you back to Command mode, and if you’re in Command mode, it’ll beep to let you know that all is well. Use Esc often, until you’re completely comfortable keeping track of what mode you’re in. Jump-start your learning by using OS X’s included vimtutor: just type in vimtutor on the command line for a guided tour of the vi editor.
case, the Terminal): Pipes and Filters | 145 $ sort food Afghani Cuisine Bangkok Wok Big Apple Deli Isle of Java Mandalay Sushi and Sashimi Sweet Tooth Tio Pepe's Peppers By default, sort arranges lines of text alphabetically. Many options control the sorting, and Table 6-1 lists some of them. Table 6-1. Some sort options Option Description -n Sort numerically (for example, 10 sorts after 2); ignore blanks and tabs. -r Reverse the sorting order. -f Sort upper- and lowercase together.