In real-time scenarios of DevOps, it’s not about how to make it work, rather it’s like how to automate and work faster.
So let’s start…
How to find a file or directory in a root or the specified directory.
Command ‘ find ‘ :
The `find` command in Linux is used to search for files and directories within a specified directory hierarchy.
To search in a current directory:
find . -name example
In the command `find . -name example`, it searches starting from the current directory (`.`), looking for files or directories with the name `example`. The `-name` option specifies the name pattern to search for. So, it will find any file or directory named `xyz` within the current directory and its subdirectories.
To search in the root directory:
If you want to search in the root directory, you can replace the `.` in the command with `/`, which represents the root directory. So the command would be:
find / -name example
This command will search for files or directories named `example` starting from the root directory and traversing through its entire directory hierarchy.
👋 If you found this article helpful, clap the button 👏 below to support me to publish more.
Follow me at LINKEDIN to get similar stories. Thank you.
#DevOps #SoftwareEngineering #Linux