Formatted all pages according to guidelines.

This commit is contained in:
Ruben Vereecken
2016-01-07 18:31:27 +01:00
parent efa4cbd4de
commit 066582e8ea
284 changed files with 1338 additions and 1364 deletions

View File

@@ -1,15 +1,15 @@
# Airport
> Airport utility
> Airport utility.
- Create a symlink so you can easily run 'airport' without specifying a path.
- Create a symlink so you can easily run 'airport' without specifying a path:
`sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport`
- Scan for available wireless networks
- Scan for available wireless networks:
`airport -s`
- Disassociate from current airport network
- Disassociate from current airport network:
`sudo airport -z`

View File

@@ -1,27 +1,27 @@
# brew
> Package manager for OS X
> Package manager for OS X.
- Search formula
- Search formula:
`brew search {{text}}`
- Install formula
- Install formula:
`brew install {{formula}}`
- List installed formulae [with matching name]
- List installed formulae [with matching name]:
`brew list {{[text]}}`
- Get latest version of installed formula (passing no formula updates all installed formulae)
- Get latest version of installed formula (passing no formula updates all installed formulae):
`brew upgrade {{[formula]}}`
- Update brew
- Update brew:
`brew update`
- Switch version of formula
- Switch version of formula:
`brew switch {{formula}} {{version}}`

View File

@@ -1,11 +1,11 @@
# caffeinate
> Prevent a system from sleeping
> Prevent a system from sleeping.
- Prevent mac from sleeping for 1 hour (3600 seconds)
- Prevent mac from sleeping for 1 hour (3600 seconds):
`caffeinate -u -t 3600`
- Prevent mac from sleeping until a command completes
- Prevent mac from sleeping until a command completes:
`caffeinate -s {{command}}`

View File

@@ -1,19 +1,19 @@
# dd
> convert and copy a file
> Convert and copy a file.
- Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso)
- Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso):
`dd if={{file.iso}} of=/dev/{{usb_drive}}`
- Clone a drive to another drive with 4MB block and ignore error
- Clone a drive to another drive with 4MB block and ignore error:
`dd if=/dev/{{source_drive}} of=/dev/{{dest_drive}} bs=4m conv=noerror`
- Generating a file of 100 random bytes by using kernel random driver
- Generating a file of 100 random bytes by using kernel random driver:
`dd if=/dev/urandom of={{random_file}} bs=100 count=1`
- Benchmark the write performance of a disk
- Benchmark the write performance of a disk:
`dd if=/dev/zero of={{file_1GB}} bs=1024 count=1000000`

View File

@@ -1,19 +1,19 @@
# diskutil
> Utility to manage local disks and volumes
> Utility to manage local disks and volumes.
- List all currently available disks, partitions and mounted volumes.
- List all currently available disks, partitions and mounted volumes:
`diskutil list`
- Repair the file system data structures of a volume
- Repair the file system data structures of a volume:
`diskutil repairVolume {{/dev/diskX}}`
- Unmount a volume
- Unmount a volume:
`diskutil unmountDisk {{/dev/diskX}}`
- Eject a CD/DVD (unmount first)
- Eject a CD/DVD (unmount first):
`diskutil eject {{/dev/disk1}}`

View File

@@ -1,15 +1,15 @@
# ditto
> Copy files and folders
> Copy files and folders.
- Overwrites contents of destination folder with contents of source folder
- Overwrites contents of destination folder with contents of source folder:
`ditto {{path/to/source}} {{path/to/destination}}`
- print a line to the Terminal window for every file thats being copied
- Print a line to the Terminal window for every file thats being copied:
`ditto -V {{path/to/source}} {{path/to/destination}}`
- copy a given file or folder, while retaining the original file permissions.
- Copy a given file or folder, while retaining the original file permissions:
`ditto -rsrc {{path/to/source}} {{path/to/destination}}`

View File

@@ -1,11 +1,11 @@
# drutil
> Interact with DVD burners
> Interact with DVD burners.
- Eject a disk from the drive
- Eject a disk from the drive:
`drutil eject`
- Burn a folder as an ISO9660 filesystem onto a DVD. Don't verify and eject when complete.
- Burn a folder as an ISO9660 filesystem onto a DVD. Don't verify and eject when complete:
`drutil burn -noverify -eject -iso9660`

View File

@@ -1,19 +1,19 @@
# du
> Estimate file space usage
> Estimate file space usage.
- get a sum of the total size of a file/folder in human readable units
- Get a sum of the total size of a file/folder in human readable units:
`du -sh {{file/directory}}`
- list file sizes of a directory and any subdirectories in KB
- List file sizes of a directory and any subdirectories in KB:
`du -k {{file/directory}}`
- get recursively, individual file/folder sizes in human readable form
- Get recursively, individual file/folder sizes in human readable form:
`du -ah {{directory}}`
- list the KB sizes of directories for N levels below the specified directory
- List the KB sizes of directories for N levels below the specified directory:
`du -k -depth=1 {{directory}}`

View File

@@ -1,11 +1,11 @@
# head
> Output the first part of files
> Output the first part of files.
- Output the first few lines of a file
- Output the first few lines of a file:
`head -n {{count_of_lines}} {{filename}}`
- Output the first few bytes of a file
- Output the first few bytes of a file:
`head -c {{number_in_bytes}} {{filename}}`

View File

@@ -1,11 +1,11 @@
# hostname
> Show or set the system's host name
> Show or set the system's host name.
- Show current host name
- Show current host name:
`hostname`
- Set current host name
- Set current host name:
`hostname {{new_hostname}}`

View File

@@ -1,12 +1,11 @@
# locate
> find filenames quickly
> Find filenames quickly.
- Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily).
- Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily):
`locate {{pattern}}`
- Recompute the database. You need to do it if you want to find recently added files.
- Recompute the database. You need to do it if you want to find recently added files:
`sudo /usr/libexec/locate.updatedb`

View File

@@ -1,20 +1,20 @@
# md5
> Calculate MD5 cryptographic checksums
> Calculate MD5 cryptographic checksums.
- Print MD5 checksum for a file
- Print MD5 checksum for a file:
`md5 {{filename}}`
- Print MD5 checksum for each file in a list or directory
- Print MD5 checksum for each file in a list or directory:
`md5 {{filename1}} {{filename2}}`
`md5 {{directory/\*}}`
- Output only the md5 checksum (no filename)
- Output only the md5 checksum (no filename):
`md5 -q {{filename}}`
- Print a checksum of the given string
- Print a checksum of the given string:
`md5 -s {{string}}`

View File

@@ -1,15 +1,15 @@
# mdfind
> List files matching a given query
> List files matching a given query.
- Find a file by its name
- Find a file by its name:
`mdfind -name {{file}}`
- Find a file by its content
- Find a file by its content:
`mdfind {{query}}`
- Find a file containing a string, in a given directory
- Find a file containing a string, in a given directory:
`mdfind -onlyin {{directory}} {{query}}`

View File

@@ -1,23 +1,23 @@
# netstat
> Displays various networks related information such as open connections, open socket ports etc
> Displays various networks related information such as open connections, open socket ports etc.
- List all ports
- List all ports:
`netstat -a`
- List all listening ports
- List all listening ports:
`netstat -l`
- List listening TCP ports
- List listening TCP ports:
`netstat -t`
- Display PID and program names for a specific port
- Display PID and program names for a specific port:
`netstat -p {PROTOCOL}`
- List information continuously
- List information continuously:
`netstat -c`

View File

@@ -1,19 +1,19 @@
# networksetup
> Configuration tool for Network System Preferences
> Configuration tool for Network System Preferences.
- List available network service providers (Ethernet, Wi-Fi, Bluetooth, etc)
- List available network service providers (Ethernet, Wi-Fi, Bluetooth, etc):
`networksetup -listallnetworkservices`
- Show network settings for a particular networking device
- Show network settings for a particular networking device:
`networksetup -getinfo {{"Wi-Fi"}}`
- Get currently connected Wi-Fi network name (Wi-Fi device usually en0 or en1)
- Get currently connected Wi-Fi network name (Wi-Fi device usually en0 or en1):
`networksetup -getairportnetwork {{en0}}`
- Connect to a particular Wi-Fi network
- Connect to a particular Wi-Fi network:
`networksetup -setairportnetwork {{en0}} {{"Airport Network SSID"}} {{password}}`

View File

@@ -1,23 +1,23 @@
# open
> Opens files, directories and applications
> Opens files, directories and applications.
- Open a file with the associated application
- Open a file with the associated application:
`open {{file.ext}}`
- Run a graphical MacOSX application
- Run a graphical MacOSX application:
`open /Applications/{{Application.app}}`
- Open the current directory in Finder
- Open the current directory in Finder:
`open .`
- Reveal a file in finder
- Reveal a file in finder:
`open -R /path/dir/{{file}}`
- Open all the files of a given extension in the current directory with the associated application
- Open all the files of a given extension in the current directory with the associated application:
`open {{*.ext}}`

View File

