command line

Displaying 1 - 7 of 7

Time your website speed with simple command line tools

When doing some initial, rough performance evaluation of a website's code, we can use some common tools which should be available on most desktops. Whether on Mac or Windows, you should have access to a command line (Terminal on Mac, git bash or Cygwin bash on Windows) with the regular "Unix" (POSIX) command line tools or GNU versions of them. You should also have 'curl' (and 'wget'), which is non-standard but very common and useful.

In the following examples, replace with your website and page you want to test.

Step 0: ping


What's my (external public) IP address (command line)?

The Internet is running out of IP addresses (ipv4, but years after ipv6 came out we still haven't switched over to it). This is realer than Peak Oil. And so most of us are connected to the Internet with an IP address shared with many other people, with many devices seen by the outside world as having one address.

But more locally, behind a router or gateway or firewall, we all have unique addresses and names to identify each other by. But only locally.

And so each of our devices have two or more possible IP addresses. Each computer should have a local IP address, its main...

Start a separate Chrome app on OSX with flags from Terminal

Chrome can be opened from the command line. And by running it from the command line you can configure Chrome with a number of options, there are several hundred possible flags which you can start Chrome with.

First of all, just to start/open Chrome from the command line instead of the Dock (or Spotlight) all you need is the path to the Chrome app binary. This is the absolute location of Chrome on Mac OS X: /Applications/Google\\ Chrome. You can copy and paste that to Terminal and it should open Chrome without any special options, or...

Clean up Mac ._ files on external/USB disk

Have you ever looked at an external drive with folders created on a Mac but then loaded on Windows or Linux? If you look carefully (turn on viewing of hidden and system files) you'll see a file beginning with ._ for some or many of your files, varying by file type. What are these mysterious '._xxx' files?

Mac OSX Resource Forks

Those ._ files are called resource forks. Resource forks are specific to Mac filesystems. They don't take up too much space and can contain useful data about your files. But deleting them also won't delete your files (the data...

Managing OS X Terminal Windows Groups

I prefer OS X's stock Terminal app to iTerm 2 because it automatically reopens and restores previous terminal windows and tabs and keeps the scrollback for each tab (although bash history is lost per tab, reasonable since bash is a separate program from Terminal). iTerm2 used to be a much better Terminal but Terminal has gotten better and is more than usable now. iTerm2 does have some cool features like instant replay/rewind, better support for the mouse for vim. [Note: xterm is also available on stock Mac OS X.]

Besides restoring, you can save your windows and tabs as a 'Windows...


FTP is the historically standard protocol for copying files from one computer to another over a network connection (TCP/IP, so any host on today's Internet, but it wasn't always the case). Many people including many developers learned how to use an FTP client on Windows in order to connect to a server and upload and download files.

Stop using FTP!

FTP is not secure for the same reason that HTTP is not secure and why there's a movement (Let's Encrypt) to move every website to use TLS, i.e. HTTPS instead of HTTP. The reason HTTP and FTP are not safe is that they are not...

Tricks to get the full path and filename of a file in Finder

Since I do a lot of work in Terminal and find it quicker to process files on the command line for some things so I need to get the path to a file for passing as an argument to Unix commands. It's not obvious at all how to do this from Finder. You can have Finder show the path but there's no way to copy it! Right-clicking only shows the parent directories in order to quickly navigate but not to copy (unlike Windows Explorer where you can access the path like a browser URL).

If you right click a file and select 'Get Info' you will see in the 'Where' section the parent folders are...