From owner-freebsd-questions@FreeBSD.ORG Tue Jun 15 19:33:29 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 106D216A4CE for ; Tue, 15 Jun 2004 19:33:29 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B12B43D31 for ; Tue, 15 Jun 2004 19:33:27 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i5FJWumQ096564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Jun 2004 20:32:56 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i5FJWu37096563; Tue, 15 Jun 2004 20:32:56 +0100 (BST) (envelope-from matthew) Date: Tue, 15 Jun 2004 20:32:56 +0100 From: Matthew Seaman To: Lloyd Hayes Message-ID: <20040615193256.GA95869@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Lloyd Hayes , freebsd-questions@freebsd.org References: <40CF4287.1060005@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <40CF4287.1060005@yahoo.com> User-Agent: Mutt/1.5.6i X-Greylist: Message not sent from an IPv4 address, not delayed by milter-greylist-1.3.8 (smtp.infracaninophile.co.uk [0.0.0.0]); Tue, 15 Jun 2004 20:32:56 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040612, clamav-milter version 0.72a on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD Commands X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2004 19:33:29 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 15, 2004 at 12:40:07PM -0600, Lloyd Hayes wrote: > I have the FreeBSD Handbook on a computer hard drive. There isn't any=20 > mention of the line commands that FreeBSD uses or recognizes in the=20 > handbook. Where do I find these? Yes. The Handbook does assume that you are familiar with the basics of the Unix environment. Let's see. Crash course in how to survive Unix -- the University of Ohio has a well regarded course available on line: http://wks.uts.ohio-state.edu/unix_course/unix.html Other than that, all commands should have manual pages, which you can display using the 'man' command. eg. % man ls To find out about the man command, read its man page: % man man Man pages are laid out according to a standard style -- eg. for commands, first there's a very short and probably rather impenetrable synopsis of how to use the command and various option arguments you can give it. Then there's a paragraph explaining what the command does, followed by a detailed breakdown of all the different options. Then there can be several different bits of stuff depending on the nature of the command, culminating in a list of environment variables used by the program (if any), a number of examples, references to the man pages for related commands and a list of any known bugs in the command. Length varies from less than a page to getting on for book length. To try and find a command to do something, for example to copy a file, use the '-k' option to man: % man -k copy That will print out a list of all of the man pages on the system that mention the word 'copy' in their titles, amongst which you will see a reference to: cp(1) - copy files Not that this is a quite limited technique: coming from a DOS background you might reasonably expect there to be commands to delete or rename a file. Indeed there are, but named rm(1) (ie. ReMove) and mv(1) (ie. MoVe) and you basically have to know that in order to find the right command. Now in that last paragraph I introduced a bit of unixiod jargon: saying cp(1) is a reference to the man page for the cp command, which is in section 1 of the manual. You'll also note that the Unix environment does not go out of its way to be helpful to complete beginners. That's because you're only a beginner at that sort of level for a couple of weeks, tops, and this environment is designed for use day in, day out by people who know what they're doing. All those arcane looking two and three letter commands (without vowels) really are easier to deal with when you are typing fast. Unix commands also tend to assume that you know what you are doing and not ask you to confirm things -- mostly because that means they can be used for running unattended and in scripts. That means if you tell your system to delete all the files in your home directory, it will do so without question. What are the absolute basic commands you have to know? Something like this: ls(1) -- get a directory listing ls -l -- get a long format directory listing pwd(1) -- show your present working directory cd -- change directory. Note this is a shell builtin(1) rather than a standalone command cd ~ -- change directory to your accounts home directory mv(1) -- rename files, move files into a different directory cp(1) -- copy files rm(1) -- delete files rm -r -- delete a directory and all of its contents, recursively date(1) -- show time and date time(1) -- time how long a process takes to execute whoami(1) -- for the morning after a particularly wild party who(1) -- who is logged into the system man(1) -- read the system manual more(1) -- page through a file ee(1) -- easy editor vi(1) -- difficult editor login(1) -- log into the system passwd(1) -- change your password exit -- log out ( logout -- log out=20 =20 > I just received instructions to find and copy my X-configure file to a=20 > different directory so that KDE would work. One problem. Under this file= =20 > system, I have no idea how to change directories using line commands. I= =20 > was sent the command for viewing the current directory, but I need the=20 > syntax for changing to different directories, and for moving and=20 > copying files to different directories. >=20 > (If you did it every day, simply walking on Mars would be child's play.) Absolutely. I can hardly remember what it was like being a complete beginner. Don't worry -- stick with it for few weeks: keep practicing, and it will get a lot easier. Really. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --DocE+STaALJfprDB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAz07oiD657aJF7eIRAubrAKC5gSU+r1vI4VvLZz9SZKM3+qGVJgCgkjvZ jgW9nLjwnM1hMHD8KeqanvQ= =ISlp -----END PGP SIGNATURE----- --DocE+STaALJfprDB--