Вы находитесь на странице: 1из 1

Envato Elements Envato Studio Community Forum Help Subscribe Sign In

How-To Tutorials  Courses  eBooks  Pricing Search Envato Tuts+ 

Advertisement

COMPUTER SKILLS > TERMINAL

40 Terminal Tips and


Tricks You Never Thought
You Needed
 FEED  LIKE  FOLLOW  FOLLOW
by Jordan Merrick 21 Jun Di culty: Intermediate Length: Long Languages: English
2013

Weekly email summary


Terminal AirDrop OS X 
Subscribe below and we’ll send you a
weekly email summary of all new
Computer Skills tutorials. Never miss out
The Terminal is an exceptionally powerful tool, providing a command line
on learning about the next big thing.
interface to the underpinnings of OS X. It’s a topic we’ve covered at length
before with our popular series Taming the Terminal.
Email Address

There’s a great deal that Terminal can do, from moving large numbers of les
Update me weekly
to changing preferences that we didn’t even know exist. To demonstrate just
how versatile the Terminal is, I’ve rounded up 40 truly excellent Terminal tips
and tricks that can come in very handy.

Advertisement

Before We Begin
All of the Terminal commands I’ll be showing you are perfectly safe to use and,
when it comes to changing preferences, are completely reversible. Saying that,
the Terminal is a ckle creature and leaves no margin for error so make sure
you’re entering the commands exactly as they are written here.

As always, make sure you have a recent backup in case something does
happen.

Tip: If you’re unfamiliar with Terminal, I would strongly encourage you to read
Translations
our introductory series on the topic, Taming the Terminal. Terminal isn’t for the
faint of heart and we’d rather you be comfortable entering some of these Envato Tuts+ tutorials are translated into

commands. other languages by our community

members—you can be involved too!

Also, why not try out some of the Mac apps available on Envato Market, such
Translate this post
as Sentenza Desktop for Mac, which makes it very simple to build applications
for Mac OS X. Powered by

Apps
Mavenlink
    7k
Project Management, Resource …

JIRA Software
    27k
Project & Issue Tracking Softwar…

Entering Terminal

The Terminal window

Terminal is located in the Applications > Utilities folder. Once opened, you can
then start entering commands.

Within Terminal, you’ll see something like this:

1 MacBook:~ jordan$

This is the prompt, where we enter our commands. To correctly identify how to
enter a command, I will be using a dollar sign ($) to signify the prompt, so
simply enter the command that follows a dollar sign.

Let’s warm up with some basic commands!

Clear the Window


1 $ clear

Simply put, this clears the current window. (Within Terminal in OS X, you can
still scroll up to see what was there. This command simply clears the current
view).

Navigating to Folders
You can navigate to a folder, such as Utilities, by typing the following
command:

1 $ cd /Applications/Utilities

If you want to quickly jump back to your home folder, you can simply enter:

1 $ cd

With folders that contain spaces, there’s two ways you can do it:

1 $ cd /Volumes/Macintosh\ HD/
2 $ cd "/Volumes/Macintosh HD/"

The rst method uses the \ back slash to “escape” the space. Since the
command line treats spaces as part of commands, the \ character tells
Terminal to ignore the space that immediately follows. Alternatively, you can
simply wrap the folder’s path in quotation marks and any spaces it contains
will be ignored.

Navigate back to your home folder before continuing.

List the Contents of a Directory


You can view the contents of a folder by entering:

1 $ ls

The default output of 'ls'

To view it in a list format, enter:

1 $ ls -l

The output of 'ls' with the '-l' ag

If you want to view all les, including hidden ones:

1 $ ls -a

The above command will display all les, including those hidden ones that
start with a period. What if we want to view the folder as a list but also view all
the hidden les?

1 $ ls -la

Yep, it’s as simple as combining them together! I think you’re suitably warmed
up, so let’s kick it up a notch!

Navigate back to your home folder before continuing.

Ditto
A hidden gem in OS X is Apple’s ditto command. I’ve found this incredibly
useful in copying large amounts of data as it can run within a Terminal window
that contains more useful information about its progress than the more
traditional Finder copy window.

