Click Utilities, then Terminal in the page that opens. Open your Mac's "Finder". Mac OSX Open Terminal and run the following. Force Secure Delete Anything cp -R <”newdir”> Copy a folder to another folder with spaces in its name. rm -rf directoryname Windows Right-click the folder and choose Delete. Click "Services" found the below the drop-down menu which appears. However, when we checked the System Preferences and tried to delete the account, the account was not there. in terminal change directory to the one you are trying to delete and type sudo rm -r * this will remove *all* files in that directory then try devonferns method again knowing that if anything was in the folder its not there anymore. Secure Delete an Entire Directory. -search /Users name username. ; It allows you to unlock all preference settings: Everything you can customize can be unlocked using Terminal, even things you can't access through the GUI. Type the rm command, a space, and then the name of the file you want to delete.. rm file_1.txt. Note: this works for Git Clone and Git Init To delete all the files and sub-folders in a directory named "oldfolder", the command is rm -R oldfolder and to confirm each file should be deleted, rm -iR oldfolder. This excellent post led me to resolve the problem. The -r flag can be applied to srm to make it delete recursively, thereby applying to directories and their contents: srm -r /path/to/directory/ Again, deleting may take a moment or two because everything is being overwritten 35 times after it’s been deleted. Some MacOS users might be intimidated by the Terminal and its commands. /usr/bin/dscl . The application is in the folder that opens. It’s a relatively blunt instrument, deleting only those files and folders you specify. Open the macOS Terminal, either by using Spotlight search or by going to Applications —> Terminal. To search for a user, use this command. ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. David Kittell February 19, 2016. After installing ODS in the Applications folder, drag or copy — do not type — the following line into the Terminal window, then press return: It rings true to Unix: Mac users coming over from Unix will find Terminal easier to use due to its similarity. On Mac OS X. To bring up a command line / command prompt under Mac OS X launch the Terminal application located in the Utilities folder inside your Applications folder; The table below lists command line commands to remove files and folders It will goes to Recycle bin. 6. In the next step, you’ll want to type a simple command into the terminal — but don’t hit return just yet! If the file is not in the current working directory, provide a path to the file’s location. 7. When using Terminal on Mac, it might look like you are trying to hack into a system. 4. Right-click on the chosen folder (make sure you don't enter it, though). The simplest case is deleting a single file in the current directory. Remove a directory and its contents. In this document I use the user name “administrator” as the account that I do the work in and would like to keep, your user name may be different. The Terminal window will open up. Type this command, followed by a space: lsof; Then, drag the annoying file from the Trash directly onto the Terminal window. We were therefore unable to delete the local user account. touch Create a new file. Recently I had to remove users from a Mac that was on a network only with SSH available. 5. How to Remove Files with rm. Mac OS X – Remove Users In Terminal/SSH. If you want to delete everything (.git folder, files and folders), just delete the whole directory. to see what is in the directory type "ls -a" ( -a is the show all option) you could also try "ls -Rpa" Go to the folder with the files to be permanently deleted. Click on "New Terminal at Folder." Just because you can use Terminal to delete files on your Mac, doesn’t mean you should. Another drop-down window will appear. What is a Terminal on Mac?