OS X install and tips

View the Project on GitHub nicolas-brousse/osx-install-and-tips

← Go home

Generic and useful commands

$ dscacheutil -flushcache
$ sudo killall -HUP mDNSResponder

VoiceOver

$ say -f <textfile> -o <outputfile> -v <voice>
$ say -f input.txt -o output.aiff -v alex

Apple defaults

Screecapture

$ defaults write com.apple.screencapture location ~/Pictures

Checksum

shasum

$ shasum -a 256 /path/to/file
$ shasum -a 512 /path/to/file

Show/Hide file/folder in the Finder

# Hide
$ setfile -a V testfile.txt
# Show
$ setfile -a v testfile.txt

Speed test

$ wget -O /dev/null http://ping.online.net/1Mo.dat # 1Mo
$ wget -O /dev/null http://ping.online.net/100Mo.dat # 100Mo
$ wget -O /dev/null http://ping.online.net/1000Mo.dat # 1Go

Get mime type

$ file --mime /path/to/file.txt

Diff

# Between two files
$ diff file-1 file-2

# Between two folders
$ diff -rq folder-1 folder-2

Search and replace into a file

$ perl -p -i -e 's/oldstring/newstring/g' to_file.txt

Count lines in a file

$ wc -l file.txt

← Go home