본문 바로가기

카테고리 없음

Fun Terminal Hacks For Mac

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 Sometimes you just want to see it all, right? 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.

Jun 21, 2015 - In my previous tutorial, I covered how to make a backdoor in an OSX system. I also covered some fun commands to try whilst the backdoor.

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 Sometimes a JPG is all you need. 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 Where the heck am I? 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.

Terminal Commands

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. 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 Snappier on that older Mac, for sure. 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: 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 Direct scrolling is the new black. 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 Too bouncy! 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 Get rid of that annoying alt character popup. 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. 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 Erase Free Hard Drive Space Securely Even the NSA won’t be able to see what’s in your free space. 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 Less sharing = more privacy.

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 Seriously, every FIVE minutes?

That’s a bit intense. 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 Put Your Dashboard Widgets On The Desktop Maybe I’ll use the calculator a bit more, now? 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. 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. 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 You can do it! 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 I wish I had a real time machine. 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.

. pwd – Displays the directory you’re currently in. cd – Change directory to another one. For example, if I’m in my Home directory (/Users/clefmeister) and type cd Downloads, I’ll be taken to my Downloads folder.

On the other hand, typing cd. Will take me to the previous directory in the hierarchy. sudo – This command authenticates you as an administrator for certain commands that need elevated permissions. defaults – The defaults command provides access to the macOS user defaults system, which stores details like whether hidden files are displayed, what happens when you press and hold a key on your keyboard, and quite a bit more.

Fun terminal commands for mac

killall – This ends all of the processes named whatever you specify. Use this sparingly, and only when you really mean it. Those are the primary commands we’ll be using. Let’s move on to my top five Terminal commands for macOS. Add a message to your login screen Whether you want to remind folks that it’s your computer, not theirs, or just add contact information in case your treasured MacBook Pro is lost, this one is a good tool.

Just type the following, replacing my message with yours: sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText 'Stay out! This is Jeff’s Mac, not yours.'

Stop Your Mac From Going to Sleep If you’re running an app that’s going to take a while to finish, or recording your screen, you might want to stop your Mac from going to sleep. Sure, you could change your energy saving preferences, but this is much easier. Just type this command and your Mac will stay awake until you cancel it. Caffeinate When your task is done and you’re ready for your Mac to sleep again, just type Control-C in the Terminal window to end the caffeinate task. Add Spaces to the Dock. Accented characters are nice, but sometimes you want the keyboard to repeat letters instead Sometimes, though, you want to go back to the old behavior of having a long keypress result in repeated characters.

That’s easy enough to do using this command: defaults write -g ApplePressAndHoldEnabled -bool FALSE To reverse it, simply issue this command: defaults write -g ApplePressAndHoldEnabled -bool TRUE 5. Hide Stuff From the Finder Let’s say you’ve got a folder you want to keep secret. For example, your collection of Christmas lists and receipts is something you might not want your significant other or children seeing. The folder is still in my Desktop directory, but now it’s hidden To undo what you’ve just done, simply go back to Terminal and type: chflags nohidden '/Users/clefmeister/Desktop/Folder to Hide' Bonus Tip – Drag Folder or File Names to the Terminal That’s right. You don’t have to type out that long folder name you want to hide. Just type in the chflags hidden command, drag your folder into the Terminal window, and watch the magic happen. What are your favorite Terminal tips and tricks?

Fun Terminal Hacks For Macbook Pro

Let us know in the comments below.