Jump to content


Tips for Linux Explorers


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

#76 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 06 May 2003 - 02:04 PM

TWEAKING VI  

We can add some personal tweaks to the vi editor, making editing just a bit easier.

Remember on page 5 the important config files ? Remember ~/.exrc ? That is one we will tweak.

The ~/.exrc file stores the settings for the vi editor, I like my vi to number the lines, so if I get an error message that on line 26 there is a conflict I can easily find it, also I like to see the mode vi is in.

So I use 1 and 5 from this list: ( this list is over-complete, but just pick the ones you like )  
set number
set ap
set autowrite
set showmatch
set showmode
set redraw
set nu
map ^X :set backup="%~"
set noskipdisplay
set displayencoding=euc-jp
set inputencoding=euc-jp
set fileencoding=euc-jp
set autodetect=jp+ map S :r ~/.signature  

Here is how you do it:
$ vi .exrc

< i >
set number
set showmode
<Esc >
< ZZ >  

The next time you start your favorite editor the .exrc will be used.

B) Bruno



#77 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 06 May 2003 - 05:29 PM

LILO AND LILO.CONF

  Lilo ( or Grub ) boots your computer.  

If you install a second or third distro on your computer youŽll have to adapt the bootloader to show all the entries you want to boot in.
( NOT if you just add Linux to your windows computer ! )
I recently added Debian and Slackware to my Mandrake computer.
First I added the vmlinuz and init.gz from Knoppix and slack to the /boot directory of mandrake.
I made 2 directories in /boot : /debian and /slack and copied the vmlinuz from both distoŽs in there.
Drive hdb2 and hdb6 are mounted on /mnt in my Mandrake.  

IŽm using the lilo from Mandrake. After making a backup of my original lilo.conf, I changed my /etc/lilo.conf ( for the moment only Debian is added ) This is what my /etc/lilo.conf looks like:
( IŽve put in some dots to format the text )

Quote

boot=/dev/hda
map=/boot/map
default="mandrake"  ( ! I did change linux to mandrake ! )
keytable=/boot/us.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw  

image=/boot/vmlinuz
. . . . . label="mandrake" ( ! I did change linux to mandrake ! )
. . . . . root=/dev/hda1
. . . . . initrd=/boot/initrd.img
. . . . . append="devfs=mount hdd=ide-scsi acpi=off quiet"
. . . . . vga=788
. . . . . read-only

image=/boot/debian/vmlinuz
. . . . . label="debian"
. . . . . root=/dev/hdb2
. . . . . initrd=/boot/debian/initrd.gz
. . . . . vga=788
. . . . . read-only

image=/boot/slack/vmlinuz-ide-2.4.20
. . . . . label="slackware"
. . . . . root=/dev/hdb6
. . . . . append="hdd=ide-scsi"
. . . . . vga=788
. . . . . read-only

image=/boot/vmlinuz
. . . . . label="linux-nonfb"
. . . . . root=/dev/hda1
. . . . . initrd=/boot/initrd.img
. . . . . append="devfs=mount hdd=ide-scsi acpi=off"
. . . . . read-only  

image=/boot/vmlinuz
. . . . . label="failsafe"
. . . . . root=/dev/hda1
. . . . . initrd=/boot/initrd.img
. . . . . append="devfs=nomount hdd=ide-scsi acpi=off failsafe"
. . . . . read-only

other=/dev/fd0
. . . . . label="floppy"
. . . . . unsafe  

# If you multiboot windows it will show here:
other=/dev/hda1
. . . . . label="windows"
. . . . . table=/dev/hda

IŽm not saying that you should start messing your lilo right away, but, do have a look at your own /etc/lilo.conf and see what it looks like:
$ cat /etc/lilo.conf
  

IMPORTANT: If you ever have to change your /etc/lilo.conf, and  youŽve finished adapting it, you have to give the command as root:
# /sbin/lilo