1 $ ditto -V /old/work/ /new/work/

The above command will copy our “work” folder to a new location. Actually,
what happens is the command copies the contents of our “work” folder to a
new “work” folder.

Adding -V, meaning verbose prints a line to the Terminal window for every le
that’s being copied. It’s extremely useful as you can see exactly what le is
being copied at any time.

Ditto is a command I use frequently and have often copied many gigabytes of
data between hard drives using it because it seems to be so reliable.

Disable Screenshot Drop Shadows


If we ever take a screenshot of a window in OS X, by default it will always show
a drop shadow, adding wasted pixels. If you’d prefer to have your screenshots
drop shadow-free, you can use the following command:

1 $ defaults write com.apple.screencapture disable-shadow -bool TRUE

You can either restart your Mac to see the changes or, using another
command, see them instantly:

1 $ killall SystemUIServer

This command stops the graphical front-end to OS X for a split second. Don’t
worry, it has to run all the time so as soon as it is stopped, it restarts instantly -
but updated with our new option. Take a screenshot and you’ll now notice that
the shadow is no longer included.

To reverse the changes, you can enter the following command:

1 $ defaults write com.apple.screencapture disable-shadow -bool FALSE

1 $ killall SystemUIServer

To see the changes immediately.

Change Screenshot File Format


PNG is probably the best format to use for screenshots, but it can certainly
take up a bit of space. If you’d prefer to use PDF format, you can use the
following:

1 $ defaults write com.apple.screencapture type PDF

1 $ killall SystemUIServer

To revert the changes, enter the following:

1 $ defaults write com.apple.screencapture type png

1 $ killall SystemUIServer

Change Screenshot Location


Whilst taking screenshots is great, it can quickly clutter up the Desktop. To
change this, we can use:

1 $ defaults write com.apple.screencapture location /drag/location/here

1 $ killall SystemUIServer

Rather then deal with pesky long path names, you can just type the rst part of
the command and, after the word “location”, drag a folder you’d like your
screenshots to save to. To undo the changes, you can use:

1 $ defaults write com.apple.screencapture location ~/Desktop

1 $ killall SystemUIServer

Tip: The squiggle, ~, actually represents your home folder. In the example
above, this would actually mean /Users/jordan/Desktop. A useful timesaver!

Enable AirDrop on Older Macs


AirDrop is a great feature to send les between Macs quickly and easily
without dealing with pesky le sharing apps. Trouble is, it’s only on WiFi and on
more recent Macs.

If your Mac doesn’t currently support AirDrop, you can enter the following
command to use it, as well as to use it over ethernet:

1 $ defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool TR

You’ll need to restart the Finder, the quickest way is to use the killall command
which will restart it:

1 $ killall Finder

To revert the changes, enter:

1 $ defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool FA

If you'd like more information on enabling AirDrop, we've covered it in more


detail in our previous tutorial "How to Enable AirDrop on Ethernet Connected
and Unsupported Macs".

Show Hidden Files and Folders


To view hidden les and folders in OS X:

1 $ defaults write com.apple.finder AppleShowAllFiles -bool TRUE

1 $ killall Finder

Once the Finder restarts, you’ll see a lot of les you never saw before, usually
starting with a period (which denotes a hidden le in OS X).

To revert the changes:

1 $ defaults write com.apple.finder AppleShowAllFiles -bool FALSE

1 $ killall Finder

We've also covered hidden le visibility in our previous tutorial "Revealing


Hidden Files in OS X".

Stress Test Your Mac


If you’re wanting to run some stress tests on your Mac, there’s a simple
command we can enter that will instantly utilise 100% of your CPU:

1 $ yes

Apple technicians use this frequently when dealing with troublesome Macs
that might be crashing under load and it’s a very quick way of stressing a Mac.
To cancel the command, press Ctrl-C.

View File System Usage


Sometimes we want to see what our Mac is doing when it comes to reading
and writing to disk, especially if we’re trying to identify something that’s
preventing us from ejecting a drive. To do this, we use:

1 $ sudo fs_usage

By entering sudo, we are requesting to run this as a super user, which requires
entering our Mac’s login password. Once done, you’re presented with a
constant stream of information as processes are accessing your disk.

