Jump to content


Tips for Linux Explorers


  • This topic is locked This topic is locked
375 replies to this topic

#151 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 05 June 2003 - 03:53 PM

CONEXANT DIAL-IN PCI MODEM in REDHAT

George did send us a short how-to summing up the steps he had to take configuring his Conexant PCI dial-in modem in RedHat 9.0

He did download the drivers Here, choose the type of drivers carefully ( HCF or HSF ) and go to the download section. There are many types for all kinds of kernels and operating systems !

If you´ve been trying to configure the modem before without having much luck, a complete re-install of your operating system is the best advice, because there will be all kind of files conflicting with the new configuration you´re about to set up.

Quote

1: Before Installing get your driver while in windows - and save it to disk -

2: install your distro

3: Right click and copy your driver RPM

4: Paste driver RPM into your home dir.

5: Open terminal and type su + root Password

6: install RPM using < rpm -i (your particular driver ) .rpm >(Wait for prompt to return this can take quite awhile)

7: Open internet configuration wizard

8: click on hardware tab and edit

9: type in Modem Device < /dev/ttySHCF0 > ( or if it is a hsf modem < /dev/ttySHSF0 >) ( without the < > )

10:Close and save all changes.

11:Open network device control and activate


Thanks George for submitting this description. I know you did this several times already, so anyone looking for help: George is the man you´re looking for  !

Posted Image Bruno

#152 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 06 June 2003 - 03:18 PM

INSTALLING REDHAT ( First time )
From a real "Linux Explorer"

Steve_H was completely new to Linux as he did his first install of RedHat. Hearing all the stories that Linux was so hard to install, he was pretty nervous to start with, the bigger was his surprise that the actual install process was so easy and smooth. He wrote us in 9 steps how to go about installing RedHat 9.0:

Steve_H, on June 6 2003, said:

This page sums up everything I did to get Red Hat 9 installed and running.

1. Checked Red Hat web site for hardware compatibility.
http://www.redhat.co.../technical/hcl/
-- I checked my system by looking at my manuals and running Compaq and Windows diagnostics.

2. Downloaded iso files to hard drive (600+MB each).
http://ftp.redhat.co.../9/en/iso/i386/
-- iso files are "images" of the files you'll need that fit one iso file per disc.

3. Downloaded check sum file [md5sum (string of numbers)] from same location as iso files.
http://ftp.redhat.co.../9/en/iso/i386/
-- To make sure the iso files were downloaded perfectly, compare this file's numbers with the numbers generated by the check sum checker following.

4. Downloaded check sum checker and installed it.
http://www.md5summer.org/

5. Ran check sum checker on the iso image files and compared against the check sum file.

6. Downloaded Nero CD burner and installed it.
http://www.ahead.de/...x.html#download
-- If I burned the iso image files with Windows' default CD burner, they would be burned as iso files, which are not suitable for booting from. So I downloaded Nero, which recognizes image files and burns them correctly, separating all the files properly.

7. Burned iso image files to CD with Nero.

8. Inserted CD into Compaq Presario CD-ROM and booted up.
-- I thought I needed to press F10 to change the BIOS settings, but there were no settings for changing the bootup drive. It turns out that the Compaq read the CD drive boot info and booted from the CD with no problems. It was exciting when the Red Hat logo showed up in place of the Windows screen.

9. Download manuals from Red Hat site.
http://www.redhat.co.../manuals/linux/
-- As I am finding out, Linux does things very differently than Windows!

Steve H

Thank you Steve, this will help the "Linux Explorers" get their feet wet.


Posted Image Bruno

#153 OFFLINE   SonicDragon

SonicDragon

    Discussion Deity

  • Forum MVP
  • 4,188 posts

Posted 07 June 2003 - 04:55 PM

Thanks so much for doing these tips. I (finally) found time to read them all and am loving it! In fact, i'm in the new knoppix now B)  I've got to try the Slackware Live CD soon :)Thanks again!

#154 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 June 2003 - 04:58 PM

You're welcome Sonic !!B) Bruno

#155 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 08 June 2003 - 08:59 AM

ALIASES

To make your commandline experiences even more fun then they are already, here is a tip every lazy Linux user will love.
For long and complicated commands we can set an alias, that way an often repeated command can be brought back to one or two characters.

There are only a few rules you have to take in account: the alias comes always directly after the prompt and if you want to use more of them in one line you´ll have to add a space as you set the alias.