This will write lilo to the MBR sector of your disk. ( if you made a mistake it will give you an error message !! The default distro will be marked with an * )
If ever an other OS overwrites your Lilo, just use your bootdisk to boot in Linux and give the same command < /sbin/lilo >

At boot as the lilo screen comes up youŽll see:  

Quote

mandrake *
knoppix
slackware
linux-nonfb
failsafe
floppy

Happy tweaking !
Perhaps see if you can change the name "linux" in your own Lilo to whatever distro you are using ! ( you have to change it on two places like I did with Mandrake )
This will give you some experience for when you really will have to do it ! <_< BUT MAKE A BACKUP FIRST !

B) Bruno

#78 OFFLINE   Agent007

Agent007

    Message Mogul

  • Members
  • PipPipPipPipPip
  • 269 posts

Posted 07 May 2003 - 07:45 AM

Bruno, on May 5 2003, 10:05 AM, said:

TEAK EVOLUTION( what browser should open as you click on a link in an email )  I had this problem, I really do like Evolution for my mail and it used to open the links send to me in an email in Galeon, a nice fast browser. Suddenly with the new Mandrake 9.1 it opened the links in Mozilla, that's a much slower browser. So I found the tweak :  $ vi /home/user/.gnome/Gnome < i > change: default-show=gnome-moz-remote --newwin "%s" to: default-show=galeon --newwin "%s" ( or replace galeon with opera or phoenix ) < Esc > < ZZ >  Start or restart Evolution and notice the difference  :D  ;)  :D Bruno
Hello Bruno,This method does not work on RedHat....I too prefer Galeon to Mozilla. So, what i did was rename the actual mozilla in /usr/bin to something else and create a new simlink named mozilla which points to Galeon! This way any app which makes a request for mozilla actually runs Galeon!  ;) rgds,007

#79 OFFLINE   Prelude76

Prelude76

    Multithreader

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,453 posts

Posted 07 May 2003 - 08:09 AM

I use Grub instead of Lilo, and during grub setup, theres an option to write to MBR, and its off by default.  grub boots up during loading, but how does it do that without messing with the MBR?

#80 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 May 2003 - 08:32 AM

Thanks for the tip 007 ! ( happy that someone actualy does read my tips :D )Prelude76, I know only about Lilo, but if Grub does the same : The bootloader overwrites the MBR, ( you can always restore it later ) but leaves you the option to boot in windows too. ;) Bruno

#81 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 May 2003 - 03:20 PM

ISO's and MD5SUM ( checksum )

For those of you that never came near to linux, here is a description how to download your first Linux ISO, and check its integrety.

For the ones already running Linux: Imagine, one day you get bored with your current distro and you want to try something else. Or, you've got enough HD space and want to triple-boot. Or, and this is more likely to happen; there is a new version of your  disto hitting the mirrors : You start downloading the ISO's

After downloading you can check the integrity of the ISO-file with a checksum, the md5sum. The mirror will offer you a separate text file to download with a 128 bit string of characters. This string has to be exactly the same as the one you get when you do:
$ md5sum downloaded.iso

The string you get typically looks like:
563c1bfff307a16d45f5d6 a04011f07b

( Sure you have to "cd" to that directory first or do /home/bruno/tmp/downloaded.iso )
Creating the checksum will take only a minute.
Usually I only check the first and the last 5 or 6 characters of the string.

The checksum can be done in windows too: see page 11 of The Tips "Checksum in Windows"

Once you are sure the ISO is O.K. you can burn it to a CD.
WARNING: Doing the checksum to check your CD will give you a different string !

Some handy links:
For more info about the different disto's:  Distrowatch
For downloading ISOLinux  

Happy downloads !

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

If you might think: "this is all to much trouble, is there no other way to get a distro ?"

Sure you can order a distro at its distributor OR for a quick and cheap solution:
CheapBytes sells them for around $5

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  

B) Bruno

PS: Mike180 pointed us to this Link for an other tool to do the checksum in windows.

#82 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 May 2003 - 03:55 PM