@@ -1,11 +1,11 @@
# pbcopy
> Place standard output in the clipboard
> Place standard output in the clipboard.
- Place the contents of a file in the clipboard.
- Place the contents of a file in the clipboard:
`pbcopy < {{file}}`
- Place the results of a command in the clipboard
- Place the results of a command in the clipboard:
`find . -type t -name "*.png" | pbcopy`

View File

@@ -1,11 +1,11 @@
# pbpaste
> Send the contents of the clipboard to standard output
> Send the contents of the clipboard to standard output.
- Write the contents of the clipboard to a file.
- Write the contents of the clipboard to a file:
`pbpaste > {{file}}`
- Use the contents of the clipboard as input to a command.
- Use the contents of the clipboard as input to a command:
`pbpaste | grep foo`

View File

@@ -1,11 +1,11 @@
# qlmanage
> QuickLook server tool
> QuickLook server tool.
- displays QuickLook for one or multiple files
- Displays QuickLook for one or multiple files:
`quicklook -p {{filename}} {{filename2}}`
- Compute 300px wide PNG thumbnails of all JPEGs in the current directory and put them in a directory.
- Compute 300px wide PNG thumbnails of all JPEGs in the current directory and put them in a directory:
`quicklook *.jpg -t -s 300 {{/existing//thumbnail/directory}}`

View File

@@ -1,24 +1,24 @@
# route
> Manually manipulate the routing tables
> Manually manipulate the routing tables.
> Necessitates to be root.
- add a route to a destination through a gateway
- Add a route to a destination through a gateway:
`sudo route add {{dest_ip_address}} {{gateway_address}}`
- add a route to a /24 subnet through a gateway
- Add a route to a /24 subnet through a gateway:
`sudo route add {{subnet_ip_address}}/24 {{gateway_address}}`
- run in test mode (does not do anything, just print)
- Run in test mode (does not do anything, just print):
`sudo route -t add {{dest_ip_address}}/24 {{gateway_address}}`
- remove all routes
- Remove all routes:
`sudo route flush`
- delete a specific route
- Delete a specific route:
`sudo route delete {{dest_ip_address}}/24`

View File

@@ -1,19 +1,19 @@
# say
> Uses text to speech to speak through the default sound device
> Uses text to speech to speak through the default sound device.
- Speak a phrase aloud
- Speak a phrase aloud:
`say "I like to ride my bike."`
- Speak a file aloud
- Speak a file aloud:
`say -f {{filename}}`
- Create an AAC compressed audio file with the spoken text
- Create an AAC compressed audio file with the spoken text:
`say -o {{filename.m4a}} "Everyone loves iTunes"`
- List the available voices
- List the available voices:
`say -v '?'`

View File

@@ -1,19 +1,19 @@
# shutdown
> Shutdown and reboot the system
> Shutdown and reboot the system.
- Power off (halt) immediately
- Power off (halt) immediately:
`shutdown -h now`
- Sleep immediately
- Sleep immediately:
`shutdown -s now`
- Reboot immediately
- Reboot immediately:
`shutdown -r now`
- Reboot in 5 minutes
- Reboot in 5 minutes:
`shutdown -r +{{5}}`

View File

@@ -1,11 +1,11 @@
# sw_vers
> Print Mac OSX Software versioning information
> Print Mac OSX Software versioning information.
- Print OSX Version
- Print OSX Version:
`sw_vers -productVersion`
- Print OSX Build
- Print OSX Build:
`sw_vers -buildVersion`

View File

@@ -1,24 +1,24 @@
# sysctl
> Access kernel state information
> Access kernel state information.
- Show all available variables and their values
- Show all available variables and their values:
`sysctl -a`
- Show Apple model identifier
- Show Apple model identifier:
`sysctl -n hw.model`
- Show CPU model
- Show CPU model:
`sysctl -n machdep.cpu.brand_string`
- Show available CPU features (MMX, SSE, SSE2, SSE3, AES, etc)
- Show available CPU features (MMX, SSE, SSE2, SSE3, AES, etc):
`sysctl -n machdep.cpu.feature`
- Set a changeable kernel state variable
- Set a changeable kernel state variable:
`sysctl -w name=value`
`sysctl -w kern.maxfiles=15000`

View File

