You delete the file directly using rm
command. Location will be one of the following depending upon whether the keychain is in system
domain or user
domain.
System domain keychain location
$ ls -l /Library/Keychains/
total 392
-rw-r--r-- 1 root wheel 20460 Aug 21 2014 ConnectedBackup.keychain
-rw-r--r-- 1 root wheel 23732 Aug 21 2014 FileVaultMaster.keychain
-rw-r--r-- 1 root wheel 89560 Sep 19 21:37 System.keychain
-rw-r--r-- 1 root wheel 20460 Nov 10 2014 System.keychain-orig
User domain keychain location
$ ls -l ~/Library/Keychains/
total 1392
drwx------ 8 Kevin 1437522721 272 Jul 1 2015 386EC17D-8428-522E-B9DD-CE89C60F0F10
-rw-r--r--@ 1 Kevin 1437522721 40776 Jan 25 2016 Microsoft_Entity_Certificates
-rw-r--r--@ 1 Kevin 1437522721 34368 Jan 25 2016 Microsoft_Intermediate_Certificates
-rw-r--r--@ 1 Kevin 1437522721 513136 Sep 27 20:05 login.keychain
-rw------- 1 Kevin 1437522721 87552 Sep 28 16:59 metadata.keychain
So if you want to delete login
keychain from user domain you would
$ rm -rf ~/Library/Keychains/login.keychain
(Name of the keychain as it appears in the keychain utility is filename without the suffix .keychain
)
EDIT
macOS Sierra and above have -db
extensions