BURNING ISO's

Here is a short and easy one; in the previous post you learned how to do checksums, so now we can burn them to CD.

In Linux:
$ cdrecord --scanbus

( this will give you a 3 digit number like 0,1,0 )
NOTE: Since kernel 2.6 the above command changed, see Here
$ cdrecord dev=0,1,0 downloaded.iso


That's all, really that's all !

In Windows ( ALL ) with Nero 5:
file --> burn CD image  ( don't use that stupid wizard ! )

In Windows ( ALL ) with Nero 6:
1. Launch the "Nero Burning ROM" (regular version, not the wizard) portion of the program.
2. Select from the menu: Recorder > Burn Image.
3. Use the default options and burn the CD.

If after burning you can see a lot of files ( README :( *tip ! ) and directories you'll know your CD is fine!

If after burning you see only one file; the downloaded.iso you've clearly done something wrong and can use the CD as a coaster

B) Bruno

#83 OFFLINE   LilBambi

LilBambi

    Australisches Googler

  • Forum Admins
  • 21,753 posts

Posted 07 May 2003 - 05:18 PM

Bruno --Great tips!I believe my Jim uses a GUI based front end for CDRECORD which I believe is called XCDRoast. I have seen it, but am not sure on the exact name, but it is pretty slick. It has support for Joliet and creating bootable Windows CDs as well.I use Nero myself, because that is the computer that has the CDRW in it, and I would have to agree wholeheartedly ...skip the Wizards :(
Bambi
AKA Fran

Posted Image
My Public Key for Email :: BambisMusings Blog :: Fran's Computer Services Blog :: MyPassionIsBooks Blog :: 5BuckReview :: CNIRadio
"The Net interprets censorship as damage and routes around it." ~John Gilmore (Time Magazine, Dec 6, 1993)

#84 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 May 2003 - 05:24 PM

LilBambi, on May 7 2003, 11:18 PM, said:

I believe my Jim uses a GUI based front end for CDRECORD which I believe is called XCDRoast.
Hi Fran:I did use XCDroast too for a short while, but cdrecord on the commandline is just so much easier for ISO's ! :(( no more XCDroast in mdk 9.1 I just saw, it is replaced by K3b, still prefer the commandline cdrecord or even better cdcopy ) :( Bruno

#85 OFFLINE   LilBambi

LilBambi

    Australisches Googler

  • Forum Admins
  • 21,753 posts

Posted 07 May 2003 - 05:51 PM

Bruno,You are absolutely right. For many things commandline is actually easier and quickerBut sometimes those cool GUI front ends are very handy. With some programs, they can cut to the chase graphically to make some of those very long commands that can run into several lines of options a lot easier :(
Bambi
AKA Fran

Posted Image
My Public Key for Email :: BambisMusings Blog :: Fran's Computer Services Blog :: MyPassionIsBooks Blog :: 5BuckReview :: CNIRadio
"The Net interprets censorship as damage and routes around it." ~John Gilmore (Time Magazine, Dec 6, 1993)

#86 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 May 2003 - 05:57 PM

Sure if you want to burn a bundle of files, you're definitely right, then I do GUI too. ( I'm not that fanatic ! :( )But for just an ISO, in the time the GUI loads I've got my ISO burned. :( :( Bruno

#87 OFFLINE   LilBambi

LilBambi

    Australisches Googler

  • Forum Admins
  • 21,753 posts

Posted 07 May 2003 - 06:49 PM

Bruno --LOL!  :( I hear ya!
Bambi
AKA Fran

Posted Image
My Public Key for Email :: BambisMusings Blog :: Fran's Computer Services Blog :: MyPassionIsBooks Blog :: 5BuckReview :: CNIRadio
"The Net interprets censorship as damage and routes around it." ~John Gilmore (Time Magazine, Dec 6, 1993)

#88 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 May 2003 - 06:53 PM

Fran:  ;)  B)  Bruno

#89 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 08 May 2003 - 04:41 PM

SHOUTCAST-STREAM to MP3

UPDATE:  Our forum member Steel came with a far easier way in the new XMMS
Crtl + P --> audio 1/0 plugins ---> double click on mpeg layer -->then click on tab "streaming" ---> then tick box "save streaming to disk
"If this does not work for you, try it the way described below:


Today we attack the music section, 3 programs to play around with music files: "Vsound" for recording, "Lame" for converting to MP3 and "mp32ogg" to convert mp3 to ogg. ( ogg vorbis the copyright free audio format )

Ever wished you could record shoutcast audio stream ?
Here is a trick to record stream and convert it to mp3 in one go:

First you need two files; Lame and Vsound:
# urpmi notlame
( Hope you got the urpmi sources set up, it's from the plf ), this will install Lame ! (Yes, I know the package is called Not-Lame, but it installs Lame)

Then go to:
http://fr.rpmfind.ne.....ubmit=Search...
and download the file: vsound-0.4-1mdk-i586.rpm and do:
# rpm -ihv vsound-0.4-1mdk-i586.rpm
( While you're in the directory you downloaded the file in )

O.K. Here is the trick: First go to http://www.shoutcast.com/index.phtml and pick out a station you want to record from. As soon as xmms will start playing you stop xmms and get it of your screen ( not minimize )
Now the code:
$ vsound -s -d xmms -p | lame -h "-" track1.mp3
( "-" stands for standard-out, just copy exactly "-" )

Thats all !

If later you want to convert mp3 to ogg you need the file  'mp32ogg" and do < mp32ogg  track1.mp3  track1.ogg >

Installing mp32ogg: < urpmi mp32ogg > ( you need CD 1 & 3 ) ( "Perl-MP3-Info" and "Perl-String-ShellQuote" will be installed aswell, just sit back and let urpmi do the works )

PS: in some cases your "-" can gives problems, in that case do:
$ vsound -s -d xmms -p >track1.wav
  
( And convert it later to mp3 )

Or even at the same time:
$ vsound -s -d xmms -p >track1.wav&
( You will get your prompt back, then give the command: )
$ lame track1.wav track1.mp3

Have fun recording !

B) Bruno

#90 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 09 May 2003 - 05:59 PM

AGAIN, HANDY FILE COMMANDS

head
Sometimes textfiles shown with <cat > are much to long to fit on your screen, this command will show you the top 10 lines of a file, with an -20 option you can let it show the first 20.
$ head -15 fileA
( For the first 15 lines )

tail
Does the same as head, but guess. . . . it shows the last 10.
$ tail -25 fileA
( For the last 25 lines )

cmp
If you typed a long text, saved it and later the file gets edited and saved again. There is a command to compare the two files and show the differences:  
$ cmp -l fileA fileB
  ( The l option is to show all differences )

diff
Also checks two files on differences but in another way, just try:
$ diff -by fileA fileB
( The b option is for ignoring black space the y option to sort the output side by side )

lpr
This is a simple one, as you're in the commandline might as well print with it:
$ lpr fileA
( Will print the fileA )
$ lpr -#5 fileA
( Will print the file 5 times )

touch
Will create an empty file ( you can write to that file later )
$ touch fileA
  

A FEW TIME RELATED COMMANDS:
( useless but nice to know :) )

date
Will show you the current date

time
Will show you the current time

NOTE: you can run several commands on one line seperating them with an ";" so
$ date; time

Will show you: "Fri May  9 21:34:37 CEST 2003"

B) Bruno

#91 OFFLINE   Scot

Scot

    Administrator

  • Forum Admins
  • 1,992 posts

Posted 10 May 2003 - 04:08 PM

Bruno, I love this thread. We should talk about other ways to make it available. I could put it on the website, publish your installments as a regular section in the newsletter, we could create a sub-forum for it right here in the All Things Linux forum. Or any combination. Anything that interests you. I just love this idea!  B) -- Scot
Scot Finnie, Editor-in-Chief, Computerworld.com

