I am new to mac terminal and I have made some folder using command "sudo mkdir". Some of this folders are hidden :/, in other words I have put a period before their names when using command mkdir. Now, I want to delete those folders. How can I find those folders?
Folders created by “sudo mkdir” stored
sudoterminal
Best Answer
mkdir
, in the form ofmkdir directory_name
without a pathname, creates a directory in the current working directory, which is by default your home directory (often represented as~
). You can check you current working directory by runningpwd
.If you were not in your home directory (either by having
cd
-ed to a different directory or having used theNew Terminal at Folder
Service) you will have to navigate to the directory you were in first.You can show all files (including hidden ones) in a directory by running
ls -a
in it. Once you have found the directories you want to delete, you can permanently (!) remove them usingrm -R directoryNameHere
(including the.
in the name) from their parent directory.If you don't feel confident deleting files in the Terminal, you can simply show hidden file in Finder, in macOS Sierra and later, by using Shift+⌘+. and then deleting them like you would any other directory.