mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-06 12:46:02 +02:00
Merge pull request #81 from notpeter/master
A bunch of new pages, split du back into osx/linux
This commit is contained in:
commit
06ee4048bb
42 changed files with 598 additions and 26 deletions
19
common/cal.md
Normal file
19
common/cal.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# cal
|
||||
|
||||
> Prints calendar information
|
||||
|
||||
- Display a calendar for the current month or specified month
|
||||
|
||||
`cal`
|
||||
`cal -m {{12}}`
|
||||
`cal -m {{Dec}}`
|
||||
|
||||
- Display a calendar for the current year or a specified year
|
||||
|
||||
`cal -y`
|
||||
`cal 2013`
|
||||
|
||||
- Display date of Easter (western churches)
|
||||
|
||||
`ncal -e`
|
||||
`ncal -e 2013`
|
8
common/cksum.md
Normal file
8
common/cksum.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# cksum
|
||||
|
||||
> Calculates CRC checksums and byte counts of a file
|
||||
> Note, on old UNIX systems the CRC implementation may differ.
|
||||
|
||||
- Display a 32 bit checksum, size in bytes and filename
|
||||
|
||||
`chksum {{filename}}`
|
10
common/cp.md
10
common/cp.md
|
@ -10,10 +10,12 @@
|
|||
|
||||
`cp {{/path/to/original}} ../{{/path/to/copy}}`
|
||||
|
||||
- Copy directories recursive using the option -r.
|
||||
- Copy directories recursive using the option -r. Optionally showing files as they are copied.
|
||||
|
||||
`cp -r {{/path/to/original}} {{/path/to/copy}}`
|
||||
|
||||
- Copy files in verbose mode, showing files as they are copied. (Mostly interesting with -r option).
|
||||
|
||||
`cp -vr {{/path/to/original}} {{/path/to/copy}}`
|
||||
|
||||
- Make a copy of a file adding and extension or changing an extension
|
||||
|
||||
`cp {{file.html}}\{,.backup\}`
|
||||
`cp file.\{html,backup\}`
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
> Transfers data from or to a server
|
||||
> Supports most protocols including HTTP, FTP, POP
|
||||
|
||||
- Download a URL to a file
|
||||
|
||||
`curl "{{URL}}" -o filename`
|
||||
|
||||
- send form-encoded data
|
||||
|
||||
`curl --data {{name=bob}} {{http://localhost/form}}`
|
||||
|
|
15
common/dig.md
Normal file
15
common/dig.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# dig
|
||||
|
||||
> DNS Lookup utility
|
||||
|
||||
- Lookup the IP(s) associated with a hostname (A records)
|
||||
|
||||
``dig +short {{hostname.com}}`
|
||||
|
||||
- Lookup the mail server associated with a given domain name (MX record)
|
||||
|
||||
``dig +short {{hostname.com}} MX`
|
||||
|
||||
- Specify an alternate DNS server to query (8.8.8.8 is google's public DNS)
|
||||
|
||||
`dig @8.8.8.8 {{hostname.com}}`
|
19
common/du.md
19
common/du.md
|
@ -1,19 +0,0 @@
|
|||
# du
|
||||
|
||||
> Estimate file space usage
|
||||
|
||||
- get file sizes of directory's content
|
||||
|
||||
`du {{file/directory}}`
|
||||
|
||||
- get total size in human readable form
|
||||
|
||||
`du -sh {{file/directory}}`
|
||||
|
||||
- get recursively, individual file/folder sizes in human readable form
|
||||
|
||||
`du -ah {{directory}}`
|
||||
|
||||
- get file sizes till a specified depth
|
||||
|
||||
`du --max-depth=1`
|
|
@ -15,3 +15,7 @@
|
|||
- find files modified since a certain time
|
||||
|
||||
`find {{root_path}} -name {{'*.py'}} -mtime {{-1d}}`
|
||||
|
||||
- find files using case insensitive name matching, of a certain size
|
||||
|
||||
`find {{root_path}} -size +500k -size -10MB -iname {{'*.TaR.gZ'}}`
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
`grep -C 3 {{something}} {{file_path}}`
|
||||
|
||||
- print the number of matches
|
||||
- print the count of matches instead of the matching text
|
||||
|
||||
`grep -c {{something}} {{file_path}}`
|
||||
|
||||
|
|
23
common/gzip.md
Normal file
23
common/gzip.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
# gzip
|
||||
|
||||
> Compress/uncompress files with gzip compression (LZ77)
|
||||
|
||||
- compress a file, replacing it with a gzipped compressed version
|
||||
|
||||
`gzip {{file.ext}}`
|
||||
|
||||
- decompress a file, replacing it with the original uncomrpessed version
|
||||
|
||||
`gzip -d {{file.ext.gz}}`
|
||||
|
||||
- compress a file specifying the output filename
|
||||
|
||||
`gzip -c {{file.ext}} > compressed-file.ext.gz`
|
||||
|
||||
- uncompress a gzipped file specifying the output filename
|
||||
|
||||
`gzip -c -d {{file.ext.gz}} > uncompressed-file.ext`
|
||||
|
||||
- specify the compression level. 1=Fastest (Worst), 9=Slowest (Best), Default level is 6
|
||||
|
||||
`gzip -9 -c {{file.ext}} > compressed-file.ext.gz`
|
|
@ -5,3 +5,7 @@
|
|||
- list all running processes
|
||||
|
||||
`ps aux`
|
||||
|
||||
- list all running processes including the full command string
|
||||
|
||||
`ps auxww`
|
||||
|
|
15
common/rm.md
Normal file
15
common/rm.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# rm
|
||||
|
||||
> Remove files or directories
|
||||
|
||||
- Remove files from arbitrary locations
|
||||
|
||||
`rm {{/path/to/file}} {{/otherpath/to/file2}}`
|
||||
|
||||
- Remove recursively a directory and all it's subdirectories
|
||||
|
||||
`rm -r {{/path/to/folder}}`
|
||||
|
||||
- Prompt before every removal
|
||||
|
||||
`rm -i {{\*}}`
|
15
common/sort.md
Normal file
15
common/sort.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# sort
|
||||
|
||||
> sort lines of text files
|
||||
|
||||
- Sort a file in ascending order
|
||||
|
||||
`sort {{filename}}`
|
||||
|
||||
- Sort a file in descending order
|
||||
|
||||
`sort -r {{filename}}`
|
||||
|
||||
- Sort passwd file by the 3rd field
|
||||
|
||||
`sort -t: -k 3n /etc/passwd `
|
18
common/srm.md
Normal file
18
common/srm.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
# srm
|
||||
|
||||
> Securely remove files or directories
|
||||
> Overwrites the existing data one or multiple. Drop in replacement for rm.
|
||||
|
||||
- Removes a file after overwriting (single pass, 7 pass, 35 pass)
|
||||
|
||||
`srm -s {{/path/to/file}}`
|
||||
`srm -m {{/path/to/file}}`
|
||||
`srm {{/path/to/file}}`
|
||||
|
||||
- Scurely remove recursively a directory and all it's subdirectories
|
||||
|
||||
`srm -r {{/path/to/folder}}`
|
||||
|
||||
- Prompt before every removal
|
||||
|
||||
`srm -i {{\*}}`
|
|
@ -11,6 +11,10 @@
|
|||
|
||||
`ssh {{username}}@{{remote_host}} -P {{2222}}`
|
||||
|
||||
- ssh tunneling
|
||||
- ssh tunneling: dynamic port forwarding (SOCKS proxy on localhost:9999)
|
||||
|
||||
`ssh -D {{9999}} -C {{username}}@{{remote_host}}`
|
||||
|
||||
- ssh tunneling: forward a specific port (localhost:9999 to slashdot.org:80)
|
||||
|
||||
`ssh -L {{9999}}:slashdot.org:80 {{username}}@{{remote_host}}`
|
||||
|
|
16
common/touch.md
Normal file
16
common/touch.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# touch
|
||||
|
||||
> Change a file access and modification times (atime, mtime)
|
||||
|
||||
- Create a new empty file(s) or change the times for existing file(s) to current time.`
|
||||
|
||||
`touch {{filename}}`
|
||||
|
||||
- Set the times on a file to those specified
|
||||
|
||||
`touch -t 201412250801.59 {{filename}}
|
||||
`touch -t {{YYYYMMDDHHMM.SS}} {{filename}}
|
||||
|
||||
- Set the times on a file to match those on second file
|
||||
|
||||
`touch -r {{filename2}} {{filename}}`
|
15
common/uname.md
Normal file
15
common/uname.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# uname
|
||||
|
||||
> Print operating system name
|
||||
|
||||
- Print all available operating system and kernel information
|
||||
|
||||
`uname -a`
|
||||
|
||||
- Print the current operating system name (e.g. Linux, Darwin, SunOS, etc)
|
||||
|
||||
`uname -s`
|
||||
|
||||
- Print the nodename (hostname) of the system
|
||||
|
||||
`uname -n`
|
|
@ -9,3 +9,7 @@
|
|||
- extract zip files(s) to given path
|
||||
|
||||
`unzip {{files(s)}} -d {{/path/to/put/extracted/files}}`
|
||||
|
||||
- list the contents of a zip file without extracting
|
||||
|
||||
`unzip -l {{file}}
|
||||
|
|
12
common/which.md
Normal file
12
common/which.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# which
|
||||
|
||||
> Locate the a program in the user's path
|
||||
|
||||
- Display the path of an executable program
|
||||
|
||||
`which {{ls}}`
|
||||
`which {{executable}}`
|
||||
|
||||
- If there are multiple executables which match, display all
|
||||
|
||||
`which -a {{executable}}`
|
27
common/zfs.md
Normal file
27
common/zfs.md
Normal file
|
@ -0,0 +1,27 @@
|
|||
# zfs
|
||||
|
||||
> Manage ZFS filesystems
|
||||
|
||||
- List all available zfs filesystems
|
||||
|
||||
`zfs list`
|
||||
|
||||
- Create a new ZFS filesystem
|
||||
|
||||
`zfs create poolname/newfsname`
|
||||
|
||||
- Delete a ZFS filesystem
|
||||
|
||||
`zfs destroy {{poolname/newfsname}}`
|
||||
|
||||
- Create a Snapshot of a ZFS filesystem
|
||||
|
||||
`zfs snapshot {{poolname/filesystem@snapshot-name}}`
|
||||
|
||||
- Enable compression on a filesystem
|
||||
|
||||
`zfs set compression=on {{poolname/fileystem}}`
|
||||
|
||||
- Change mountpoint for a filesytem
|
||||
|
||||
`zfs set mountpoint={{/my/mount/path}} {{poolname/filesystem}}`
|
|
@ -1,6 +1,6 @@
|
|||
# zip
|
||||
|
||||
> package and compress (archive) files into zip file
|
||||
> Package and compress (archive) files into zip file
|
||||
|
||||
- package and compress multiple directories & files
|
||||
|
||||
|
|
33
common/zpool.md
Normal file
33
common/zpool.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
# zpool
|
||||
|
||||
> Manage ZFS pools
|
||||
|
||||
- Show the configuration and status of all ZFS zpools
|
||||
|
||||
`zpool status [{{poolname}}]`
|
||||
|
||||
- Check a ZFS pool for errors (verifies the checksum of EVERY block). Very CPU and disk intensive.
|
||||
|
||||
`zpool scrub {{poolname}}`
|
||||
|
||||
- List zpools available for import
|
||||
|
||||
`zpool import`
|
||||
|
||||
- Import a zpool, optionally specifying a new name
|
||||
|
||||
`zpool import {{poolname}}`
|
||||
`zpool import {{poolname}} {{newpoolname}}`
|
||||
|
||||
- Export a zpool (unmount all filesystems)
|
||||
|
||||
`zpool export {{poolname}}`
|
||||
|
||||
- Show the history of all pool operations
|
||||
|
||||
`zpool histrory {{poolname}}`
|
||||
|
||||
- Create a mirrored pool.
|
||||
|
||||
`zpool create {{poolname}} mirror {{disk1}} {{disk2}}`
|
||||
`zpool create {{poolname}} mirror {{disk1}} {{disk2}} mirror {{disk3}} {{disk4}}`
|
24
linux/apt-get.md
Normal file
24
linux/apt-get.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
# apt-get
|
||||
|
||||
> Debian and Ubuntu package management utility
|
||||
|
||||
- Synchronize list of packages and versions available. This should be run first, before running subsequent apt-get commands.
|
||||
|
||||
`apt-get update`
|
||||
|
||||
- install a new package
|
||||
|
||||
`apt-get install {{package}}`
|
||||
|
||||
|
||||
- remove a package
|
||||
|
||||
`apt-get remove {{package}}`
|
||||
|
||||
- Upgrade installed packages to newest available versions
|
||||
|
||||
`apt-get upgrade`
|
||||
|
||||
- Upgrade installed packages (like `apt-get upgrade`) including removing obsolete packages and installing additional packages to meet new package dependencies.
|
||||
|
||||
`apt-get dist-upgrade`
|
19
linux/du.md
Normal file
19
linux/du.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# du
|
||||
|
||||
> Estimate file space usage
|
||||
|
||||
- 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
|
||||
|
||||
`du -k {{file/directory}}`
|
||||
|
||||
- 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
|
||||
|
||||
`du --max-depth=1`
|
13
linux/md5sum.md
Normal file
13
linux/md5sum.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# md5sum
|
||||
|
||||
> Calculate MD5 cryptographic checksums
|
||||
|
||||
- Calculate the MD5 checksum for file(s) or files in a directory, one checksum per file
|
||||
|
||||
`md5sum {{filename1}}`
|
||||
`md5sum {{filename1}} {{filename2}}`
|
||||
`md5sum {{directory/\*}}`
|
||||
|
||||
- Read a file of MD5SUMs and verify all files have matching checksums
|
||||
|
||||
`md5sum -c {{filename.md5}}`
|
16
linux/shutdown.md
Normal file
16
linux/shutdown.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# shutdown
|
||||
|
||||
> Shutdown and reboot the system
|
||||
|
||||
- Reboot or poweroff (halt) the system immediately
|
||||
|
||||
`shutdown -r now`
|
||||
`shutdown -h now`
|
||||
|
||||
- Reboot in 5 minutes.
|
||||
|
||||
`shutodwn -r +5 &`
|
||||
|
||||
- Cancel a pending shutdown/reboot operation
|
||||
|
||||
`shutdown -c`
|
15
osx/airport.md
Normal file
15
osx/airport.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Airport
|
||||
|
||||
> Airport utility
|
||||
|
||||
- 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
|
||||
|
||||
`airport -s`
|
||||
|
||||
- Disassociate from current airport network
|
||||
|
||||
`sudo airport -z`
|
13
osx/caffeinate.md
Normal file
13
osx/caffeinate.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# caffeinate
|
||||
|
||||
> Prevent a system from sleeping
|
||||
|
||||
- Prevent mac from sleeping for 1 hour (3600 seconds)
|
||||
|
||||
`caffeinate -u -t 3600`
|
||||
|
||||
- Prevent mac from sleeping until a command completes
|
||||
|
||||
`caffeinate -s {{command}}`
|
||||
|
||||
|
23
osx/diskutil.md
Normal file
23
osx/diskutil.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
# diskutil
|
||||
|
||||
> Utility to manage local disks and volumes
|
||||
|
||||
- List all currently available disks, partitions and mounted volumes.
|
||||
|
||||
`diskutil list`
|
||||
|
||||
- Repair permissions on a volume
|
||||
|
||||
`diskutil repairPermissions {{/Volumes/Name}}`
|
||||
|
||||
- Repair the file system data structures of a volume
|
||||
|
||||
`diskutil repairVolume {{/dev/diskX}}
|
||||
|
||||
- Unmount a volume
|
||||
|
||||
`diskutil unmountDisk {{/dev/diskX}}`
|
||||
|
||||
- Eject a CD/DVD (unmount first)
|
||||
|
||||
`diskutil eject {{/dev/disk1}}`
|
12
osx/drutil.md
Normal file
12
osx/drutil.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# drutil
|
||||
|
||||
> Interact with DVD burners
|
||||
|
||||
- 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.
|
||||
|
||||
`drutil burn -noverify -eject -iso9660`
|
||||
|
19
osx/du.md
Normal file
19
osx/du.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# du
|
||||
|
||||
> Estimate file space usage
|
||||
|
||||
- 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
|
||||
|
||||
`du -k {{file/directory}}`
|
||||
|
||||
- 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
|
||||
|
||||
`du -k -depth=1 {{directory}}`
|
13
osx/md5.md
Normal file
13
osx/md5.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# md5
|
||||
|
||||
> Calculate MD5 cryptographic checksums
|
||||
|
||||
- Calculate the MD5 checksum for file(s) or files in a directory, one checksum per file
|
||||
|
||||
`md5 {{filename1}}`
|
||||
`md5 {{filename1}} {{filename2}}`
|
||||
`md5 {{directory/\*}}`
|
||||
|
||||
- Output only the md5 checksum (no filename)
|
||||
|
||||
`md5 -q {{filename}}`
|
19
osx/networksetup.md
Normal file
19
osx/networksetup.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# networksetup
|
||||
|
||||
> Configuration tool for Network System Preferences
|
||||
|
||||
- List available network service providers (Ethernet, Wi-Fi, Bluetooth, etc)
|
||||
|
||||
`networksetup -listallnetworkservices`
|
||||
|
||||
- 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)
|
||||
|
||||
`networksetup -getairportnetwork {{en0}}`
|
||||
|
||||
- Connect to a particular Wi-Fi network
|
||||
|
||||
`networksetup -setairportnetwork {{en0}} {{"Airport Network SSID"}} {{password}}
|
23
osx/open.md
Normal file
23
osx/open.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
# open
|
||||
|
||||
> Opens files, directories and applications
|
||||
|
||||
- Open a file with the associated application
|
||||
|
||||
`open filename.ext`
|
||||
|
||||
- Run a graphical MacOSX application
|
||||
|
||||
`open /Applications/iTunes.app`
|
||||
|
||||
- Open the current directory in Finder
|
||||
|
||||
`open .`
|
||||
|
||||
- Reveal a file in finder
|
||||
|
||||
`open -R /path/dir/file`
|
||||
|
||||
- Open all the word docs in the current directory with Microsoft Word
|
||||
|
||||
`open *.doc`
|
15
osx/pgrep.md
Normal file
15
osx/pgrep.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# pgrep
|
||||
|
||||
> Find or signal process by name
|
||||
|
||||
- return PIDs of any running processes with a matching command string
|
||||
|
||||
`pgrep {{Finder}}`
|
||||
|
||||
- case insensitive greping
|
||||
|
||||
`pgrep -i {{fireFOx}}`
|
||||
|
||||
- kill all processes which match
|
||||
|
||||
`pkill -9 {{Finder}}`
|
11
osx/qlmanage.md
Normal file
11
osx/qlmanage.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# qlmanage
|
||||
|
||||
> QuickLook server tool
|
||||
|
||||
- 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.
|
||||
|
||||
`quicklook *.jpg -t -s 300 {{/existing//thumbnail/directory}}`
|
14
osx/say.md
Normal file
14
osx/say.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# say
|
||||
|
||||
> Uses text to speech to speak through the default sound device
|
||||
|
||||
- Speak a phrase aloud
|
||||
|
||||
`say "I like to ride my bike.`
|
||||
|
||||
- Speak a file aloud
|
||||
|
||||
`say -f {{filename}}`
|
||||
|
||||
- Create an AAC compressed audio file with the spoken text
|
||||
`say -o {{filename.m4a}} "Everyone loves iTunes"`
|
13
osx/shutdown.md
Normal file
13
osx/shutdown.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# shutdown
|
||||
|
||||
> Shutdown and reboot the system
|
||||
|
||||
- Reboot, poweroff (halt) or sleep immediately
|
||||
|
||||
`shutdown -r now`
|
||||
`shutdown -h now`
|
||||
`shutdown -s now`
|
||||
|
||||
- Reboot in 5 minutes.
|
||||
|
||||
`shutodwn -r +5`
|
12
osx/sw_vers.md
Normal file
12
osx/sw_vers.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# sw_vers
|
||||
|
||||
> Print Mac OSX Software versioning information
|
||||
|
||||
- Print OSX Version
|
||||
|
||||
`sw_vers -productVersion`
|
||||
|
||||
- Print OSX Build
|
||||
|
||||
`sw_vers -buildVersion`
|
||||
|
24
osx/sysctl.md
Normal file
24
osx/sysctl.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
# sysctl
|
||||
|
||||
> Access kernel state information
|
||||
|
||||
- Show all available variables and their values
|
||||
|
||||
`sysctl -a`
|
||||
|
||||
- Show Apple model identifier
|
||||
|
||||
`sysctl -n hw.model`
|
||||
|
||||
- Show CPU model
|
||||
|
||||
`sysctl -n machdep.cpu.brand_string`
|
||||
|
||||
- Show available CPU features (MMX, SSE, SSE2, SSE3, AES, etc)
|
||||
|
||||
`sysctl -n machdep.cpu.feature`
|
||||
|
||||
- Set a changeable kernel state variable
|
||||
|
||||
`sysctl -w name=value`
|
||||
`sysctl -w kern.maxfiles=15000`
|
15
osx/system_profiler.md
Normal file
15
osx/system_profiler.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
# system_profiler
|
||||
|
||||
> Report system hardware and software configuration
|
||||
|
||||
- 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)
|
||||
|
||||
`system_profiler SPHardwareDataType`
|
||||
|
||||
- Print the system serial number
|
||||
|
||||
`system_profiler SPHardwareDataType|grep "Serial Number (system)" |awk '{print $4}'`
|
24
osx/systemsetup.md
Normal file
24
osx/systemsetup.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
# systemsetup
|
||||
|
||||
> Configure System Preferences machine settings
|
||||
|
||||
- Enable remote login (SSH)
|
||||
|
||||
`systemsetup -setremotelogin on`
|
||||
|
||||
- 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
|
||||
|
||||
`systemsetup -setsleep off`
|
||||
`systemsetup -setrestartpowerfailure on`
|
||||
`systemsetup -setrestartfreeze on`
|
||||
|
||||
- List valid startup disks, specify a new startup disk
|
||||
|
||||
`systemsetup -liststartupdisks`
|
||||
`systemsetup -setstartupdisk {{path}}`
|
16
osx/xed.md
Normal file
16
osx/xed.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# xed
|
||||
|
||||
> Opens files for editing 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
|
||||
|
||||
`xed -c {{filename1}}`
|
||||
|
||||
- Open a file in XCode and jump to line number 75
|
||||
|
||||
`xed -l 75 {{filename}}`
|
Loading…
Add table
Reference in a new issue