#92 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 10 May 2003 - 04:45 PM

Scot,Any idea that suits you ! It's your forum, I can only write these things on your vehicle ! Your ideas about the newsletter would not only be fine, but a real honor !As subforum . . . just as long as it is obvious and easy to find for the users of the "All Things Linux"  forum, it is for helping them that I am writing these "tips". To warm them up, make them easy with the commandline, to make them eager to learn more and understanding their OS. That is my primary goal, my friends here on the forum who only recently made the jump.We will talk about the actual shape of it, give me some time to think.B) BrunoPS: if you do put them in your newsletter, please edit the text to *real* English.

#93 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 11 May 2003 - 06:40 PM

CONFIGURING YOUR NETWORK CARD

NOTE: I scrambled a few things together out of a thread from Stryder and his troubles of configuring his NIC.
Bits and pieces were taken from posts of Peacy and Lilbambi

First we will install the driver, in this example a Tulip driver.

Go to the directory of the driver:
$ su
< password >
# cd /lib/modules/'uname -r'/kernel/drivers/net/tulip

Then we will install the driver:
# install -m 644 tulip.o

load the driver:
# /sbin/insmod tulip.o
# depmod -a

# cd
  
( come back to the home directory )

# netconfig
( to configure your networkcard )

# ifconfig eth0 up
( will put your connection up )
( ifconfig eth0 down to kill it )

