[thechat] Mandrake Linux

Seb seb at members.evolt.org
Tue Jan 29 17:04:01 CST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sometime around 21:57 29/01/2002, Kevin Stevens did verily sayeth:
> > What's the grep command look like that you are using?  The form is:
> >
> >    grep pattern [files]
>
>Thanks for the replies, could you define what you mean by pattern?

Let's say you're looking for the words 'norwegian blue' which you know are
in a file in a certain directory:

[user at machine: dir] grep 'norwegian blue' *

This will search every file in that directory for the _exact_ words
'norwegian blue' (without the quotes).

Now, rather than just searching for a string, you can use regular
expressions, so for instance, you might want to search for any file
containing a pattern, such as

[user at machine: dir] grep 'nor* blue' *

Would return matches for 'norwegian blue', 'normal blue', and
'nordkfkhtkhtkdhtteee blue' within all files in your directory.

Grep is *really* powerful, and there are loads of options for it. Getting
to know it (and maybe eventually love it) through the manpage is a really
good idea.

> > I'm guessing your partitions are:
> >
> >    hda0 - /
> >    hda6 - swap space
>
>Yeah, but it seems to have taken 1 Gig as swap space, I was under the
>impression that swap space is supposed to be about twice the size of your
>RAM, of which I have 128 meg. And I am confused as to why it is labeling it
>HDA6 instead of HDA1.

First off: do you have another OS on this machine? If so, it's possible
that your other OS owns those partitions. How are you finding your
partition info?

"mount" (no options) will tell you all mounted filesystems
"fdisk /dev/hda" will lauch the fdisk program for that drive, then just
press "p" to Print the partition table. That will tell you exactly how and
why the drive has been divided up.

1GB is not (by any stretch) too big for a swap file. It's generally a good
plan to make sure that your physical memory + swap = 1GB or more. This is
especially true for anyone using GCC or any other compiler. GCC makes
excellent use of loads and loads of swap. Also a good idea for anyone doing
massive image manipulation in the GIMP. GIMP loves RAM, but will happily
deal with swap space.

Oh, /dev/hda6 is a fairly normal place for swap partitions to end up. The
device numbering scheme is more about primary and extended partitions than
about how many partitions you actually have. For example, my /dev/hda has
the following:

Device  Boot    Start      End          Blocks          Id      System
/dev/hda1       *         1              298    2393653+        83      Linux
/dev/hda2               299       525           1823377+        5
Extended
/dev/hda5               299       329           248976          82
Linux swap
/dev/hda6               330       525           1574338+        83      Linux

(oh, that's the fdisk output BTW.)


> > To re-install, try booting from CD again.  It should prompt you to
> > redo the install.  At least, it used to in Red Hat distributions.
>
>Yes, you're correct, I can do this. The reason I wanted to re-format was to
>set the partition sizes myself and to see if some of the problems I am
>having re-appear. The grep thing mentioned above is one of them, also I
>wrote some code to the bashrc file that should give me a prompt if I try to
>overwrite something (I believe I got this from linux.org), but that isn't
>working either. I am at that horrible newbie stage where I am unsure if it
>is me being stupid or the machine :)

There's no real reason to reinstall, unless you've missed a lot of disk
space in your partitioning scheme. Even then, with judicious use of "mv"
"mount" "umount" and "fdisk" you can completely repartition and reformat an
entire drive without losing data. (Great fun when you want to make your
ext2 partitions into reiserfs partitions without a spare disk for backups. ;)

Seb.


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPFcrFb2V451Vxr52EQK8mACg+cHdA+388doeYV7xsxJU9QswbQsAn3n3
cYmT+zJFbiPK/LMHwxjbcuEz
=hiY9
-----END PGP SIGNATURE-----




More information about the thechat mailing list