i have to write C code for linux commands wich , apropos ,whereis(for a linux mini shell).....
if someone can tell me how to start...or help me with some links...

which - shows the full path of (shell) commands --i need that comand to show me only the path of file in curent directory (name of file introduced trough arguments in shell command line

apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output. ---in my mini shell "database files containing short descriptions of system commands" are pdf docs

whereis locates source/binary and manuals sections for specified files. The supplied names are first stripped of leading pathname components and any (single) trailing extension of the form .ext, for example, .c. Prefixes of s. resulting from use of source code control are also dealt with. whereis then attempts to locate the desired program in a list of standard Linux places.

7 Years
Discussion Span
Last Post by Ancient Dragon

which is not difficult to implement. Just get the environment variable PATH, then check each of the directories for the given file and report the directory for the first hit. The file might be contained in more than one directory, but all you want to report is the first one.

I don't know about the others.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.