If all went well:
# netstat -i
( Will show you the "eth0" and "lo" )

Now try to ping a welknown host like your ISP
# ping www.cnn.com

You should be able to see traffic there and your connection is O.K.

If not, a reboot, after editing your modules.conf ( see next part ) sometimes helps.

Now new still have to edit your modules.conf for the modules to be loaded at boot:
$ su
< password >
# emacs /etc/modules.conf

NOTE: There will already be a few lines in modules.conf, do not change those ! Only add the line:

Quote

alias eth0 tulip

and safe the file with
< Ctrl+x >
< Ctrl+c >
and
< y >

That's all there is to it folks.

First webpage to visit is:  http://forums.scotsn...r.com/index.php?

B) Bruno

#94 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 12 May 2003 - 05:15 PM

PENGUIN LIBREATION FRONT UPDATE!

For those of you loving the PLF rpm's just like I do, there is a cheat-code to avoid those messages at install, you know the ones saying that the package misses the official Mandrake signature:

Mandrake 9.1
Open a console
$ su < password >

and paste the following line after the prompt:
 l.inks -source http://plf.zarb.org/plf.asc | gpg --import
  

Mandrake 9.2
wget http://plf.zarb.org/plf.asc; rpm --import plf.asc; rm -f plf.asc

WARNING: you have to be on-line for the trick to work!

I'm still searching after the texstar cheat-codes, had them for the 9.0 but the site moved and the new one does not provide the necessary info anymore.

B) Bruno

#95 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 12 May 2003 - 05:38 PM

KNOPPIX CHEAT-CODES

Sometimes your Knoppix live CD can give a little problem, sure with Nvidia and Radeon cards.
Here are a few cheatcodes you can try:

Normaly at the prompt at boot:
knoppix lang=en screen=800x600

Cheatcodes:
Knoppix lang=en nopcmcia
Knoppix lang=en nopcmcia noapm
Knoppix lang=en noapm

Nvidiacard !!!! :
knoppix lang=en xmodule=nv|radeon|savage|s3

knoppix lang=en xserver=XFree|XF86_SVGA

You can always press F2 at the prompt for more options: language, mouse, etc.!

B) Bruno

* There is a full list of cheatcodes and other official Knoppix information added next in  The Tips

#96 OFFLINE   Stryder

Stryder

    Multithreader

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,073 posts

Posted 13 May 2003 - 06:03 AM

greengeek, on Apr 22 2003, 07:49 PM, said:

:P When I first tried to join a local Linux User Group I was told to "read all the books and howtos and don't ask stupid questions and waste everybody's time". Needless to say I took their advice but didn't join their group.Joy
Yeah, that is how it was for me on 2 or 3 different forums in the past. It not only made one think linux users were jerks, it completely destroyed my interest in the OS. Bruno has changed all of that though. It is reassuring  knowing you have somewhere to turn for help.

#97 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 13 May 2003 - 03:01 PM

You're so kind Stryder, but like I did say before; it are ALL the friends here on the forum, who make it such a fine place to hang out !B) Bruno

#98 OFFLINE   charlie

charlie

    Message Mogul

  • Members
  • PipPipPipPipPip
  • 428 posts

Posted 13 May 2003 - 04:52 PM

Quote

it is ALL the friends here on the forum, who make it such a fine place to hang out !
that is the best tip of all  Bruno here is what I managed to do with you suggestions on partitoning ( Mandrale 9.1)  On the HD on the desk top I have 8.3 GB of linux space . I nthe partioning part there is an aotomatic setup , 50 % / 50 % /home and a 500 Mg swap file , worked fine except I have an interesting error message in boot up "Finding Moduel Dependances"  , message "idm_validate_Partition_Table () .....Disk read failed in stead of OK but the system works . Took about 3 boot ups to get all the message   :blink:  Laptop the automatic feature didn't work so I have a size modified setup based on the 10 GB partition .  works perfectly , no error message.  ( /, /var ,/home and swap)The tip on the PLF should help getting Xine to read DVD.,s with the D4D, D5Dlib plugins  next will be to network the Linux in both machines and that other OS windozNow hopefullly this will make the post list   :huh: charlie aka the gray hair generation

#99 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 13 May 2003 - 05:01 PM

Hi CharlieGlad this is all working so well for you !Did I get this right: you have 2 systems, a normal box and a laptop. The laptop is 100% O.K., but if you've got problems with the other one; feel free to post a new thread, so everybody can learn from it as we try to fix it ! :blink:  Bruno

#100 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 13 May 2003 - 07:08 PM

REDIRECTIONS  
( AND THE BLACK HOLE: >/dev/null )

Right, it's about time to put something right: uptill now I did use the "<" and ">" characters to make clear to you what part of the text the real commands were. For "The Linux Starters" that seemed like a good idea.

Now we come to the point where I do need those signs to have a function in the commands I will tell you about.
But let's be fair, if you made it up till here, you can't be considered as a "Starter" anymore. And you will know a command when you see one !! ;)

We use the "> <" signs for redirections, example:
$ ls /music/dylan/*.mp3 1>songs.txt

Will make a list ( ls ) of all the files in the dylan directory ( /music/dylan ) ending with .mp3 ( *.mp3 ) . This list usualy sent to standard out ( 1 ) but now redirected ( > ) to the file songs.txt ( songs.txt ) in your /home.

NOTE: the 1 for standard out is in this example not really needed, but we might as well get used to it ! 0=Standard in ( usually the keyboard ) 1=Standard out ( the normal output on your screen ) 2=Standard error ( the error messages you get on the screen )

Still with me ? Next example:
$ wc -l 0<songs.txt

Will count the lines ( wc-l ) from the input ( 0< ) of the file songs.txt
Simply said: it will tel you how many Bob Dylan .mp3's there are in my dylan directory ! Well, that is a nifty trick isn't it ?

O.K. Because you're starting to like this, one last example:
$ ls -R /var >/dev/null 2>errors.txt

This is a funny one, let me first explain what we end up with, before cutting it in pieces: we will get a list of all the files we have no permission for, in the /var directory ( the error messages we usually see on the screen as we try to access a file we have no permissions for ).
List all the files in all directories ( ls -R ) in the /var directory ( /var ) and send them ( > ) to the black hole ( /dev/null ) and send all the error messages ( 2> ) to a file called errors.txt ( errors.txt )That's it for today friends, glad I managed to get it noted down !  :lol:( *wipes the sweat of his forehead )

B) Bruno




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users