Posts about command line

OSX - Command line battery cycles information

26 August 2015

Here's how to get the number of battery charging cycles on your laptop on OSX:

    ioreg -l | grep LegacyBatteryInfo | cut -d '{' -f 2 | tr -d \} | tr ',' '=' | awk -F'=' '{print $12}'

'Internet speed test from the command line'

24 January 2015

Here's a neat trick: Measuring your Internet download speed from the command line.

Basically you need wget to download a big file (download to /dev/null will not waste disk space ;)) and simply check the average speed at the end.

Something like:

wget -O /dev/null http://speedtest.ams01.softlayer.com/downloads/test10.zip

Will give you:

Resolving speedtest.ams01.softlayer.com... 159.253.132.18 Connecting to speedtest.ams01.softlayer.com|159.253.132.18|:80... connected. HTTP request sent...

Change file modified and creation date/hour

24 January 2015

Here's how to change a file's modified date:

touch -mt 201102260000 <file>

Where "201102260000" is year, month, day, hours, minutes all glued together (so 2011-02-26 at 00:00).

Also, if you want to change both the modified and creation date, then:

touch -t 201102260000 <file>

This works on OSX and (i'm assuming, since touch also exists there) Linux/Unix.

Displaying posts 1 - 3 of 5 in total