O.K. lets first set up some example files and directories:

NOTE: you will see the full prompt "bruno:~$" in these commands because in this case it is needed to show you how it works.
bruno:~$ mkdir -p ~/downloads/programs/extra/
(Will make a directory /extra in /home/bruno/downloads/programs, we use the -p argument in order to make all the underlying directories as well if they do not already exist. )

bruno:~$ vi ~/downloads/programs/extra/index
(Make a textfile called ¨index¨ where we will write a simple text:)

i ( to put vi in insert mode ) and type the line:

¨This is an index of downloaded programs¨

Esc + ZZ ( to save the file )

Good, the example files are created, now the real fun starts, we set up the aliases first:
bruno:~$ alias c='cd '
(Note the space after cd !!!)  

This is because you can only use 2 aliases one after the other if you have that space ! )
bruno:~$ alias dp='~/downloads/programs/extra'

Now we will use the aliases:
 bruno:~$ c dp

(so these are the alias for the command; cd /home/bruno/downloads/programs/extra)

And the proof that c dp actually worked, here is the new prompt:
bruno:~/downloads/programs/extra$

bruno:~/downloads/programs/extra$ ls

( lets see what is in that directory )

Quote

index

We make another alias, note the space after cat !
bruno:~/downloads/programs/extra$ alias s='cat '
bruno:~/downloads/programs/extra$ s index
( short for ¨cat index¨ )

Quote

This is an index of downloaded programs
( and that was the line we typed in the file )

We use the c alias again:
bruno:~/downloads/programs/extra$ c ~[code]
( will put you back where we started )

[code]bruno:~$ rm -rf ~/downloads/programs

( will remove the remains of our little test, but leaves the directory downloads as it was before the test )

bruno:~$ unalias c dp s
( will undo the aliases we made here above )

NOTE: these aliases will only be there for as long as you do not log-out ! If you want to use them on a permanent basis you can write them in in /home/bruno/.bashrc ( clever if you have to use the same long commands every day  ).

IMPORTANT: You can do "alias -p" to see what aliases are already set on your system, so you won't use ( overwrite ) one that is already in use !!

Posted Image Bruno

#156 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 10 June 2003 - 03:15 PM

THE RESET BUTTON

I know most computers have a reset button, used to be real handy back in the DOS days, Windows does not really like the reset-button but can live with it and recover most of the time fairly good. Sometimes it is the only way out for Windows users to escape a freeze of their computer.

It is my duty to warn you though: In Linux you better put a nice sticker or case badge over that button. Don´t ever use the reset-button in Linux !

There are far more sophisticated ways to get out of a freeze of your Linux system. Let me just remind you previous Tips: Run-Away Processes and Skinny Elephants.

This is really the only way to do it, so NEVER the reset-button !


Posted Image Bruno

#157 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 11 June 2003 - 02:51 PM

LINUX USER GROUPS ( LUGs )


Linuxdude32 ( Jason Wallwork ) wrote us a nice long post about Linux User Groups, the quote here below is a short version of his post, containing the most essential information, you can find the full version here

Quote

Linux clubs are almost always known as LUG (Linux User Groups). Don't let the "user" part fool you, though, LUGs often have developers, technicians, computer science students and teachers in them. And we're not just geeks. Some of the members of my group are novices or intermediate users. What we share are our interests in learning more about Linux and learning more about how we each use Linux. LUGs can vary in the services they offer, but at a minumum, you can expect:

(1) People who will answer your questions or point you in the right direction,

(2) Presentations, probably monthly, about Linux programs or new distributions.

(3) Discounts on some Linux programs or magazines (Linux Journal offers subscription discounts),

(4) A place to get Linux CDs either downloaded for you or borrowed and,

(5) An online list where you can ask questions in between meetings.


Additionally, many LUGs have extras such as:

(5) A Linux borrowing library,

(6) Installfests, where anybody can bring their computer to get Linux installed on them for free,

(7) A newsletter and,

(8) chances at winning cool prizes.

The best feature though, that every LUG is sure to have, is the people, just like you, who can help you with your Linux questions or just to show off to when you get that great new distribution. Chances are, there is a LUG already near you. And if there isn't, why don't you start one? There's no central list of LUGs on the Internet, but you should be able to find a LUG nearby on one of them. Here's some of the ones I know of below. Check Google for more.

Linux Online
Linux User Groups Worldwide
Tux.org
Red Hat's User Group Program
Yahoo Directory