Some processes you are likely to see are Time Machine (backupd) and
Spotlight (mds).

To cancel, you can press Ctrl-C.

View the Contents of Any File


Sometimes we have a le and we just don’t know what format it is. If it’s likely
to be a text format, we can attempt to open it in TextEdit, but it doesn’t always
work. We can investigate any le from the Terminal by using:

1 $ cat /path/to/file

No matter what the le is, this will open it. On les like MP3s or videos, it’ll
likely be gibberish. But if you’re trying to recover a corrupt document, this might
help.

Rebuild Spotlight
Spotlight can occasionally not work as well as we’d like. Sometimes, we just
need to tell Spotlight to create a new index so it can nd les as fast and
e ciently as possible. To do this:

1 $ sudo mdutil -E /Volumes/DriveName

The above command will delete Spotlight’s index, forcing it to start a new one.
An easier way of completing the command is to enter the rst part of it and, for
the location, just drag a hard drive from your desktop to the Terminal window.

Remove Duplicate “Open With…” Entries


A common bug in OS X is seeing duplicate apps within the “Open With…” menu
which can get quite full! To x it:

work/Support/lsregister -kill -r -domain local -domain system -domain user

The above command will work in OS X Leopard and above. Unlike the other
commands, I’d recommend restarting your Mac.

Enable Text Selection in Quick Look


Quick Look is great but wouldn’t it be even better if we could select text from
within Quick Look without having to open the document? Well with this
command, you can:

1 $ defaults write com.apple.finder QLEnableTextSelection -bool TRUE

1 $ killall Finder

To revert the changes:

1 $ defaults write com.apple.finder QLEnableTextSelection -bool FALSE

1 $ killall Finder

Open Files In Any Application


You can open documents directly from the Terminal very easily, but what about
opening them in another application that isn’t the default one for its le type?

1 $ open -a /Applications/AppName.app /path/to/file.txt

Doing the above will open our text le in the app AppName. Simply change the
app and le to whatever you need.

Check the Uptime Of Your Mac


It can be days, weeks or even months before we reboot our Mac and it can
sometimes be so long that we can’t even remember when we last did. To see
how long our Mac has gone without a restart, we can use:

1 $ uptime

This will display the current time and how long our Mac has been running.

Install OS X Software Updates


Despite Software Updates moving to the App Store in Mountain Lion, we’re
able to use the command line to install system udates without having to launch
it. To see available software updates for your Mac:

1 $ sudo softwareupdate -l

After a few minutes, you’ll be given a list of available updates.

If you’d like to install all available updates, enter:

1 $ sudo softwareupdate -ia

Display A Custom Message At The Login


Window
When using a multi-user Mac, it’s often good to have a message display to
provide some useful information, such as “Hey, sticky hands! Others have to
use this keyboard, y’know.”

1 $ sudo defaults write /Library/Preferences/com.apple.loginwindow Login

Next time you log out or restart your Mac, your message will appear. To remove
the message entirely:

1 $ sudo defaults delete /Library/Preferences/com.apple.loginwindow Logi

Start a Simple HTTP Server in Any Folder


If you’re needing to quickly test some HTML that you’re working on, start a
simple web server within any folder on your Mac. Navigate to the folder to use
and enter:

1 $ python -m SimpleHTTPServer 8000

The number at the end is the port to use, open your browser and visit
http://localhost:8000 You can use the default of port 80 if you wish and remove
the port number entirely.

When you’re nished, simply press Ctrl-C.

Run the Same Command Again


You will have seen a few of these commands have required us to enter sudo
rst, to run them as the root super user. Sometimes, we can enter a long
command, only to nd out we forgot to put sudo rst. Thankfully, we don’t need
to re-write the entire command again (or copy and paste). Instead, we can use
a very simple shortcut that stands in place of your previously written
command:

1 $ !!

If we needed to enter the same command again but with sudo in front, we can
just type:

1 $ sudo !!

Download a File Without a Browser


If you’d like to download a le without using a browser, we can use the
following command:

1 $ curl -O http://appldnld.apple.com/iTunes11/091-6058.20130605.Cw321/i

