dscl [datasource]

Directory Service command line utility

Arguments

NameDescription
datasource

Subcommands

NameDescription
read, -readPrints a directory
readall, -readallPrints all the records of a given type
readpl, -readplPrints the contents of plist_path
readpli, -readpliPrints the contents of plist_path for the plist at value_index of the key
list, -list, ls, -lsLists the subdirectories of the given directory
search, -searchSearches for records that match a pattern
create, -create, mk, -mkCreates a new record
createpl, -createplCreates a string, or array of strings at plist_path
createpli, -createpliCreates a string, or array of strings at plist_path for the plist at value_index of the key
append, -appendAppends one or more values to a property in a given record
merge, -mergeAppends one or more values to a property in a given directory if the property does not already have those values
delete, -delete, rm, -rmDelete a directory, property, or value
deletepl, -deleteplDeletes a value in a plist
deletepli, -deletepliDeletes a value for the plist at value_index of the key
change, -changeReplaces the given old value in the list of values of the given key with the new value in the specified record
changei, -changeiReplaces the value at the given index in the list of values of the given key with the new value in the specified record
diff, -diffCompares the data from path1 and path2 looking at the specified keys (or all if no keys are specified)
passwd, -passwdChanges the password of a user

Options

NameDescription
-pPrompt for password
-u <user>Authenticate as user
-P <password>Authenticate with password
-f <file>Targeted local node database file path
-rawDon't strip off prefix from DirectoryService API constants
-plistPrint out record(s) or attribute(s) in XML plist format
-urlPrint record attribute values in URL-style encoding
-qQuiet - no interactive prompt