One of the things I can't stress enough whether you're joining a LUG or creating your own is to get involved and get everybody else involved! And the other thing is that no matter how small a group is, go to the meeting. Small groups can't become big groups until people go to it. And more people become a magnet to getting more. And the success of a LUG isn't just in how many people are in it, anyway. It's in the social aspect, the comraderie, giving people not known for being social and place to belong.

The other aspect of LUGs it activism. Promoting Linux gives the people a voice, a chance to give everyone an alternative to Windows. LUGs are one of the best ways to give choice to a public that doesn't know there is any choice. Microsoft has said a lot of wrong things about Linux, but a couple of things that it has said are true, it is viral, in that amongst experienced computers, it catches on. Microsoft also called it a toy. They're right, Linux makes computing fun again and even a child can learn how to use it. A LUG can raise awareness in a community by having public Install-fests, by giving away CDs for free, by helping out a local school by building them a cheap computer lab using Linux software. Doing all of this by yourself is pretty hard, but a LUG makes it possible.

Get involved!

Jason Wallwork
President, Peterborough Linux User Group
My Webpage

Thanks Jason, already many of our forum friends contacted their local LUG to become a member.

Posted Image Bruno

#158 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 12 June 2003 - 02:09 PM

VERSION NUMBERS
( for curious people )

You might have been wondering; what are all those numbers in the name of .rpm and .tar.gz:
The version numbers for packages are build up like this:

Example: xmms-3.14.7-22.i586.rpm

Program xmms, major version = 3, minor version = 14, patch = 7, package version = 22, compiled for an Intel 586. packed as rpm.

For kernel versions:

Example: kernel 2.4.21-0.13mdk

Kernel version = 2, patchlevel = 4, sublevel = 21, extraversion = 0,13mdk

For distro versions:

Example: Mandrake 9.1

Major version = 9, minor version = 1

I do admit this info is not really of much use for people new to Linux, but I thought it would be fun to know what all those crazy numbers are about.


Posted Image Bruno

#159 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 13 June 2003 - 04:42 PM

RE-INSTALL and UPGRADES

Re-install:

Sometimes, due to whatever dark reason , you will have to do a re-install of your distro. ( As you´re new to Linux you often mess up your system just because you´re not sure how to do things in Linux and try keystrokes / mouse clicks at random. It has happened to the best of us ! ) In that case it´s good to know that all the personal files and settings can be saved without a problem. All these files are stored ( sometimes hidden ) in your /home directory. So at a reinstall you re-format all your partitions except your /home and in the case you have one the /backup partition. This way you won´t have to redo all the preferences of your desktop and all your mail, mail-settings & addresses will be saved !
Because a re-install does often not take more then half an hour, it really is no big problem . . .

Upgrades:

Every now and then ( mostly 6 month ) there will be a new release of your favorite distro, with updated packages and the newest versions of KDE, Gnome, Mozilla etc.
There is a golden rule for upgrading: for a jump from let´s say 9.1 to 9.2 you can take the upgrade option at install. This will only upgrade those packages that are new. However this is NOT always the best solution, but any software that you installed yourself after the previous install will stay intact. ( I personally do prefer a clean install at every change of version number. I just leave the /home and /backup as it is )
A jump from 8.2 to 9.0 ( major version ) however means always a clean install: re-formatting all partitions ( also /home, not the /backup ) The personal settings for KDE and Gnome will simply have to be done again . . .
Your mail and bookmarks however can be backed up and imported in the new version after install.

Golden rule: nothing beats a clean install !

Posted Image Bruno

#160 OFFLINE   havnblast

havnblast

    Discussion Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 4,878 posts

Posted 16 June 2003 - 07:14 AM

Bruno if you could could you put together a quick tip on the different commands such a -ivh  vs -uvh  and other commands such as su one can do for installing or uninstalling or updating etc....  I know -i is for install but I don't know what the v or h stand for - I imagin the -u is uninstall.When I install a package I just use rpm -i package.rpmThanks

#161 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 16 June 2003 - 08:44 AM

Hi KellyHave a look on page 3 of The Tips:

Bruno, on Apr 25 2003, said:

# rpm -ihv samba-2.2.1a-4.rpm  ( will install the package )
# rpm -Uhv samba-2.2.1a-4.rpm ( will upgrade the package )
# rpm -e samba-2.2.1a-4.rpm ( delete the package )
# rpm -l samba-2.2.1a-4.rpm ( will list the files in the package )
# rpm -ql samba-2.2.1a-4.rpm ( will list the files and state the installed version of the package )