This will download any URL you enter to the folder you’re currently in. Some
browsers try to automatically open les when they’re downloaded or add a
pesky le extension when you don’t want them (especially when dealing with
text les that have something else besides the .txt extension).

Shutdown Your Mac, With or Without a Delay


To shut down your Mac immediately:

1 $ sudo shutdown -h now

To restart your Mac immediately:

1 $ sudo shutdown -r now

We can even add a time delay (in minutes) if we wish:

1 $ sudo shutdown -r +60

Whilst this might not be very useful on your own Mac, if you spend any time
remotely logged in to Macs via the command line, these can become very
useful at restarting remote servers.

Disable Mail’s Reply Animation in Mountain


Lion
Mail has a great looking animation whereby if you hit reply to any message, a
compose window animates into view. It’s not for everyone and sometimes just
having the window appear instantly. To turn off the animation:

1 $ defaults delete com.apple.mail DisableReplyAnimations -bool TRUE

Quit and relaunch Mail for the changes to take effect. To revert the changes:

1 $ defaults delete com.apple.mail DisableReplyAnimations -bool FALSE

Prevent Your Mac From Sleeping


We’ve all left our Mac doing something that will take some time to do, only to
come back and nd it went to sleep. We can prevent this from happening by
using a simple, and humorously named, command:

1 $ caffeinate

Entering the command on its own will keep the Mac awake until you stop it by
pressing Ctrl-C. You can add a time parameter with:

1 $ caffeinate -u -t 600

The number represents the number of seconds, so our command above will
stop the Mac from going to sleep in the next ten minutes.

Create a File Of Any Size


There are occasions when we just need to a le of a particular size for testing.
I often nd it useful to copy a 1GB le over a network to get an idea of speeds.
Finding a le that is the size we want is tricky, but with the command line we
can create an empty le of any size that we want.

1 $ mkfile 1g test.abc

You can specify the le size in bytes (b), kilobytes (k), megabytes (m) or
gigabytes (g). The above example creates a test le of 1GB called test.abc but
you can name it whatever you wish and it doesn’t need to have a le extension.

Continually Monitor the Output of a File


This one is for all the budding system administrators out there. If you’d like to
keep monitoring a text le and view any changes to it as they’re made, there’s a
suitable command that will constantly monitor your chosen le and display any
new lines as they’re added, perfect for monitoring system log les.

1 $ tail -f /var/log/system.log

