Date: Sun, 06 Jul 1997 00:22:35 +0200 From: Kent Boortz <kent@erlang.ericsson.se> To: Gordon Wang <guelph@tpts5.seed.net.tw> Cc: freebsd-questions@FreeBSD.ORG, dkelly@hiwaay.net, kent@erlang.ericsson.se Subject: Re: Help Message-ID: <199707052222.AAA28798@townsend.ericsson.se> In-Reply-To: Your message of "Sat, 05 Jul 1997 00:47:49 -0500" References: <199707050547.AAA11695@nexgen.hiwaay.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Gordon, the way to find out what to do in Unix is to use the "man" pages. Do % man man to find out how it works (space key take you to the next page). To find information for a command do % man command If you don't know the name of the command you look for you can do % man -k your_search_string This will list commands that contain this string in the short description. Unfortunately you may still fail to find the right command. When I'm desperate I sometimes "grep" for it in the man directorys (may look silly to you Unix gurus but give me a better suggestion for how to do it ;-) % zgrep mypattern /usr/share/man/man?/* | less % zgrep mypattern /usr/local/man/man?/* | less % zgrep mypattern /usr/X11R6/man/man?/* | less And of cause there may be cases where there are no direct equivalent of a DOS command in Unix and you have to combine several Unix commands to do the same thing. These can be combined and named with the "alias" command to form new commands. Another way to find information about some of the commands is the "info" system. Do % info Use arrow keys and 'return' to select, 'u' for up, 'n' for next... And, if this isn't enough, I use searches on the Web. Finally, If all other things fail, I look in the source code ;-) dkelly@hiwaay.net wrote: > Another fun way to use find: > > % find / -name "file*" -exec ls -l "{}" \; > > I won't explain that one. For more examples of find, see /etc/daily and > /etc/weekly. David, you started it ;-) To search lots of files in and below the current directory for a specific string I have seen others use % find . -name "*.c" -exec grep mypattern {} \; -print But a *much* more efficient way to do it is % find . -name "*.c" -print | xargs grep mypattern I won't explain this one ;-) /kgb
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707052222.AAA28798>