The Ultimate A-Z Index of Apple OS X/Linux command line commands

I’m forever trying to remember command line commands for Linux or Mac OS X. I picked up this list a while ago and keep around in a text file but decided to post it here so I can get to it whenever I don’t have my laptop with me. Some of the commands are bash built-in commands but most will work on either OS. Feel free to add to the list.

Bbasename – Convert a full pathname to just a filenamebash – Bourne-Again SHellbg – Send to backgroundbind – Display readline key and function bindingsbless – Set volume bootability and startup disk options.break – Exit from a For, While, Until or Select loopbuiltin – Execute a shell builtinbzip – Compress or decompress filesCcal – Display a calendarcaller – Return the context of a subroutine callcase – Conditionally perform a commandcat – Concatenate and print (display) the contents of file(s)cd – Change Directorychflags – Change a file or folder’s flagschgrp – 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 linecommand – Run a command (not a function)complete – 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/timecurl – Transfer data from or to a servercut – Divide a file into several parts

Hhalt – Stop and restart the operating systemhash – Refresh the cached/remembered location of commandshead – Display the first lines of a filehdiutil – Manipulate iso disk imageshistory – Command Historyhostname – Print or set system name

Iiconv – Convert the character set of a fileid – Print user and group names/id’sif – Conditionally perform a commandinfo – Help infoinstall – Copy files and set attributes

Nnet – Manage network resourcesnetstat – Show network statusnetworksetup – Network and System Preferencesnice – Set the priority of a commandnohup – Run a command immune to hangupsntfs.util – NTFS file system utility

Oonintr – Control the action of a shell interruptopen – Open a file/folder/URL/Applicationopensnoop – Snoop file opens as they occurosacompile – Compile Applescriptosascript – Execute AppleScript

Wwait – Wait for a process to completewc – Print byte, word, and line countswhatis – Search the whatis database for complete wordswhere – Report all known instances of a commandwhich – Locate a program file in the user’s pathwhile – Loop commandwho – Print all usernames currently logged onwhoami – Print the current user id and namewrite – Send a message to another user