Your Terminal window will constantly watch your speci ed le (in this case, the
system.log and every time another line is added, it will print it on the screen.

To cancel, press Ctrl-C.

Get Your Network IP Address


Sure, we could open System Preferences, select Network and then view our IP
address information, but doing it through the command line is so much cooler!

1 $ ipconfig getifaddr en0

The term en0 represents the network interface to use. Similar to some
programming languages, the rst network interface starts at zero and then
counts up, so if you have two interfaces (such as ethernet and WiFi) then they
would be en0 and en1, respectively.

By default, your Mac will always designate a wired network connection as en0,
unless your Mac doesn’t have built-in ethernet. You can substitute en0 with en1
if you’re not using your wired connection.

Get Your External IP Address


The most common way of nding out your public IP address (the one that
we’re provided by our ISP) by visiting a site such as What Is My IP or even
typing “what is my IP address” into Google.

We can actually use the Terminal to discover our public IP address using a
similar service as above called IP Echo.

1 $ curl ipecho.net/plain; echo

As soon as you run the command, you’re presented with your external IP
address. Whilst it might not be as quick to type as visiting one of the
aforementioned sites, we can do a lot with the Terminal output, especially if
we’re wanting to include it in some sort of script.

Test Network Connectivity


You’re likely to have heard of the term “ping” at some point. Ping sends very
small bits of information over a network to a remote computer, timing how long
it takes for a response to be received. It’s useful to see if an IP address is
working or if a website might be down.

1 $ ping -c 10 www.apple.com

Running the above command will send 10 packets of information and provide
detailed information about the response time. You can substitute
www.apple.com for any other domain name or IP address.

Disable Google Chrome’s Two-Finger Swipe


Navigation
For Macs with a built-in multitouch trackpad or used with the Magic Trackpad,
Google Chrome offers its own version of two- nger swiping to go forward and
back. Whilst it’s easy to change this behaviour in Safari, doing so in Google
Chrome requires a little Terminal trickery:

1 $ defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithS

Quit and restart Google Chrome to see the changes and you’ll notice you can’t
two- nger swipe anymore. To revert the changes:

1 $ defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithS

Prevent Apps From Saving to iCloud by


Default
iCloud is a great service but if you prefer to use Dropbox, or just save les to
your Mac, then you’ll no doubt have been frustrated that many iCloud-
compatible apps offer iCloud as the default Save… destination. Thankfully, we
can change this:

1 $ defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -boo

Quit and relaunch any app that uses iCloud and now any new documents will
default to your Mac in the save dialog rather than iCloud.

To revert the changes:

1 $ defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -boo

Make the Icon of Any Hidden App in the Dock


Translucent
Hiding apps when you’re not using them is a great way to free up screen space
but there’s not really any way to distinguish between which app is hidden and
which isn’t. We can alter the Dock so any apps that are hidden will have a
translucent icon:

1 $ defaults write com.apple.Dock showhidden -bool TRUE

1 $ killall Dock

To revert the changes:

1 $ defaults write com.apple.Dock showhidden -bool FALSE

1 $ killall Dock

Autocomplete Paths
When entering a long path name such as:

1 /Volumes/Macintosh\ HD/Users/admin/Library/Application\ Support/

It can be very tedious to enter it all out. What we can do instead is use the Tab
key to autocomplete. To use it, simply start entering any command where
you’re needing to type a path and once you’ve entered the rst or second letter,
press Tab. If there’s only one folder that the rst few characters could
autocomplete to, it will do so. If not, you can press Tab twice and it will jump as
far as it can, then display all potential les and folders you might want to get
to.

To try this, enter the following but instead of pressing Enter, press Tab instead:

1 $ cd /Us

You’ll nd it then autocompletes to:

1 $ cd /User

You’ll likely hear an alert tone as well. That’s because there’s two folders you
might want access to: /Users and /User Information. You can then add the last
character to the path and press Enter.

It works very similar to autocomplete of words in iOS.

Make Your Mac Talk


Mac OS X has some great speech functionality built-in and we can even have it
say anything we want:

1 $ say "This Mac runs OS X, not OS ex"

We can even go one better and have it read any text le we like:

1 $say -f /path/to/file.txt

Our Mac can then say whatever was in the text le.

Restore a Disk Image to an External Drive


You can mimic the behaviour of Disk Utility and restore a disk image le to an
volume connected to your Mac:

1 $ sudo asr -restore -noverify -source /path/to/diskimage/dmg -target /

It will skip veri cation (you can remove that part if you want to verify it but it
can take some time) and you can restore an image, such as a copy of OS X,
directly to a volume or partition.

Turn Off Dashboard


Dashboard was once the future of quick-to-access apps such as a calculator
and sticky notes. Despite being quite popular for a few years, it’s quickly faded
into obscurity. It’s still around and usually opened accidentally.

I use Mission Control extensively and have it positioned on the far left but,
honestly, I prefer it gone completely. Thankfully, Dashboard can be permanently
silenced:

1 $ defaults write com.apple.dashboard mcx-disabled -boolean TRUE

1 $ killall Dock

You’ll nd that Dashboard is no longer running, along with any widgets you
might have had inside. Don’t worry, you can bring it back if necessary:

1 $ defaults write com.apple.dashboard mcx-disabled -boolean FALSE

1 $ killall Dock

View All Active Processes


The app Activity Monitor can give us a detailed view of what our Mac is
currently doing. We can replicate much of its functionality in Terminal:

1 $ top

Once running, we can easily see all the current processes, listed by processor
usage with the processes using the most CPU moving to the top of the list.

Additionally, there’s plenty of other information at the top of the window, from
how many processes are running, how much RAM is currently in use to the
amount of network tra c we have generated.

Advertisement

Advertisement

See A List of All The Commands You’ve


Entered
For our nal one, we can enter a command to view all the commands we’ve
entered at the command line:

1 $ history

All of the previous commands that you’ve run within Terminal are listed here,
giving you the ability to go back and see what you’ve already done.

Conclusion WATCH ANY


COURSE NOW
The Terminal can help you con gure your Mac exactly how you want it and
provide access to features that just don't have any graphical interface to Subscribe to Access 
change. There are many options that are perfectly safe to use but to avoid
overwhelming the user, they're hidden away, only to be found by power users
wanting to make the change.

The command line is a very powerful tool and, just as Uncle Ben said to Peter
Parker, "With great power comes great responsibility". Use it wisely!

Advertisement

Jordan Merrick

I'm a technology writer and web designer living in the UK. I write for a
number of Apple-related sites, including Sparsebundle. I also create
web templates available at ThemeForest and offer bespoke web design
services at my own site, jordanmerrick.com. You can nd me on both
App.net and Twitter !

Advertisement
87 Comments Mactuts+ 
1 Login

Sort by Best
 Recommend 11 ⤤ Share

Join the discussion…

LOG IN WITH OR SIGN UP WITH DISQUS ?

Name

Basti • 5 years ago


Very informative. Nice one Jordan!
13 △ ▽ • Reply • Share ›

keystonelemur • 4 years ago


Well, here are a few tips for people that are already mildly comfortable with a
command line and want to take the next step (I'll put a more complete writeup on my
blog later at baweaver.com)

1. Install ZSH, as well as Oh My ZSH. These will save you an immeasurable amount
of time. It comes with tab completion, custom theming, plenty of built in aliases, git
branch support, and a lot more. It's the single best thing you could possibly do with
your terminal.

2. Learn what an alias is, and use them religiously. If you type more than five
characters at a time you really need to automate that down, script it, or alias it.

3. Look into TMUX, which will allow you to keep preconfigured terminal sessions for
working on multiple windows such as in a Rails deployment when you need to have
a server, an editor, a git / files window, and whatever you can think of.

4. Learn how to pipe and redirect output of commands, such as 'ls > file.txt' prints all
that output to a text file.

see more

6△ ▽ • Reply • Share ›

Ben • 5 years ago


Super useful! I didn't know some of these things were possible! Thanks :-)
3△ ▽ • Reply • Share ›

Thomas Lee • 5 years ago


`cd` as a tip/trick? Seriously?
6△ ▽ • Reply • Share ›

Johnny Winter Mod > Thomas Lee • 5 years ago

I suppose you could say that things are easy when you know how. When you
don't know, though, that's when you face obstacles. For the person who is
new to terminal, a tip like this could be extremely useful. Not everyone is as
knowledgeable as you!
27 △ ▽ • Reply • Share ›

Thomas Lee > Johnny Winter • 5 years ago


I understand that people who don't even know what Terminal is would
need that, but calling it a Tip (and certainly a Trick) seems a bit
ridiculous. It's an essential.
4△ ▽ • Reply • Share ›

Johnny Winter Mod > Thomas Lee • 5 years ago

Sure! We could have called it 40 Essential Tips & Tricks. ;-)


7△ ▽ • Reply • Share ›

twe4ked > Johnny Winter • 5 years ago


Feel like it belongs in an Introduction to Terminal post.
1△ ▽ • Reply • Share ›

Johnny Winter Mod > twe4ked • 5 years ago

How about 'An Introduction to 40 Essential Tips & Tricks' ? ;-)


19 △ ▽ • Reply • Share ›

cengha > Johnny Winter • 4 years ago


How about 'An Introduction to 40 Essential Tips & Tricks , by
the way thanks to our name advisors' :)
2△ ▽ • Reply • Share ›

John > cengha • 2 years ago


No matter what it is called. its extremely useful for me.
A novice user try to learn by searching tips / tricks to great
topic
1△ ▽ • Reply • Share ›

swbratcher > Thomas Lee • 2 years ago


Sure. For the green.
△ ▽ • Reply • Share ›

dcb • 5 years ago


Isn't this a forward slash "/" while this is a backslash "⧵"?
2△ ▽ • Reply • Share ›

Johnny Winter Mod > dcb • 5 years ago

Corrected. Thanks for pointing that out.


1△ ▽ • Reply • Share ›

swbratcher > dcb • 2 years ago


level up with: slash / ...and backslash ⧵
The 'forward' label is superfluous.
△ ▽ • Reply • Share ›

