![]() ![]() For example, if you are only looking for a bar.baz in your home directory, you would use: ' find $HOME -name bar.baz'. The ' /' here is actually the starting directory so, if you have an idea of where to start looking, you can specify it here and find won't waste its time searching the rest of the disk. We can use it in its most basic capacity to find the location of a file, like so: ' find / -name bar.baz'. The GNU find command is the swiss-army knife of filesystem searching tools, and it has great powers that we won't even begin to touch upon here. It is itself not an executable file but a shell builtin in bash, the usual shell in debian. The type command will also show you information about commands that are not really executable files. There is also a whereis command that will tell you the location of both the program and its man page, but whereis searches only a fixed path and will not find things in local additions to your PATH. The which command will show you the full path of the executable that would be run. You can view the current path by typing ' echo $PATH', and change it like any other environment variable (see your favourite shell documentation for details). When you enter a program name at the command-line, the shell looks for an executable file of that name in a list of directories named by the environment variable PATH, and it runs the first matching executable it finds. "When I type 'foo', which file gets executed?" For maximum enjoyment from these tools and others, please see their man pages. ![]() The tools I mention here ( apropos, /msg apt on ?FreeNode, dlocate, dpkg, find, grep, grep-available, locate,, whatis, whereis) all have many more options and much more power than that tiny bit I've shown here. ![]() "What program or function do I have that does 'snork'?".What files are used for the configuration of the 'troz' package?."I installed the 'zort' package, now how do I know what files it gave me?"."I don't have file 'quux' on my system, but I need it."I have a file 'quux' on my system, which package does it belong to?"."Where is file 'bar.baz' on my system?"."When I type 'foo', which file gets executed?". ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |