Terminal -- OSX Command Line Tips

For discussion of topics specific to MythTV on OSX
Post Reply
User avatar
Posts: 636
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada

Terminal -- OSX Command Line Tips

Post by pvr4me » Sun Sep 07, 2014 10:51 am

Have a look at the linked article if you have some familiarity with the command line but want to take it to the next level:


The article is long and detailed (probably too much for one sitting) but has lots of useful stuff. For example:
Shell Tricks

Once you get your shell setup, it's time to learn some of its most useful tricks.


The shell remembers everything you type. With a few simple characters, you can avoid retyping. The first two are !! which repeats the last command entered. I'm ashamed to admit that I do this every time I edit my /etc/hosts file:

Code: Select all

$ vi /etc/hosts
"Oh crap, it's read only."


Code: Select all

$ sudo !!
If you just want to reuse the last item in the command, which is typically a file name, then you can use !$:
The MacPorts guy.

Post Reply