and there is much more there . . ;)

The  -v stands for "verbose" ( display verbose file listing )
The  -h stands for "hash" ( print hash marks as package installs, good with -v )

More info on different arguments :
"rpm --help" will give you all the info.

:) Bruno

#162 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 16 June 2003 - 03:21 PM

UPDATING YOUR DISTRO

A very important job to do on a regular basis is to get the updates for your distro: Bugfixes and security updates. Some distro´s need very few updates, others need long lists and large amounts of MB´s to keep them running smooth and safe.

In a nutshell here is why; Distro´s like Mandrake and Redhat are always pressed to get the cutting edge of new verions KDE, Gnome, Mozilla etc. Also there is a big competition between the two of them, this puts pressure on their new releases that come every 6 month.
At the other end of the spectrum there are Debian and Slackware.
Debian has not had a new version since 2 - 3 years, they still do their super-stable ¨woody¨ 3.0 uptill today ( also the base of Knoppix ), all the bugs are fixed long ago and the only updates are security. Slackware is not really pressed for new versions either, they only include fully tested and bug-free apps in their releases, Slackware´s pride is the name they have in stability.

Alright, now we know why to update, here is how:

Mandrake/Mandriva: Mandrake Control Center --> Software Management --> Mandrake Update. A full discription and update-allerts are in This thread, subsribe to the thread and you will get a notification from this forum each time a new update comes out. ( For Mandrake 9.2 Here For Mandrake 10 Here For Mandriva 2006 Here )
( NOTE: The updates you do during install are only minimal, after the install you have to do a full update in the Mandrake Control Center )

RedHat/Fedora: All you have to do is type "up2date" in a console or at a shell or click on that ever so annoying red exclamation mark next to the clock.

Debian: Also very simple open a console ¨su¨ root and type ¨apt-get update¨ and after that ¨apt-get upgrade¨

Slackware: Major security updates are announced on the front page of slackware.com and changes are always being made to the "current" branch. You can follow the changes by checking out This link .
A good and reliable tool for updating is Swaret

SuSE As far as I know Yast has an update function build in:

Quote

:Specifically, YOU (YaST2 Online Update) and with 8.2, there's a thingie in the task tray (that checks once a day for updates and turn red if there are some available (SuSEWatcher). You can further configure it to automatically download and install updates without user intervention (it does it through a cronjob once per day).

For people on dial-in: Here you can find a list of update RPMs for SuSE. You can download them on any machine connected to broadband and install them later on your own PC.


So, from now on, no more excuses for not being fully updated and bugfree . . .


Posted Image Bruno

#163 OFFLINE   henderrob

henderrob

    Message Mogul

  • Members
  • PipPipPipPipPip
  • 448 posts

Posted 16 June 2003 - 05:54 PM

Thanks for the User Groups links.  Found the Calgary Linux Users Group and will be going to an 'installfest' June 21. :rolleyes:

#164 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 17 June 2003 - 03:22 PM

MANDRAKE/MANDRIVA CLUB URPMI


Members of the Mandrake/Mandriva Club can add a few extra URPMI sources and have access to hundreds packages of extra software, also software you normally would have to pay for !
The nice thing from URPMI is that install is super easy and can´t go wrong; it picks up the additional packages needed for the selected software as well, you just need an internet connection . . .

Here is how you can add the sources, we take as example ¨contributions¨ because this is the largest source:

Log in on the Mandrake Club Site and go to the "Downloads" page.
In the left column you will see the heading "Mirror finder" that's the page you want.

Set the "Architecture" and "Distribution version" to what you are currently running and set the "Resource type" to "Contributions" ( Note: there is a difference between the free available "contributions" and the "Club-Contributions" )

Next press "Search Mirrors" and select your favorite mirror form the list and click on "URPMI set up" this will give you a line of code.

Go to a console, log in as ¨su¨ and paste the line after the prompt and hit enter.
Now it should work and get the list . . . be patient, it takes a while.
Then as you get the prompt back, close the sonsole ( Ctrl+d , 2x ).

Now that we have added the ¨contrib¨ source to your software manager, we can have a look at all the packages:

Go to the MCC --> Software Management --> ¨RpmDrake helps you install software packages¨ ( the icon with the + ). Now you will see the text : ¨All packages¨ under the search-box., ¨All packages¨ ¨by group¨ change the by group in: ¨ by source repository¨ and you will get a list with the sources you can coose from: CD1, CD2, CD3 and also the Updatesource and the ¨Contrib¨ source. That is the one: ¨Contrib ftp¨, click in the little triangle in front of ¨contrib ftp¨, and a list will fold out with all the packages you can choose from . . . . FUN, MAGIC, BLISS !

The other sources you can add:
- Contributions ( we just did this one )
- Distribution ( the things that usually are on your Cds but then updated, this will replace the sources from CDs 1 – 3 ! )
- Club-software ( adapt urpmi line with your nick and password )
- Club-commercial ( adapt urpmi line with your nick and password )
- Club-contributions ( adapt urpmi line with your nick and password )
- Club-contributions testing ( adapt urpmi line with your nick and password )
- PLF free( the Penguin Liberation Front )
- PLF non-free


Every now and then you will need to update the sources because new packages are added every day, this is how you do that in one single command ( as root ):
# urpmi.update -a

If you would like to install all the packages you have access to after adding these sources, you better get yourself an extra HD of 100 G !
Of course for all these goodies you have to be a member of the Mandrake Club . . . . . but nobody is forcing you . . . . . .


B) Bruno

#165 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 18 June 2003 - 07:24 PM

THE COMMAND LESSIf the "cat" command shows you the contents of a file, it does often happen that the file is to long for your screen. "Piping" it through "less" makes it appear on your screen page by page.An example: ( you have to be root to read the log-messages )
$ cat /var/log/messages
The output is un-readable because it flashes over the screen
$ cat /var/log/messages | less
( The "|" pipe-sign is the character on the key between "Backspace" and "Enter". ). It shows the file one page at a time.Also you can also do a search in less: Press the "?/" key, type the word to look for and hit Enter. It will mark all the matching entries in a different color.Shift  + "?/" searches backwards."80G" will put you on line 80 of the file.You change page with the spacebar and close off with "q"No more to say about "less", except that it does more or less the same as "more".  ;)*( "more" is another command, but it's not as effective as "less" ;) );) Bruno

#166 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 19 June 2003 - 05:57 PM

THE ¨LINKS¨ BROWSER


Here is a nice program to give a try: ¨links¨
Open a console and type:
$ links forums.scotsnewsletter.com/index.php?

and hit enter.

Links is a very fast browser that is purely text based, works also outside X, you could do Ctrl+Alt+ F1 to leave X and do the browsing pure in text. ( Alt+F7 will get you back to X )

The arrow keys make you jump, link to link and the enter key selects the link.

Some command options for link are:

-download-dir <path>
Default download directory.
(default: actual dir)

-anonymous
Restrict links so that it can run on an anonymous account.
No local file browsing. No downloads. Executing of viewers
is allowed, but user can't add or modify entries in
association table.

Keys:
ESC       display menu
^C quit ( ^ is the sign for the Ctrl key )
^P scroll up (text mode)
^N scroll down
[, ]      scroll left, right
up, down   select link (text mode)
-> follow link (text mode), scroll right (graphics mode)
<- go back (text mode), scroll left (graphics mode)
z    go back
g    go to url
G   go to url based on current url
^G    go to url based on current link
/    search
?    search back
n    find next
N   find previous
=   document info
\ document source
d    download
q    quit or close current window
Alt-1 .. Alt-9  switch virtual screens (svgalib and framebuffer)


You might say, well I prefer Mozilla . . . but just imagine your X is broken and you have to download a file to fix it and install it. Links might just prove itself in that kind of situations.
Or you have an old P I with little memory, and install a distro without X, an only text-based distro . . . links ( and also lynx, another text based browser ) will permit you to browse and download extra software.


B) Bruno

#167 OFFLINE   teacher

teacher

    Acute Mac

  • Honorary Moderators
  • 13,854 posts

Posted 19 June 2003 - 08:20 PM

What about an old P3?  Do we fit in the same category?  Interesting way to browse - reminds me of the days in the 80s when our connections were all purely text!
Teacher
Beach Bum Extraordinaire

#168 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 19 June 2003 - 08:28 PM

teacher, on Jun 20 2003, 02:20 AM, said:

What about an old P3? Do we fit in the same category. Interesting way to browse - reminds me of the days in the 80s when our connections were all purely text!
Ain't that fun going all nostalgic, Julia ? If you like it there is also a few nice email-clients that can run outside X: Mutt and Pine. I won't let you know which one I prefer because that always leads to war between Pine adepts and Mutt fanatics ! :DB) Bruno* I can't help you set up Pine, but I could write you a little how-to on Mutt though B)

#169 OFFLINE   zox

zox

    Multithreader

  • Forum MVP
  • 1,234 posts

Posted 20 June 2003 - 02:29 PM

Quote

. . . links ( and also linx, another text based browser )...
Could that be a possibly "Lynx" as i have used it in text mode.It also requires from you to enter protocol http:// or ftp:// before www, otherwise it won't work :)

#170 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 20 June 2003 - 02:32 PM

Sorry Zox, TYPO !! I will change it, Thanks for noticing it !:) Bruno

#171 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 20 June 2003 - 03:23 PM

GREP IS FOR SEARCHING ( within a file )You better sit down for this one, grep is not the easiest command ! ( grep = Global Regular Expression Printer )We will talk about Global and Regular expressions tomorrowThe command "grep" searches for words or pattern in a textfile. Best explain this with an example:
$ grep 'pointer' /etc/X11/XF86Config
Will give no result !
$ grep -i 'pointer' /etc/X11/XF86Config
Will show the line where the word Pointer is written in the XF86Config file. ( the -i option tells grep to ignore upper or lowercase, so always handy :D )
$ grep -ni 'pointer' /etc/X11/XF86Config
The -n option will even show you the line number that the word Pointer is written.Now do:
$ grep -ni 'section' /etc/X11/XF86Config
You get a long list from line 8 to line 260 with the word "section" in it, you can easily see where the part is you're looking for. After this editing the file with vi will be a breeze.Or:
$ grep -ni 'Sony Vaio C1' /etc/X11/XF86Config
Gives you only the line and line number with "Sony Vaio C1" in it !Another example: Imagine you have problems with "postfix" and want to check your /var/log/messages (  you'll have to be "su" ):
$ grep -ni 'postfix' /var/log/messages | less
This will only show you the lines of /var/log/messages with "postfix" in it, because even this list is too long for the screen I pipe it through "less".( don't forget to close "less" with "q" :) )grep has much more options and advanced search functions, see "grep --help" for all the information !:) Bruno

#172 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 23 June 2003 - 01:22 PM

GLOBAL ExpressionS

Today we start a series of 2: Global Expressions and Regular Expressions.
Not really easy to explain but I´ll have a go at it, trying to keep it simple and only mentioning what the basics are. ( We use Global expressions to search files, Regular expressions to search in files )

Global expressions are mostly used in combination with the command ¨ls¨ ( list files ).
I suppose you know that the ¨*¨ sign is a wild-card and can stand for one or more characters. The ¨?¨ is a wild-card for only 1 character. The ¨!¨ excludes the characters that follow.

Here are some examples:
$ ls [a-e]*

This will only list the files that start with a, b, c, d or e. ( Not A or B ! )
$ ls [a-eA-E]*

Will do the same but then also A, B ,C ,D and E
$ ls *[a-e]us

The files that end with: aus, bus, cus, dus and eus
$ ls ?[a-e]re

Will show the files; dare, acre, mere, bare, . . . etc.
$ ls *[!a-b]re

Shows files that end with ¨re¨, but not the ones on ¨are¨ or ¨bre¨
$ ls *.{jpg,png,gif}

List all the files that end with .jpg, .png and .gif

Notice the difference in { } and [ ] !!!

This is as far as I go with Global Expressions, tomorrow we do the Regular Expressions, that is not as straightforward as the Global ones, but as I said before: I will do the ultimate to keep it simple !

Posted Image Bruno

#173 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 24 June 2003 - 04:13 PM

REGULAR ExpressionS

Regular expressions are more or less the same as the Global ones, but are mostly used to search strings ( any sequence of characters ) and to perform changes, within a file. ( We use Global expressions to search files, Regular expressions to search in files )
They are widely used with the following commands:  "grep", "egrep" and "sed". Also for searches in the "vi" editor we use Regular expressions.
We will keep our search limited to "grep".

NOTE: First 2 striking differences with the Global expressions:
"?" stands for 1 random character in Global expressions, "." is the sign for it in Regular expressions.
[! . . . ] stands for "not" in Global expressions, and [^ . . . ] is what we use in Regular expressions.

In fact, the "^" has 2 meanings in a regular expression, depending on its place: "[^" means "not" , where just "^" at the beginning of the expression means that the string or word should be at the beginning of the line.
A "$" at the end of the expression means that the word should be at the end of the line. ( This will all become clear in the examples. )
One more thing: the regular expression always starts and ends with ' ( an apostrophe ).

Grep will search a string of characters specified by the Regular expression and print the lines in which it finds those strings to the screen.

O.K. Here are some simple examples:
$ grep -n 'cr[i-z]ft' example-file

Will print the lines with "cruft" and "croft" in it ( with the line numbers )
$ grep -n 'sh[^a-h]re' example-file

Prints the lines with "shore" and "shire"
$ grep -n '^ Fast. *them $' example-file

Will search for the lines that starts with the word "Fast" and end with the word "them"

Regular expressions interpret the . \ [ ] * in a special way, so if you want them to be part of the string you look for, you need to use the escape sign: \

Another formula: \{ . . . \} tells grep how many times a character should show: a{2\} means 2x the "a"

Example: Imagine you have a long list of names and telephone numbers, and you want to search for a name that starts with a "B" and has 66 in the phone number.
$ grep -n '^ B* 6\{2\} * $' phonelist


Another little hint:
$ grep -n 'bat' example-file


Will find lines with the words "bathroom", "batter" and so on.
$ grep -n '\<bat\>' example-file


Only finds the line with the word "bat" in it

O.K. We had enough complicated stuff lets have some FUN, try this one:
$ grep -e '^\(.\)\(.\)$' /usr/share/dict/words


To find 4 letter palindromes
or:
$ grep -e '^\(.\)\(.\)\(.\)$' /usr/share/dict/words


To find 6 letter ones

So this gave you a little taste of what a Regular expression is.  For a deeper insight see: Here.
Or if you really want to know it all, the "Mastering Regular Expressions" book at O'Reillyor at  your local bookstore.

B) Bruno

#174 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 25 June 2003 - 03:03 PM

\CONFIGURING and COMPILING THE KERNEL

It's not that I want you all start tinkering with the kernel, but for the very curious ones amongst us:
If you download the kernel sources to your /usr/src directory you can compile the kernel yourself and adapt it to the specific needs of your system.
The things that could be said about compiling your own kernel are too many for the Tips. ( See the links below for deeper info ) I just want to give you a quick starter to go by.

In shorthand:
# cd /usr/src/<directory of your new kernel>
# make mrproper
# make menuconfig or make xconfig ( with xconfig you get a GUI )
# make dep
# make bzImage ( watch it the i from image is a capital i ! )
# make modules
# make modules_install

Then copy /boot/vmlinuz to vmlinuz.old
Then copy /usr/src/<dir. new kernel>/arch/i386/boot/bzImage to /boot/vmlinuz
Then copy /usr/src/<dir. new kernel>/arch/i386/boot/System.map to /boot/System.map
Edit your /etc/lilo.conf or /boot/grub/menu.lst to add a configuration line for your new kernel. ( leave the old part in there and point it to vmlinuz.old, in case of troubles you can always boot the old one )
If using lilo run /sbin/lilo

That should be it !

Must read: Sourceforge. More info: Linuxplanet. Good Howto with screenshots: BitbenderForums


NOTES:

Quote

(Bruno @ Forum June 6 2003)
every six month a new kernel will be in your distro from the start, I do not really see any good in upgrading your kernel in between ( unless you&acute;re a real hardcore tweaker and are prepared for some "extra" work . . ). I did it once, long ago, took me two days to get the new kernel to be accepted without the "panic" in the first place and adapted to my wishes/needs it in the second place. Since that day I'm the lazy kind of guy and wait till the new Boxed CD's are delivered at my door. I do like tweaking and fiddling my system . . . . but there are limits to the fun.
          

Quote

(Jong357 @ Forum June 12 2003)
also don't update the Kernel.... Many things are dependent on the Kernel version. Every six months there will be a new release anyway, so why bother.....
            

Posted Image Bruno

#175 OFFLINE   tranquilo

tranquilo

    Message Mogul

  • Members
  • PipPipPipPipPip
  • 446 posts

Posted 25 June 2003 - 03:37 PM

Debian related links...Creating custom kernels with Debian's kernel-package systemhttp://newbiedoc.sou...kernel-pkg.htmlDebian ReferenceChapter 7 - The Linux kernel under Debianhttp://qref.sourcefo...-kernel.en.htmlHTH  :Dtranquilo




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users