Jordan Merrick > dcb • 5 years ago


That's correct :) We'll get that amended shortly
△ ▽ • Reply • Share ›

john • 4 years ago


hi everyone my name is bob the burger
3△ ▽ • Reply • Share ›

Luiggi Arturo Norero • a year ago


Question? how can I get the full info like on a PC when you get the whole info on IP
config /all on the MAC. I know all the commands on a PC but learning how to do it
on a MAC, thank you!
1△ ▽ • Reply • Share ›

Your reply isn't needed • 2 years ago


some dont work. am i doing something wrong? i tried this one
$ sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText
"Hey, Sticky Hands!"
1△ ▽ • Reply • Share ›

Brandon > Your reply isn't needed • a year ago


You can use the exclamation point; you just need to put a space between it
and the closing quotation marks.
△ ▽ • Reply • Share ›

The Overlander > Your reply isn't needed • a year ago


The Exclamation point is an invalad character... dont use it(I do not know why
he used that example...)
△ ▽ • Reply • Share ›

Iman Mohamadi • 5 years ago


say command was something I've been looking for many times but couldn't find it,
thanks for the tip.
1△ ▽ • Reply • Share ›

mattack1 • 5 years ago


You did fs_usage wrong. Also, ~ is a tilde. There were several other problems too.
1△ ▽ • Reply • Share ›

IronMike > mattack1 • 5 years ago


How is fs_uage wrong? And where did the author say the tilde was called
something else? Or are you just here to complain?
1△ ▽ • Reply • Share ›

the_ed > IronMike • 5 years ago


He left out the "_" . Should be fs_usage, not fs usage
1△ ▽ • Reply • Share ›

Jordan Merrick > the_ed • 5 years ago


The fs_usage command appears to be written correctly but if it
isn't for you, could you post a screenshot or link? As more than
one person is reporting it, we'll check to see if something might
be causing the underscore or other special characters to not be
fully displayed.
3△ ▽ • Reply • Share ›

Jordan Merrick > mattack1 • 5 years ago


That's peculiar, the article is showing fs_usage as written correctly and that
no amendments have yet been made. If there are any further problems,
please let us know and we'll look to get any incorrect info fixed straight away.
△ ▽ • Reply • Share ›

Andreas Juchli • a month ago


My favorites are: "whois" get information on a domain, "dig" get information on the
hosting provider and "traceroute", see traffic route.
△ ▽ • Reply • Share ›

rocket2all • 4 months ago


See more commands: https://becomethesolution.c...
△ ▽ • Reply • Share ›

rocket2all • 4 months ago


more commands: https://becomethesolution.c...
△ ▽ • Reply • Share ›

Dasagriva Manu • 6 months ago


Well, it's a fantastic post and coverage of the much needed os commands.
△ ▽ • Reply • Share ›

Ismail • 7 months ago


Good One Jordan Please Keep Adding New commands
△ ▽ • Reply • Share ›

Michael Gaudie • a year ago


that was one of the coolest things I've done on terminal
△ ▽ • Reply • Share ›

Vibhay Chawla • a year ago


Thank you soooo Much Jordan for this awesome collection of Terminal Commands !!
△ ▽ • Reply • Share ›

Anup Rai • 2 years ago


Nice tutorial :D
△ ▽ • Reply • Share ›

Your reply isn't needed • 2 years ago


wait!!!!! still didnt work
△ ▽ • Reply • Share ›

Your reply isn't needed • 2 years ago


i figured it out.. i read the actual instructions.. dont include the money sign. its a que!
△ ▽ • Reply • Share ›

swbratcher • 2 years ago


'pbcopy' and 'pbpaste' are fun too. Here's a variant of the "get external IP
command" that puts the result right onto your clipboard:
$ curl ipecho.net/plain | pbcopy
△ ▽ • Reply • Share ›

