Hides all Files and Folders on the MacOS Desktop. To show files and folders, type "true" instead of "false". "Finder" at the end is case sensitive, "finder" doesn’t work
Because Mac app bundles contain everything in one place, it makes running them from anywhere, including from a device such as a USB flash drive or external HDD, possible. So if your Mac has a mere 256GB of storage (as mine does), you can free up large quantities of disk space by storing apps like, say, Xcode on external devices.
Formats the output from `ioreg` into XML, then parses the XML with `xmllint`'s xpath feature. Show Sample Output
I learned a few things reading this command. But I did run into a few issues: 1. On systems that don't use GNU echo (e.g. macOS 10.14.5 Mojave), the e option may not be supported. In this case ANSI escape codes will echoed as text and the terminal will not flash, like this: \e[?5h\e[38;5;1m A L E R T Thu Jun 20 16:31:29 PDT 2019 2. Since the read command strips\ignores leading backslashes, if a user types the backslash character once in the loop, it will not break. Typing backslash twice in a loop will break as expected. 3. The foreground color is set to red (\e[38;5;1m) on every loop. This could be set once before we call while, and then reset once when the loop breaks. 4. Instead of resetting the foreground color when it breaks, the video mode is set back to normal (\e[?5l). This has the effect of leaving the terminal text red until it is manually reset. The alternative I'm proposing here addresses these issues. I tested it on macOS and Arch Linux. Show Sample Output
Takes a screenshot of x11 and pipes it over ssh to the preview application on a mac. Requires imagemagick on the server side.
Runs on at least MacOS Sierra (in Bash) Show Sample Output
Compare the content of the files in the current directory with files of the same name in the duplicate directory.
Pop Quiz: You have a duplicate of a directory with files of the same name that might differ. What do you do?
You could use diff to compare the directories, but that's boring and it isn't as clever as find -print0 with xargs.
Note: You must omit stderr redirect 2>/dev/null to see the list of missing files from DUPDIR, if any.
Hint: Redirect stderr to a new file to produce a more readable list of files that are missing from DUPDIR.
Warning: This doesn't tell you if DUPDIR contains files not found in the current directory so don't delete DUPDIR.
Show Sample Output
Some of us have both Macs *and* Linux machines — so it makes sense to know how to run this command on the former in the event that a botched reinstallation renders the latter unbootable.
When you use the "exit" command in a Linux terminal window, it not only closes the terminal window itself but also the terminal emulator app, such as GNOME Terminal or Konsole, that it belongs to. If you use the "exit" command on macOS, however, Terminal.app still shows a dot below its Dock icon and is still running in the background. This alias, when entered into ~/.zshrc, overrides this behavior.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: