The original flavor is the most well-known, but the company has now expanded to include all kinds of flavors, like bacon, queso. Learning about these Mac-only programs can make you more productive on the command line and help you bridge the gap between UNIX and your Mac.The blue Kraft box may be the most well-known boxed mac and cheese product, but if you ate a lot of mac and cheese growing up, you probably had some Velveeta Shells and Cheese in your pantry from time to time as well. But power users often aren’t aware that OS X comes with a number of its own text-based utilities not found on any other operating system. If you’re migrating from Linux, you’ll find many familiar commands work the way you expect.Open screenshot.png on an image will open that image in Preview. 1If you point open at a file instead, it will try to load the file with its associated GUI application. For instance, typing: $ open /Applications/Safari.app/…will launch Safari as if you had double-clicked its icon in the Finder. Exciting, right? But it really does come in handy as a command-line double-click. OpenOpen opens files, directories and applications. A simple shell configuration compatible for macOS & Linux.Update: Thanks to reader feedback, I’ve written about a few more commands in a follow-up post: (And eight hundred more).
![]() Pbcopy and pbpasteThese two commands let you copy and paste text from the command line. Remember that the integration between Finder and Terminal goes both ways – if you drag a file from Finder into a Terminal window, its full path gets pasted into the command line. This is especially useful for bringing up the current directory by typing open. Buku yasin dan tahlil pdf fileSo why not tap into its power from the command line?That’s exactly what mdfind does. There’s always the venerable UNIX find command, but OS X comes with its own killer search tool: Spotlight. You can easily capture the contents of a file: $ pbcopy > tasklist.txtMany a Linux power user has tried to use locate to search for files on a Mac and then quickly discovered that it didn’t work. Typing: $ ls ~ | pbcopy…will copy a list of files in your home directory to the OS X clipboard. ![]() I like to run this one on all the auto-update “helpers” created by Adobe apps and Microsoft Office.Launchd scripts are stored in the folllowing locations: ~/Library/LaunchAgentsTo see what goes into a launch agent or daemon, there’s a great blog post by Paul Annesley that walks you through the file format. Sudo launchctl unload will stop and unload running scripts, and adding the -w flag will remove those scripts permanently from your boot sequence. You can even set up scripts to run periodically or at timed intervals in the background, similar to cron jobs on Linux.For example, if you’d like to have the Apache web server start automatically when you turn on your Mac, simply type: $ sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plistRunning launchctl list will show you what launch scripts are currently loaded. With launch daemons and launch agents, you can control the services that start up when you boot your computer. LaunchctlLaunchctl lets you interact with the OS X init script system, launchd. Music editing app for macWithout any options, say will simply speak whatever text you give it out loud.: 2 $ say "Never trust a computer you can't lift."You can also use say to speak the contents of a text file with the -f flag, and you can store the resulting audio clip with the -o flag: $ say -f mynovel.txt -o myaudiobook.aiffThe say command can be useful in place of console logging or alert sounds in scripts. SayThis is a fun one: say converts text to speech, using the same TTS engine OS X uses for VoiceOver. There’s also the fantastic Lingon app if you’d prefer to avoid the command line entirely. BrewAlright–this isn’t technically a native command. Be careful: diskutil can permanently destroy data if it’s used incorrectly. Simply type diskutil list to see the path names of disks and removable media attached to your machine, and then point the command at the volume you want to operate on. It can do everything its graphical cousin can, but it also has some extra capabilities—such as filling a disk with zeroes or random data. DiskutilDiskutil is a command line interface to the Disk Utility app that comes with OS X. Give ‘em a Siri-ous surprise.You can set the voice (and language!) used by say by changing the default setting in the Dictation & Speech panel in System Preferences. Best Shell Free Utilities AndThe selection in Homebrew is huge—and because it’s so easy to create formulas, new packages are being added all the time. Brew install node will introduce you to NodeJS, the hot new tool for developing and running server-side JavaScript apps.You can have fun with Homebrew too: brew install archey will get you Archey, a cool little script for displaying your Mac’s specs next to a colourful Apple logo. For instance, brew install imagemagick will set you up with ImageMagick, a powerful utility that makes it possible to do anything from whipping up animated gifs to converting images between dozens of different types. 3Brew gives you easy access to thousands of free utilities and libraries from the open source community. If you’ve ever used apt-get in Linux, you will feel right at home in Homebrew. The website calls it “The missing package manager for OS X,” and that couldn’t be truer. To remove Homebrew safely, use the uninstall script.For more fun with Terminal.app, here is an A-Z list of all available console commands in OS X 10.9 Mavericks. And if you ever want to get rid of your Homebrew installation, it’s easy to remove.Edit—May 15: Someone suggested to me that that you should not blindly delete the contents of /usr/local/. That means you can install newer versions of system software, such as python and mysql, without interfering with the built-in equivalents.
0 Comments
Leave a Reply. |
AuthorMichael ArchivesCategories |