swbratcher • 2 years ago


You have this command as the initial and reversion of the Reply animation killer:
"defaults delete com.apple.mail DisableReplyAnimations -bool TRUE", where I think
you meant to have the 'write' version first. Great post, thanks!
△ ▽ • Reply • Share ›

Tyler Durden • 2 years ago


how print out in a file all modified files from a date up to another date of a specific
folder (and also subfolders)?
△ ▽ • Reply • Share ›

genius • 2 years ago


man this was helpful and i have to admit the reason why i visited the site was i
wanted to know how hank into someone's wifi using the terminal command
△ ▽ • Reply • Share ›

Denis Franco • 2 years ago


if the yes command gets your cpu to 100% then something is wrong, it is a standard
unix command to print "y" many times on the shell standard output, like when you
are overriding files or anything that asks you many times if you are sure of
something. i run ubuntu in a very old and crappy laptop and "yes" only gets my cpu
to 75% at max.
△ ▽ • Reply • Share ›

Simple truths • 2 years ago


New to a MAC, I was delighted to see this article. I initiated a terminal session and
tested some of the commands. Other than "~ ls" which was successful, the
response I receive on all the others is "-bash: $: command not found". Is it possible
to functionally remove access to terminal commands? How to proceed?
△ ▽ • Reply • Share ›

Brandon Morris > Simple truths • 2 years ago


Just remove the $ from the commad
△ ▽ • Reply • Share ›

AppleG • 2 years ago


Very nice list, I specially liked the one about starting a web server on a given folder. I
found this list as well for more beginner users:

http://applemacosx.com/2015...
△ ▽ • Reply • Share ›

Artem AiRadio • 3 years ago


Fancy meta tags radio stream output, For real geeks who like terminal ;)

just write one line in terminal;)

#$ ogg123 http://ai-radio.org
or
#$ wget -qO- http://ai-radio.org/128.opus | opusdec - - | aplay -qfdat
#$ curl -sLN http://ai-radio.org/320.opus | opusdec - - | aplay -qfdat

output

△ ▽ • Reply • Share ›

Kushal Ashok • 3 years ago


This is exactly what I was looking for. Thanks.
△ ▽ • Reply • Share ›

NodeHost • 3 years ago


If you ever want to instant shutdown your own computer or if something happens
just hold shift-control-option-command and tap the power button, it will shut down
with no delay.
△ ▽ • Reply • Share ›

Jezen Thomas > NodeHost • 3 years ago


What if you don’t have access to those keys? What if you’re powering down a
remote machine? Learning the proper commands is invaluable.
△ ▽ • Reply • Share ›

Anthony Rossbach > Jezen Thomas • 3 years ago


Thats all fine (same person just personal user). I just posted the key
version. As someone who works on computers sometimes I need to
shit down the mac quick. All macs have the keys in question (or
equivalent). I was just noting a way when working on them. Or
personal say something gets on your computer and you don't want it
to get damaged bad, like a bit of water, this key press can save it it
you know it and can act quick as it is INSTANT. Sorry was just trying to
give a quick tip.
△ ▽ • Reply • Share ›

Load more comments

✉ Subscribe d Add Disqus to your site Privacy

LOOKING FOR SOMETHING TO HELP KICK START YOUR NEXT PROJECT?

Envato Market has a range of items for sale to help get you started.

Print Templates Brochure Templates Infographic Templates


From $2 From $2 From $3

Unlimited Downloads Over 9 Million Digital Assets Hire a Freelancer


From $29/month Everything you need for your next Choose from 2,000 professionals
Get access to over 400,000 creative creative project. ready to do the work for you.
assets on Envato Elements.

QUICK LINKS - Explore popular categories

ENVATO TUTS+ JOIN OUR COMMUNITY HELP

About Envato Tuts+ Teach at Envato Tuts+ FAQ


Terms of Use Translate for Envato Tuts+ Help Center
25,456 1,103 20,635
Tutorials Courses Translations
Advertise Forums

Envato.com Our products Careers

© 2018 Envato Pty Ltd. Trademarks and brands are the property of their respective owners.

Follow Envato Tuts+

Вам также может понравиться