From the course: Learning Zsh

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Finding files and commands

Finding files and commands - Unix Tutorial

From the course: Learning Zsh

Start my 1-month free trial

Finding files and commands

- [Instructor] On our system, we have some tools to help us find files. One of these is the find command, which provides a powerful search mechanism with many options. Find isn't unique to the Z shell, but it is very useful. To use find, we'll type the find command and then provide a path to look in and then we can provide some kind of condition for the search. This will find items under the root of the file system with the name pwd. Here's the pwd command in the bin directory. If you're running as a regular user, it's common to see a permission denied message for system directories. And we can ignore these by adding 2>/dev/null to the end of the command. This is a redirection, and we'll explore those later on. But for now, we can use it to clean up the output here. We can also look by size, by date, and so on. This will list the files on my home directory larger than five kilobytes. And files smaller than five…

Contents