How to find a folder on your computer

How to find a folder on your computer

I have a lot of folders containing projects on my computer. Sometimes I don't remember where I have placed them! This happened to me recently. The general command to run if you want to look through ALL the directories on your computer is the following:

find / -type d -name "kali-linux-fundamentals"        

find represents the find command. / represents the top root directory on my macOS device. -type followed by the type I am looking for, which is a folder, is then followed by d, which represents "directory". -name is followed by the name of the directory I am looking for enclosed in double quotes. However, it could take a long time to go through ALL directories on one's device, and there also would be a lot of directories which would result in the message "Permission denied". In my case, I knew that all my developer/cybersecurity related projects are within a sub-directory of my home directory called development. So I did the following:

find ~/development -type d -name "kali-linux-fundamentals"        

And this returned:

/Users/mariacam/development/digital-forensics/kali-linux-fundamentals        

If I were to use a relative path instead, as I typically do to navigate around my macOS device via the CLI (command line interface aka Terminal), I would use ~/development/digital-forensics/kali-linux-fundamentals to get there from my home directory represented by the tilde (~).

So if you have a lot of projects/directories on your macOS, and you want to find out where a particular one is (because you forgot), you can run the above command. I also highly recommend placing related directories, i.e., development-related projects or even slide decks under one root directory, which would be located within your home directory, so that when you have to search for a project, you would not have to serarch through ALL the directories on your system!

要查看或添加评论,请登录

Maria Campbell的更多文章

社区洞察

其他会员也浏览了