@@ -1,15 +1,15 @@
# system_profiler
> Report system hardware and software configuration
> Report system hardware and software configuration.
- Display a full system profiler report which can be opened by System Profiler.app
- Display a full system profiler report which can be opened by System Profiler.app:
`system_profiler -xml > MyReport.spx`
- Display a hardware overview (Model, CPU, Memory, Serial, etc)
- Display a hardware overview (Model, CPU, Memory, Serial, etc):
`system_profiler SPHardwareDataType`
- Print the system serial number
- Print the system serial number:
`system_profiler SPHardwareDataType|grep "Serial Number (system)" |awk '{print $4}'`

View File

@@ -1,29 +1,24 @@
# systemsetup
> Configure System Preferences machine settings
> Configure System Preferences machine settings.
- Enable remote login (SSH)
- Enable remote login (SSH):
`systemsetup -setremotelogin on`
- Specify TimeZone, NTP Server and enable network time
- Specify TimeZone, NTP Server and enable network time:
`systemsetup -settimezone {{US/Pacific}}`
`systemsetup -setnetworktimeserver {{us.pool.ntp.org}}`
`systemsetup -setusingnetworktime on`
- Make the machine never sleep; restart on freeze & power failure
- Make the machine never sleep; restart on freeze & power failure:
`systemsetup -setsleep off`
`systemsetup -setrestartpowerfailure on`
`systemsetup -setrestartfreeze on`
- List valid startup disks, specify a new startup disk
- List valid startup disks, specify a new startup disk:
`systemsetup -liststartupdisks`
`systemsetup -setstartupdisk {{path}}`

View File

@@ -2,22 +2,22 @@
> Display dynamic real-time information about running processes.
- Start top, all options are available in the interface
- Start top, all options are available in the interface:
`top`
- Start top sorting processes by internal memory size (default order - process ID)
- Start top sorting processes by internal memory size (default order - process ID):
`top -o mem`
- Start top sorting processes first by CPU, then by running time
- Start top sorting processes first by CPU, then by running time:
`top -o cpu -O time`
- Start top displaying only processes owned by given user
- Start top displaying only processes owned by given user:
`top -user {{user-name}}`
- Get help about interactive commands
- Get help about interactive commands:
`?`

View File

@@ -1,23 +1,23 @@
# wacaw
> a little command-line tool for Mac OS X that allows you to capture both still pictures and video from an attached camera.
> A little command-line tool for Mac OS X that allows you to capture both still pictures and video from an attached camera.
- Take a picture from webcam
- Take a picture from webcam:
`wacaw {{filename}}`
- Record a video
- Record a video:
`wacaw --video {{filename}} -D {{duration_in_seconds}}`
- Take a picture with custom resolution
- Take a picture with custom resolution:
`wacaw -x {{width}} -y {{height}} {{filename}}`
- Copy image just taken to clipboard
- Copy image just taken to clipboard:
`wacaw --to-clipboard`
- List the devices available
- List the devices available:
`wacaw -L`

View File

@@ -1,15 +1,15 @@
# XCTool
> Tool for building Xcode projects
> Tool for building Xcode projects.
- Build a single project without any workspace
- Build a single project without any workspace:
`xctool.sh -project {{YourProject.xcodeproj}} -scheme {{YourScheme}} build`
- Build a project that is part of a workspace
- Build a project that is part of a workspace:
`xctool -workspace {{YourWorkspace.xcworkspace}} -scheme {{YourScheme}} build`
- Clean, build and execute all the tests
- Clean, build and execute all the tests:
`xctool -workspace {{YourWorkspace.xcworkspace}} -scheme {{YourScheme}} clean build test`

View File

@@ -1,16 +1,16 @@
# xed
> Opens files for editing in XCode
> Opens files for editing in XCode.
- Open file(s) in XCode
- Open file(s) in XCode:
`xed {{file1}}`
`xed {{/path/to/file1}} {{/path/to/file2}}`
- Open file(s) in XCode, create if it doesn't exist
- Open file(s) in XCode, create if it doesn't exist:
`xed -c {{filename1}}`
- Open a file in XCode and jump to line number 75
- Open a file in XCode and jump to line number 75:
`xed -l 75 {{filename}}`

View File

@@ -1,11 +1,11 @@
# xsltproc
> Transform XML with XSLT to produce output (usually HTML or XML)
> Transform XML with XSLT to produce output (usually HTML or XML).
- Transform an XML file with a specific XSLT stylesheet
- Transform an XML file with a specific XSLT stylesheet:
`xsltproc --output {{output.html}} {{stylesheet.xslt}} {{xmlfile.xml}}`
- Pass a value to a parameter in the stylesheet
- Pass a value to a parameter in the stylesheet:
`xsltproc --output {{output.html}} --stringparam {{name}} {{value}} {{stylesheet.xslt}} {{xmlfile.xml}}`