How To Make A Terminal Program For Mac
Terminal app can be daunting at first, but it’s really the best way to hack into your Mac’s configurations and preferences to customize things to work for you rather than against you. With the right Terminal commands, you can tweak the Finder, mess with the user interface, build a more private and secure Mac, and even enable features that aren’t officially supported on older Macs.
- Best Mac Terminal
- How To Make A Terminal Script
- Free Terminal Program Download
- Better Terminal Mac
- Free Terminal Emulator Program
Here are a few of the better ones.
Terminal: This is the actual interface to the console. The program we use to interact with the console is actually a “terminal emulator”, providing us the experience of typing into an old school terminal from the convenience of our modern graphical operating system. Running a Command. Nearly all commands follow a common pattern with 3 main parts. Make your Mac automatically restart after a crash. When your Mac freezes or crashes, often the only resolution is to hold down the power button and wait for it to restart. One obvious runner-up is the built-in Mac OS X Terminal app. On the whole it's pretty great, offering pretty fast operation, plenty of visual customization options (with themes), a tabbed. May 18, 2015 You can also use the terminal program to securely connect to a command line interpreter on another computer, Mac or otherwise, with the secure shell command (see 'ssh'). On a Mac you can open a folder in the finder or open the program that goes with a particular file using the 'open' command. Installing Drivers and Software. Installation and Setup with the Setup Tool. Setting up a Serial Terminal with Mac* OS X*. (formerly called firmware). Steps to Set Up a Serial Terminal. Launch Spotlight by pressing Cmd + Space. Type terminal. Select the Terminal app. In the Terminal window, enter the command.
Hack The Finder
The Finder can be hacked a bit using the Terminal, of course, so we figured we could show you a few tricks, too. Here’s how to hack up the Finder a bit to make it work better for you.
Show Hidden Files
The Finder hides many configuration files in the finder, some of which you might want to get into to change things. Most of the time, these files should stay hidden or left alone, but we’re not interested in playing it safe all the time. If you want to see all the files on your Mac for your own reasons, launch Terminal and type or paste in the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
Then, issue the command to restart the Finder (killall Finder
) and hit the Return key.
If, after you’ve found the hidden files you were looking for, you want to return the Finder to its pristine, hidden-file state, simply do the same thing, except change TRUE to FALSE, and you’ll be good to go.
Change Screenshot Formats
Taking a screenshot in OS X is as simple as hitting Command-Shift-3 for the whole screen, and Command-Shift-4 for a selection portion of your screen. These screenshots end up on your Desktop in the Finder, and by default are PNG files. If you want to change that default to, say, JPG or PDF, simply type or paste the following command into Terminal.
defaults write com.apple.screencapture type file-extension
Just be sure to change “file-extension” above with the three letter suffix for the file type you want. So, if you want your screenshots to default to jpeg files, simply type or paste the following: defaults write com.apple.screencapture type JPG
, and you’ll be good to go.
Show File Path Info
Sometimes, it can get confusing as to where you’re at in the Finder, especially if you have a lot of folders open in windows, and they have similar names. A neat way to remind yourself where you are is to enable the Path View in the title bar of your Finder windows. To do so, simply enter the following into your Terminal app.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
Now your Finder windows will all show you the file path structure, so you’ll be able to figure out where exactly you are when you get lost in a plethora of open folders and files. Slick!
Hack The User Interface
Now, let’s look at some commands you can issue in the Terminal to mess around with the user interface, to help you use your Mac the way you want, rather than the way they want. Whoever they are.
Disable Window Animations
Mountain Lion has a window animation that make things look slick, but can slow down vital workflow, especially on older Macs. To get rid of this subtle but occasionally annoying feature, zoom up to open animation, and issue the following command into your Terminal app:
Best Mac Terminal
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
Now the windows will just appear without any opening animations, which should help things feel a bit snappier when running OS X on an older Mac. Change false to true to bring it back.
Get Rid Of Smooth Scrolling
When you launch a Safari window that needs scrolling and hit the space bar, OS X is set up to animate the scrolling down motion, so it feels smooth and silky. Some users complain about this effect being jerky and unattractive on Retina Macbooks, and would like to disable it. All you need to do is issue the following command into Terminal:
defaults write -g NSScrollAnimationEnabled -bool NO
Now, when you hit the space bar in Safari or other scrolling windows, it will jump right to the next area on the page, rather than animating down. Change NO to YES to get it back.
Dump The Rubber Banding Effect
When you’re scrolling up or down in any OS X application, including the Finder, you may notice a sort of bouncy, rubber-band effect when you scroll past the top or bottom of a page or list too quickly. This mimics iOS beahvior, which is aesthetically pleasing, but it can be annoying at times, or slow down your process on an older Mac. To get rid of this feature, type or paste the following Terminal command:
defaults write -g NSScrollViewRubberbanding -int 0
Now this only works in some apps, so you’ll have to quit them and relaunch to make sure. Safari or Chrome don’t seem to lose the effect, but Finder and Evernote do, so play around with it to see if the apps you want to disable this within will work.
Enable Key Repeats
It used to be simple to get a repeated key on your Mac; just hold down any key and it would repeat after a certain amount of delay time. Now, however, in many OS X apps like TextEdit, you can’t do that anymore, as an alternate character popup menu will appear if you hold down a key that has those associated with it. If you want to get rid of that popup feature, and get your key repetition back, simply issue the following command in Terminal:
defaults write -g ApplePressAndHoldEnabled -bool false
Now you can hold down any key and get a repeat. Yessssssssss!
Make Your Mac More Secure
Now, we’re going to spend a little time with Terminal commands to make your Mac just a bit more secure and private. Feel free to follow along at home.
Read more at http://www.cultofmac.com/214558/mastering-terminal-to-hack-for-better-security/#PV7UucS3J1Zffkom.99
Erase Free Hard Drive Space Securely
When you delete files from your Mac’s hard drive, they don’t actually go anywhere. What gets deleted is your Mac’s ability to use them in any functional way. When new files are put on the Mac, they might (or might not) overwrite some or all of the older, already-trashed files. To keep your files private, you might want to securely delete files from the Trash, and you might also want to delete all the files from the free space on your Mac.
To do so, simply type or paste the following command into Terminal:
diskutil secureErase freespace 3/Volumes/hard-drive-name
Replace “hard-drive-name” with the actual name of your hard drive, and then hit enter. You’ll get a progress bar, and if you have a big drive, it will take some time, as it overwrites each sector 35 times, five times as much as the US Department of Defense recommends, so you can assume it’s safely removed. This will get rid of any lingering files that you’ve already thrown away on your Mac, but didn’t do so securely.
Reset Privacy Data On Your Mac
We all add new apps all the time, and in our socially-networked world, it’s hard not to jsut give the apps the permissions they need to run, and then move on. Sometimes, though, you might want to just revoke all app access to your private data and start over from scratch. In OS X 10.8 Mountain Lion, you can use Terminal to do just that. You’ll be revoking access to specific data services for all apps, one data service at a time. So, to revoke access to the Address Book, for example, you’ll want to enter the following command into Terminal:
tccutil reset AddressBook
This should revoke all access to Contacts data from your Address Book. For something like your Location Data, enter the following:
tccutil reset CoreLocationAgent
You can get a full list of these types of services by typing
launchctl list
into Terminal. There is, of course, a Privacy preference pane in the System Preferences app, but this is a bit more direct. And geeky, too!
Reschedule Time Machine Backups
A core feature of any data security plan is the backup system you use. Mac OS X’s Time Machine backups are fantastic and automatic, making sure your stuff is backed up on the fly, every hour. If you want to change the interval at which it backs your stuff up, however, you can do that via Terminal. Simply enter the following command into your Terminal app.
sudo defaults write/System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 1800
You’ll need to enter your admin password here as you’re invoking the Super User command, sudo. The 1800 there at the end will change your Time Machine backups to every 30 minutes, as it is an interval of seconds. To change it to back up every 15 minutes, use 900 in that spot. If you want to change it back to every hour, simply replace the 1800 in the above command to 3600.
Hack The Dashboard
Now, let’s look at the Dashboard with its widgets and things and see what we can do to hack it a bit.
Read more at http://www.cultofmac.com/214675/mastering-terminal-to-hack-your-macs-dashboard-os-x-tips/#Lrw1cuUrWmvYITDv.99
Put Your Dashboard Widgets On The Desktop
Honestly, I don’t use the Dashboard too much, as their functionality is limited, and it’s just faster to open a dedicated app that I can switch to with Command-Tab. However, maybe if I was able to drop them on the Desktop, I’d end up using a few of the more useful ones more often. It’s worth a shot, right?
All you need to do to make this happen is type or paste the following command into the Terminal app:
defaults write com.apple.dashboard devmode YES
Then enter the following command, as well.
killall Dock
Once that’s done, launch Dashboard with F12 (or whatever other keyboard shortcut you have defined for the Dashboard), and find the widget you want out of there. Click and hold on it, move it a bit, and then hit F12 again to dismiss the Dashboard. The widget should then appear above whatever app you’re in, and stay in the foreground.
To get rid of the widget from the Desktop, and put it back in the Dashboard, do the same thing in reverse. Click and hold on the widget, hit the F12 key to bring up the Dashboard, move the widget around a bit, and then release the mouse button. Boom. Widget replaced.
Get Rid Of Dashboard Altogether
Maybe you don’t like the Dashboard, have RAM issues, or otherwise want to just kill it completely. That’s not horribly difficult; just use the Terminal.
Best graphics software for mac. Type or paste the following command into the Terminal app, then hit Enter.
defaults write com.apple.dashboard mcx-disabled -boolean YES
Then, go ahead and restart the Dock again, with the following:
killall Dock
Now you’ll have no more Dashboard. So sad, see ya later. If you want to bring it back, of course, there’s a simple command to bring it back, replacing the YES above with a NO:
defaults write com.apple.dashboard mcx-disabled -boolean NO
Then killall Dock
and you’re good to go.
Make Unsupported Features Work Again
Ok, so let’s take a look at a few of the newer features of the OS X world, and how to make them work on older, unsupported Macs using some Terminal magic.
Enable AirDrop Over Ethernet
AirDrop is one of those newer features, introduced in OS X Mountain Lion, that lets you share files to other supported AirDrop Macs on the same WiFi network as yours. Other folks can do the same thing to your Mac, as well. Unfortunately, AirDrop doesn’t work on older Macs, nor over Ethernet, by default.
If you’d like to try to make it work on your older Mac, simply past or type the following into your Terminal app:
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
Then, log out of your Mac and log back in to check and see if it worked.
Now, AirDrop should work on your older, unsupported Mac as well as over Ethernet. If you ever want to turn this ability off for any reason, simply replace ‘true’ in the command above with ‘false.’
Enable Time Machine For Unsupported Network Volumes
Time Machine rocks, mainly because it backs stuff up on our Macs without us having to do much of anything to make it regular and consistent. One issue, hoever, with Time Machine is that it only works with supported drives on the network. like Apple’s own Airport Extreme with Time Machine. What if you have a network-attached storage device that you want to back your data up to? These drives tend to be a lot less expensive per storage unit than anything Apple sells, but they aren’t directly supported by Mac OS X.
To make it so you can see these unsupported drives within the Time Machine system, all you need to do is launch Terminal and then issue the following command:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
This tweak isn’t officially supported by Apple, and as such won’t have any guarantee of working as well as an Apple solution. However, if you’re willing to risk it, this might be a great thing to try.
Mac OS X is built to be so user-friendly that anyone can use it, regardless of their level of experience when dealing with computers. However, delve beneath OS X’s shimmering surface by launching Terminal and you will find it possible to unlock hidden features, perform advanced tasks, tweak and troubleshoot your Mac.
This tutorial will discuss some of the best and most popular beginner-friendly Terminal tricks and tips to be found on the Internet.
Disclaimer
Usually it takes destructive behaviour or terrible luck to ruin your Mac’s OS X installation beyond repair, but using the Terminal could potentially bypass such safety and enable a user to cause themselves serious headaches, or even (in extreme cases) a completely ruined operating system. This is very unlikely and as long as you steer clear from “sudo” commands which require you to enter your password, you should be perfectly safe. However, I strongly advise you to back up your Mac fully and proceed at your own risk!
Some tips may only work for a particular OS, though I’ve taken care to only select Terminal commands which should mostly work on Leopard, Snow Leopard and Lion.
Show Hidden Files
Though OS X doesn’t really place much emphasis on hidden files and folders, some files and folders are hidden by default. This is usually for good reason and deleting the wrong thing can cause issues, but if you wish to show the hidden files, then enter the following code:
To undo this command, replace true with false.
Enable 2D Dock
If you’ve ever moved your Dock to the left or right of screen (depending on which OS X version you’re running), you may have seen the 2D Dock shown above. If you’d like to enable the 2D Dock in all positions, enter the following into Terminal:
Now restart your Dock to make the changes take effect by entering
To put your Dock back to normal, replace the “YES”‘ in the above code to “NO” and restart the Dock once again by entering the above killall command.
Disable Dashboard
I’ve never been a big fan of the Dashboard as it’s something of a RAM hog and I like it to be completely disabled in case I accidentally launch it. If you would like to do so too, enter this into Terminal and hit return:
Once again restart Dock to make the changes take effect.
To undo this command and bring back Dashboard, just change “YES” to “NO” and restart your Dock by entering the killall command once again (note: the killall command can actually be inserted into the same line of code to save time, I’m making it separate here to give you a sense of what exactly is happening).
Show The Library Folder In OS X Lion
OS X Lion comes with the Library folder hidden by default but this can make troubleshooting any issues with your Mac, deleting the cache or just plain “tinkering” very difficult. In order to bring back the Library folder permanently, enter this command into Terminal:
Hide Desktop Icons
How To Make A Terminal Script
A nice clean Desktop looks great but sometimes it’s not practical to keep all your files organised. If you’d like to hide all the icons on your Desktop through a Terminal command, enter the following:
Then our friend the killall command once again
When you wish to bring your Desktop clutter back, copy and paste the following:
Then enter the killall command.
Free Terminal Program Download
Launch An Application
In order to launch applications from the Terminal, just follow this template, replacing Twitter with the name of whichever program you’d like to launch:
Kill A Process
If you need to quickly kill a process or application, type the following into Terminal, replacing Twitter with whichever process you’d like to kill.
Open A Finder Window In Current Directory
To quickly open a Finder window in whichever directory you’re currently in, enter the following into Terminal
Change Grab’s Default Image Format
OS X’s built-in screenshot utility Grab is very useful but if you’d like it to save files as JPG, enter the following into Terminal:
(note: You can also change jpg to png if preferred).
Conclusion
Better Terminal Mac
I hope that you’ve found some usefulness from these Terminal commands and that it encourages you to learn more about the power which can be unlocked from within the command-line. You can usually find an application which takes care of each of the commands posted above, but that’s a lot less informative and a lot less fun!
Free Terminal Emulator Program
For the command-line veterans amongst our readers; if you’ve got any Terminal commands or tips which I’ve missed (and I’m sure there are several), please let us know about them in the comments below.