5 ms·
One thing I can do really easily with DOS but can never remember how to do on Linux is find a file somewhere in the filesystem. dir/s filename I know there ar
by billforsternz 1y ago
One thing I can do really easily with DOS but can never remember how to do on Linux is find a file somewhere in the filesystem.
dir/s filename
I know there are many ways to do the same thing in Linux, but they are all more complicated and because I am getting old and don't use the command line much anyway, none of them have stuck in my mind.
In general I can use dir more effectively than ls. I know this means I'm a bad person.
- teaearlgraycold 1y agoMy complaint with the find command is I need to redirect stderr to /dev/null to use it without squinting through lines of access errors.
- jmholla 1y agoIf your distro comes with plocate or you have it installed, you can use it through the `locate` command. It will setup a service that periodically (usually daily) updates the database it sources for that information. `find` is the canonical way to do it, though it will take a while, and like @teaearlgraycold mentioned, you'll likely want to redirect stderr to /dev/null. find / -name "name here" 2>/dev/null This handy function should help if you plop it in the rcfile for your shell: dir/s() { find / -name "$1" 2>/dev/null }