It will use the grep command to extract only the lines containing the string foo. If you have that list of files in the clipboard from another app, you can process it on the command line with pbpaste: For instance, if you wanted to list all of the files in a directory that start with the letter "f" and put that list into the clipboard, you’d type the following:īoom - that output can then be pasted into any GUI app. The pbcopy and pbtaste utilities work in concert, allowing access to and from the system clipboards/pasteboards from the command line. pbcopy and pbpaste: Copy and paste to/from the clipboard You should find all of them useful and, in at least one case, even entertaining. Here’s a list of 10 handy utilities that allow you to perform many functions on your Mac from the command line. OS X has hidden gems that even power users might not know about. Although graphical interfaces can simplify many tasks, they can also complicate other tasks - and the command line comes to the rescue. Because OS X is built around a BSD core, you can bring over your fancy one-liners and skip the cumbersome GUI tools to do simple things like walking a directory tree, deleting every file older than 30 days, or pulling a list of files in the current directory that contain a specific text string. To those familiar with the Unix shell, the command line or terminal is a powerful tool to be used to facilitate many system functions and interactions. Of course, most likely they’re actually restarting a launchd service or deleting a plist file. For those users, this is usually when something has gone inexplicably wrong, and typing cryptic commands into the prompt seems the only hope for a cure. For most casual users, the OS X command line, accessed via the Terminal app, is at least as murky and daunting as the Windows Command Prompt, to be used only in times of extreme distress.
0 Comments
Leave a Reply. |