On 10/18/99 at 19:59:33, jh wrote concerning "can I list just the directories, executables?": > Hi. I would like to know if there is a command that will list just > directories? > > Also, is there a command that will list executable files. I just got debian > installed from floppy so there is not too much on my system. The only > fairly interesting program that I have discovered is ae (I think it stands > for anthony's editor) I have not figured out how to use it, it's pretty > arcane.
Depending on what you'd like to do, you could try `du`. It lists the size of directories/files below your current directory. You can pipe the output into `grep` to find a particular name, or to filter a particular name like so: du | grep 'name' - will print all directories (and sizes) that contain the string/regexp 'name'. du -a | grep -v 'dontwantit' - will print directory/filenames (and sizes) that don't contain the string/regexp 'dontwantit' To find files/directories with particular attributes (like execute permissions), you must use the `find` command. There's lots of documentation under `info find`. But this may save you a frustrating half hour of reading... The way it works is you first tell find where to start searching, then give it a bunch of qualifications to look for as it searches. At the end, you can tell find what to do with the list of files it produces. Looks like this: find . -name 'somename*' -print /| \ / \ / start qualification do location this You can keep adding different qualifications to meet your specific needs. The arguments given to qualifications vary: "-name" matches only the name using shell-style wildcards (*, ?). The argument for "-regex" will be a regular expression like `grep` would use. There are many kinds of qualifications you can use. Here's one that looks for any files executable and readable by the owner, the group, and all others: find . -perm 555 -print As `info find` mentions, you can also use a symbolic representation for permissions, like this : 'ugo+x'. Here's one that looks just for directories, with all the execute and read bits set (Note that the meaning of permission bits is different for directories than for files): find . -type d -perm 555 -print (Note: I've been including "-print", but if you left it off, find would assume you wanted it.) You can tell find to do other things with what it finds, too, such as pass the names to another utility that backs them up or copies them, or whatever. See `info find` for more. Finally, one more command you should know about is `locate`. Documentation is found with `man locate`. Happy learning! Jesse -- Jesse Jacobsen, Pastor [EMAIL PROTECTED] Grace Lutheran Church (ELS) http://www.jvlnet.com/~jjacobsen/ Madison, Wisconsin GnuPG public key ID: 2E3EBF13
pgpnMJw8ne5F7.pgp
Description: PGP signature