From owner-freebsd-questions Sat Jul 5 15:22:28 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA22635 for questions-outgoing; Sat, 5 Jul 1997 15:22:28 -0700 (PDT) Received: from glacier.wise.edt.ericsson.se (glacier-ext.wise.edt.ericsson.se [193.180.251.38]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA22630 for ; Sat, 5 Jul 1997 15:22:24 -0700 (PDT) Received: from erlang (erlang.ericsson.se [147.214.36.16]) by glacier.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-0.9) with SMTP id AAA26551; Sun, 6 Jul 1997 00:22:09 +0200 (MET DST) Received: from townsend.ericsson.se by erlang (SMI-8.6/LME-2.2.4) id AAA02942; Sun, 6 Jul 1997 00:22:08 +0200 Received: from townsend by townsend.ericsson.se (SMI-8.6/client-1.5) id AAA28798; Sun, 6 Jul 1997 00:22:36 +0200 Message-Id: <199707052222.AAA28798@townsend.ericsson.se> To: Gordon Wang Cc: freebsd-questions@FreeBSD.ORG, dkelly@hiwaay.net, kent@erlang.ericsson.se Subject: Re: Help Reply-To: kent@erlang.ericsson.se In-Reply-To: Your message of "Sat, 05 Jul 1997 00:47:49 -0500" References: <199707050547.AAA11695@nexgen.hiwaay.net> X-Mailer: Mew version 1.70 on Emacs 19.34.1 X-URL: http://www.ericsson.se/erlang Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 06 Jul 1997 00:22:35 +0200 From: Kent Boortz Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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