System info and preferences from the Terminal in Mac OS X

System info and preferences from the Terminal in Mac OS X

sw_vers

Syntax:sw_vers

Explanation:Displays a system summary of your Mac.

  • Product name
  • Version of your O/S
  • Build-version

system_profiler

Syntax:system_profiler [-Options or Type(s)]

Usage/Explanation:Displayed detailed information about your Mac including the hardware.

Options

-detailLevel <lvl>Decide how detailed the description will be. <lvl> can be minibasic or full.
-listDataTypesDisplays all available categories (as specified below).

CategoriesBelow is a list of all available information categories you can choose to view.

  • SPHardwareDataType
  • SPNetworkDataType
  • SPSoftwareDataType
  • SPParallelATADataType
  • SPAudioDataType
  • SPBluetoothDataType
  • SPDiagnosticsDataType
  • SPDiscBurningDataType
  • SPEthernetDataType
  • SPFibreChannelDataType
  • SPFireWireDataType
  • SPDisplaysDataType
  • SPHardwareRAIDDataType
  • SPMemoryDataType
  • SPPCIDataType
  • SPParallelSCSIDataType
  • SPPowerDataType
  • SPPrintersDataType
  • SPSASDataType
  • SPSerialATADataType
  • SPUSBDataType
  • SPAirPortDataType
  • SPFirewallDataType
  • SPNetworkLocationDataType
  • SPModemDataType
  • SPNetworkVolumeDataType
  • SPWWANDataType
  • SPApplicationsDataType
  • SPDeveloperToolsDataType
  • SPExtensionsDataType
  • SPFontsDataType
  • SPFrameworksDataType
  • SPLogsDataType
  • SPManagedClientDataType
  • SPPrefPaneDataType
  • SPStartupItemDataType
  • SPSyncServicesDataType
  • SPUniversalAccessDataType

Exempel

system_profilerDisplays information about your Mac computer (standard level)
system_profiler -detailLevel miniDisplays a minimal summary of your system information.
system_profiler SPHardwareDataType SPNetworkDataTypeOnly display information from the category SPHardwareDataType and SPNetworkDataType.

diskutil

Syntax:diskutil <funktion> [-Options]

Explanation:Manage all mounted disks on your Mac: Harddrives, network drives etc.

Example of things you can do with diskutil

  • List all mounted discs/harddrives on your Mac
  • View information about a disc/harddrive
  • Unmount a disc
  • Change name of a disc
  • Verify and repair data on a disc.
  • Format a disc
  • Partition discs/harddrives

More information

df

Syntax:df [-Options]

Explanation/Usage:Displays space usage of your discs: Total size, space usage, available space.

Options

-hView space usage in readable values: kilobytes/megabytes/gigabytes instead of just bytes.
-lOnly show local discs (no network drives and such).

Example

df -hDisk space usage displayed in kb/mb/gb
df -lDisk space usage on local drives.

uptime

Syntax:uptime

Explanation:Display the uptime of your computer/how long your computer has been turned on.

last reboot

Syntax:last reboot

Explanation:Displays a list of date with the exact time when you last rebooted your computer.

More to read: Post tweets directly from the Terminal in Mac OS X using cURL