MacMost: Terminal

3 Ways To Generate Random Passwords On a Mac

If you need to create a random password outside of Safari or another password manager, you can use a variety of techniques. You can use the Keychain Access app, some Terminal commands, or even make your own Automator action to generate one on demand.

13 Ways To Put Your Mac To Sleep
You can put your Mac to sleep many different ways including keyboard shortcuts, special gestures and interactions, an automatic timeout, and even Terminal or Automator scripts.
How To Add Text-To-Speech Voiceovers To Videos
If you'd rather not use your own voice to narrate a video, you can use a Mac-generated synthesized voice instead. The best way to do it is to use a simple Terminal command to create the audio file and then bring that into iMovie.
Mac Terminal Commands and Apps To Work With Text Files
You can work with text files using the Terminal and variety of commands and command line apps. You can merge files, search them, sort them, extract information and even edit them directly with Terminal text editors like vi and nano.
Creating An Information Notification With Shell Scripts And Automator

You can go to the Terminal and use simple one-line shell scripts to get various pieces of information such as the date and time, your Internet IP address and your Wi-Fi network name. Using Automator, you can incorporate these bits of information into a simple notification that appears whenever you press a keyboard shortcut.

Using Terminal Commands As An Alternative To The Mac Finder
If you prefer to type instead of using the mouse and cursor you can manage your files and folders with the Terminal. You can use commands to list, open, rename, move and delete files. You can do nearly everything that you can do in the Finder, and some commands are even more powerful.
Screen Share With Another Account On the Same Mac
You can share the screen of another Mac pretty easily. But it seems like it is impossible to do the same with another account on the same Mac. However, if you use Terminal to set up an ssh tunnel, you can share the screen of a second account using an alternate port number. This allows you to stay logged in to one account, while you use another account in a screen sharing window.
What Do Terminal Commands Actually Do?
Most Mac Terminal commands posted online are actually simple commands that just change a preference for an app or part of macOS. When you use a command like "defaults write" all it is doing is editing a small preference file in your user Library folder. Take a look at what actually is changed.
Using Find In the Terminal to Locate Files
An alternative to using Spotlight or the Finder to search for files is to use the Find command in the Terminal. You can search for files by name and refund the search by location, time and other factors. While not useful for everyday file searches, this could be used to search through large libraries of files for particular results.
Listing Zip Archive Contents With Terminal and Automator
You can peer into a zip archive and see which files are in there using the zipinfo Terminal command. You can refine the results to show you only the files with fgrep. You can take this same command and use it as a Shell Script in an Automator service for easy access. In this tutorial you'll also learn about using Shell Scripts with files as input arguments in Automator.
Using a Shell Script to Batch Process an Image
Shell scripts can be created in TextEdit and run in the Terminal app. In this example, we'll create a script that takes a single image and produces multiple versions of that image by looping through a series of sizes. This script can be used again and again to reproduce the image series when changes are made to the original.
Blocking Websites On Your Mac Using Terminal
If you want to prevent yourself from going to a website you can manually block a domain using the Terminal. To do so, you must edit your hosts file and redirect a domain to your local address. This could be useful to help you resist distractions while getting work done.
Restarting the Dock, Finder or Your Whole Mac With the Terminal
You can use the Terminal to restart either the Dock, Finder or your entire Mac. This comes in handy for developers, those testing software, or those using unstable software when problems arise and you need to restart one of these services but other methods are not working.
Setting Screenshot File Location
By default your Mac screenshots will appear on the Desktop. However, if you take screenshots often, it could be useful to set up a dedicated folder for them and have them automatically save there. You can do this with a simple Terminal command.
MacMost Now 885: Using Ruby On Your Mac
Ruby is a popular programming language that comes installed on your Mac and can be accessed in the Terminal. You can use the Rub command line interpreter to run simple programs in a single line. You can also write more complex programs in a text file and run them. This gives you similar functionality to using BASIC on the Apple II.
MacMost Now 819: Running Multiple Instances Of the Same App On Mac
For most apps you can simply open multiple windows or tabs to edit or view separate documents. But some apps only let you have one window open. Sometimes when using apps like Safari, it is useful to be able to isolate windows from each other in case one crashes. Learn how to use the Terminal window to launch multiple instances of the same app. Learn how to then use Automator to create an app that will do this for you automatically.
MacMost Now 613: Fun With the Terminal
There are some odd and unusual things on your Mac that you can do with the Terminal. You can create banners, use your screen saver as your desktop background, look at interesting, daily calendars, and play hidden games.
MacMost Now 447: OnyX Maintenance Utility
If you are an advanced user with trouble, or someone who like to tinker with Mac OS X settings, then take a look at OnyX. This free utility gives you easy access to Terminal commands and hidden preferences.
MacMost Now 436: 17 Ways to Launch an Application in Mac OS X
You can launch an application using the Finder, Dock, keyboard, Terminal and even your voice. See how many of these you knew about.
MacMost Now 276: Customizing the Finder Toolbar
You can customize the top of every Mac OS X Finder window adding useful buttons that perform common tasks. You can also add files, folders and applications to the toolbar.