7
An A-Z Index of the Apple OS X command line (TERMINAL) The tcsh command shell of Darwin (the open source core of OSX) alias Create an alias alloc List used and free memory awk Find and Replace text within file(s) basename Convert a full pathname to just a folder path bash Bourne-Again SHell (Linux) bless Set volume bootability and startup disk options. break Exit from a loop cal Display a calendar case Conditionally perform a command cat Display the contents of a file cd Change Directory chflags Change a file or folder's flags. chgrp Change group ownership chmod Change access permissions chown Change file owner and group chroot Run a command with a different root directory cksum Print CRC checksum and byte counts clear Clear terminal screen cmp Compare two files comm Compare two sorted files line by line complete Edit a command completion [word/pattern/list] continue Resume the next iteration of a loop cp Copy one or more files to another location cron Daemon to execute scheduled commands crontab Schedule a command to run at a later date/time cut Divide a file into several parts

Mac OS X Terminal Commands list

  • Upload
    dino

  • View
    323.920

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Mac OS X Terminal Commands list

An A-Z Index of the Apple OS X command line (TERMINAL)

The tcsh command shell of Darwin (the open source core of OSX)

alias Create an aliasalloc List used and free memoryawk Find and Replace text within file(s)

basename Convert a full pathname to just a folder pathbash Bourne-Again SHell (Linux)bless Set volume bootability and startup disk options.break Exit from a loop

cal Display a calendarcase Conditionally perform a commandcat Display the contents of a filecd Change Directorychflags Change a file or folder's flags.chgrp Change group ownershipchmod Change access permissionschown Change file owner and groupchroot Run a command with a different root directorycksum Print CRC checksum and byte countsclear Clear terminal screencmp Compare two filescomm Compare two sorted files line by linecomplete Edit a command completion [word/pattern/list]continue Resume the next iteration of a loopcp Copy one or more files to another locationcron Daemon to execute scheduled commandscrontab Schedule a command to run at a later date/timecut Divide a file into several parts

date Display or change the date & timedc Desk Calculatordd Data Dump - Convert and copy a filedf Display free disk spacediff Display the differences between two filesdiff3 Show differences among three filesdig DNS lookupdirname Convert a full pathname to just a pathdirs Display list of remembered directories

Page 2: Mac OS X Terminal Commands list

diskutil Disk utilities - Format, Verify, Repairditto Copy files and foldersdscl Directory Service command line utilitydu Estimate file space usage

echo Display message on screened A line-oriented text editor (edlin)enable Stop or start printers and classes.env Set environment and run a utilityeval Evaluate several commands/argumentsexec Execute a commandexit Exit the shellexpect Programmed dialogue with interactive programs Also see AppleScriptexpand Convert tabs to spacesexpr Evaluate expressions

false Do nothing, unsuccessfullyfdisk Partition table manipulator for Darwin UFS/HFS/DOSfind Search for files that meet a desired criteriafmt Reformat paragraph textfold Wrap text to fit a specified widthfor Expand words, and execute commandsforeach Loop, expand words, and execute commandsfsck Filesystem consistency check and repairfsaclctl Filesystem enable/disable ACL supportfs_usage Filesystem usage (process/pathname)ftp Internet file transfer program

GetFileInfo Get attributes of HFS+ filesgetopt Parse positional parametersgoto Jump to label and continue executiongrep Search file(s) for lines that match a given patterngroups Print group names a user is ingzip Compress or decompress files

head Display the first lines of a filehdiutil Manipulate iso disk imageshistory Command Historyhostname Print or set system name

id Print user and group names/id's

Page 3: Mac OS X Terminal Commands list

if Conditionally perform a commandinfo Help infoinstall Copy files and set attributes

jobs List active jobsjoin Join lines on a common field

kill Stop a process from running

l List files in long format (ls -l)ll List files in long format, showing invisible files (ls -la)less Display output one screen at a timeln Make links between files (hard links, symbolic links)locate Find fileslogname Print current login namelogin log into the computerlogout Exit a login shell (bye)lpr Print fileslprm Remove jobs from the print queuelpstat Printer status informationls List information about file(s)lsbom List a bill of materials filelsof List open files

man Help manualmkdir Create new folder(s)mkfifo Make FIFOs (named pipes)more Display output one screen at a timemount Mount a file systemmv Move or rename files or directories

net Manage network resources nice Set the priority of a commandnohup Run a command immune to hangups

onintr Control the action of a shell interruptopen Open a file/folder/URL/Applicationosascript Execute AppleScript

passwd Modify a user passwordpaste Merge lines of filespbcopy Copy data to the clipboard

Page 4: Mac OS X Terminal Commands list

pbpaste Paste data from the Clipboardpico Simple text editorping Test a network connectionpmset Power Management settingspopd Restore the previous value of the current directorypr Convert text files for printingprintenv Print environment variablesprintf Format and print dataps Process statuspushd Save and then change the current directorypwd Print Working Directory

quota Display disk usage and limits

rcp Copy files between machines.repeat Execute a command multiple timesrm Remove filesrmdir Remove folder(s)rpm Remote Package Managerrsync Remote file copy - Sync file tree (also RsyncX)

say Convert text to audible speechsched Schedule a command to run at a later time.screencapture Capture screen image to file or disksdiff Merge two files interactivelysecurity Administer Keychains, keys, certificates and the Security frameworksed Stream Editorset Set a shell variable = valuesetenv Set an environment variable = valuesetfile Set attributes of HFS+ filesshift Shift positional parametersshutdown Shutdown or restart OS Xsleep Delay for a specified timesoftwareupdate System software update toolsort Sort text filessplit Split a file into fixed-size piecesstop Stop a job or processsu Substitute user identitysudo Execute a command as another usersum Print a checksum for a fileswitch Conditionally perform a command

Page 5: Mac OS X Terminal Commands list

tail Output the last part of filestar Tape ARchivertee Redirect output to multiple filestest Condition evaluationtextutil Manipulate text files in various formatstime Measure Program Resource Usetouch Change file timestampstraceroute Trace Route to Hosttr Translate, squeeze, and/or delete characterstrue Do nothing, successfullytty Print filename of terminal on stdintype Describe a command

umask Users file creation maskumount a deviceunalias Remove an aliasuname Print system informationunexpand Convert spaces to tabsuniq Uniquify filesunits Convert units from one scale to anotherunset Remove variable or function namesunsetenv Remove environment variableusers Print login names of users currently logged inuuencode Encode a binary file uudecode Decode a file created by uuencodevi Text Editorwc Print byte, word, and line countswhere Report all known instances of a commandwhich Locate a program file in the user's pathwhile Execute commandswho Print all usernames currently logged onwhoami Print the current user id and name (`id -un')

xargs Execute utility - passing argumentsyes Print a string until interrupted

Note: tcsh is the default shell in OS X Jaguar (10.2)Panther (10.3) and Tiger (10.4) default to bash - many commands do work in either shell, but this page will soon be updated to list the bash syntax.