Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
can this DOS command be done in unix: 'dir/s "wildcards+part/file name"' with the unix ls command?
i.e. dir/s .login <-- searches all dirs for the .login file

find . -name .login
will search current directory, recursively, or you can change the dot to any desired directory. Output is like:
./scripts/.login
Or filename pattern search:
find . -name "*log*"
Do "man find" to read the manual on find. You can search based on many different attributes at one time, such as file ownership, size, age, etc. Also, you can specify a command to execute on each of the qualifying files (such as to remove them).
For ls, R makes it recursive, and the a flag makes it include hidden files, so
ls -Ra
will do a directory listing of your current directory tree, or throw in the l flag to make it the long format:
ls -Rla
If you then filtered that with grep:
ls -Ra | grep .login
you could see if you have any of those filenames in the tree, but you would not be able to tell in which subdirectories they were.

why to do all this ? y don't u use the MC or the FD shell ? Its much better u can do a lot using the 2 shells i mentioned

In the first place, "all this" as you refer to it was a single very simple command (find . -name .login) which was the answer to Danty's question. I then went on to mention that the same command has many options (switches) to control a search, and then explained why the ls command that Danty mentioned was not good for tree search.
Secondly, most people want to become proficient in the more common unix shells since those are the ones in use on all the main platforms. The MC and FD shells are certainly not in this category. Have you already mastered sh, ksh and bash? Until you have, how do you know their power?

![]() |
netatalk problems with dd...
|
vfstab
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |