Quote
Quote

# ln -s /usr/lib/libpopt.so.1 /usr/lib/libpopt.so.0And try the install again.When both packages are installed successfully you have to restart cups and set your printer up to use the new drivers.Source: linuxforen.de

Posted 10 November 2004 - 02:28 PM
Quote
Quote
# ln -s /usr/lib/libpopt.so.1 /usr/lib/libpopt.so.0And try the install again.When both packages are installed successfully you have to restart cups and set your printer up to use the new drivers.Source: linuxforen.de
Posted 16 November 2004 - 03:09 PM
Striker, on Forum, said:
$ su < password> # guarddogThe guarddog firewall application window opens now, head over to the tab shown in the screen shot below :. . . .
# exit $ blah blah blah $ exitStep 2 Open up kphone: if there's not an icon in the kmenu to be found, instead of searching for the program's icon, click on "Run command ..." in the kmenu, and type in "kphone" - without the quotes of course: kphone's little main window will then open. It looks like the screen shot below:. . . .
Posted 01 December 2004 - 03:06 PM
middlemouse.contentLoadURL value = falseTo hide the UI for what is known as "Single Window Mode"Addresbar: about: configFilter: browser.tabs
browser.tabs.showSingleWindowModePrefs value = trueMax number of popups that can be loaded at any one timeAddressbar: about: configFilter: dom.popup
dom.popup_maximum value = 10SmoothScrollAddressbar: about: configFilter: smoothscroll
general.smoothScroll value = trueOnline banking: ( Maybe only in Europe )Works on sites where you have to type in information ( more then only nickname and password ) to go to the next level.Make exception in pop-up blocker for the address of the bank ( in options, webfeatures )Addressbar: about: configFilter: cache
browser.cache.check_doc_frequency value = 1Addressbar: about: configFilter: alive
network.http.keep-alive value = falsenetwork.http.proxy.keep-alive value = falseAll prefs set in about:config take effect immediately (you don't even have to restart the browser !)Thanks to Neil for his input ! ( See also Here )
Posted 07 December 2004 - 03:07 PM
Posted 07 December 2004 - 03:08 PM
Posted 07 December 2004 - 03:08 PM
Bruno, on Forum, said:
urpmi.addmedia contrib_ftp.nluug.nl_i586_10.1Official ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrakelinux/official/10.1/i586/media/contrib/ with ./media_info/hdlist.czPLF:
urpmi.addmedia plfplf ftp://ftp.proxad.net/pub/Distributions_Linux/plf/mandrake/10.1/ with hdlist.czYou do need Contrib ( not club-contrib ) for PLF to work properly ;)Thacs: ( Music instruments ! )
urpmi.addmedia thacs.rpms http://rpm.nyvalls.se/10.1/RPMS with hdlist.czClub-contrib:
urpmi.addmedia club.contrib_ftp.uni-bayreuth.de_i586_10.1Official ftp://ftp.uni-bayreuth.de/pub/linux/Mandrakelinux/devel/testing/Mandrakeclub/10.1/i586 with hdlist.czJava packages:
urpmi.addmedia jpackage_ftp.nluug.nl_i586_10.1Official ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrakelinux/official/10.1/i586/media/jpackage/ with ./media_info/hdlist.czEslrahc: Link
urpmi.addmedia eslrahc http://www.eslrahc.com/10.1/ with hdlist.czNorlug: Link
urpmi.addmedia NORLUG-10.1 http://mirror.datapipe.net/norlug/mandrake-10.1/RPMS/ with hdlist.czMore small ones: http://www.thebrix.org.uk/ONLY CLUB-MEMBERS:Club-Commercial:
urpmi.addmedia club.comm_i586_10.1Official http://NICKNAME:PASSWORD@www.mandrakeclub.com/downloads2/comm/10.1/i586/ with ./media_info/hdlist.cz( replace "NICKNAME" and "PASSWORD" ) Club-Testing: ( Be Careful With These !! )
urpmi.addmedia testing_i586_10.1Official http://NICKNAME:PASSWORD@www.mandrakeclub.com/downloads2/test/10.1 with hdlist.cz( replace "NICKNAME" and "PASSWORD" )
Posted 14 December 2004 - 03:27 PM
$ find -type f -name dummyThis is the basic way to use "find". If no path is given, it looks in the present directory and its subdirectories. Then we use the "-type f" to tell find it we are looking for a file ( f ) directory ( d ) or link ( l ) after that "-name dummy" to tell it we are looking for a file with the name "dummy" ( with wildcard "-name *ummy?" ).You will see it will find the answer:
Quote
$ find / -type f -name dummy 2>/dev/nullThis time "find" not only searches the local directory, because the first argument we give it has to look in "/" ( the complete filesystem . . . . so that takes a while ) and because we give the command as "normal user" and not as root it would lead to a lot of "permission denied" messages if we did not add the last bit "2>/dev/null" ( See: The black hole )On my Mandrake install the answer to this command is:
Quote
$ find / -type f -name dummy 2>/dev/null -exec cat {} \;This time it does all the previous, but at the end of the command you see "-exec cat {} \;" . . . this means "-exec" execute the next command "cat" on the results found from the find command "{}" . . . . the "\;" means that the exec command ends there.Again on my system the result is:
Quote
$ find / -type f -name dummy 2>/dev/null -exec cat {} \; >tesst.txtAlso, this time it has all the things listed above, but I added ">tesst.txt, which tells it to ">" write them in a file called "tesst.txt" instead. ( And not put the output on the screen )So if you do not know where your lilo.conf file is located, but you want a copy of it for reading in your home directory, here is what you do:
$ find / -type f -name lilo.conf 2>/dev/null -exec cat {} \; >lilo.txtAnd you will find a file called lilo.txt in your /home directory ;)And because I know you want to know more, here is the FUN step:
$ find /home -type f -name "*.sxw" -atime -3 -user brunoHere we "find" in "/home" all "-type f files with the "-name" "*.sxw" so all OpenOffice sxw documents that "-atime -3" have been accessed in the last 3 days ( "-atime +3" would be: have NOT been accessed ) and that are owned by the "-user bruno" ( So basically: has anyone been messing with my files in the last 3 days ??
Posted 21 December 2004 - 02:39 PM
$ kwrite sound.shThis will open a window with a blank file . . . .2). Next copy and paste the following text in that empty file:
#!/bin/sh# soundchk.sh# Rev 1.00 2003-10-13 Initial Release - Mandrake 9.1 specific# Rev 1.01 2003-10-13 Added Checking Devices# Added grep steps to restrict output. Really needed for Knoppix.# Add file exists tests to find correct tools# Completed port to Knoppix 3.3. Should also be much better for UNKNOWN.# Rev 1.02 2003-10-14 Added test -x for aumix# Fix bug in lspci greps# Rev 1.03 2003-11-24 Add additional tests from alsa aadebug script# Rev 1.04 2003-11-25 Fix typo in 1.03 lspci grep# Add check for artsd# Add check for using cdrom# Rev 1.05 2005-01-22 Adapted to udev and kernel 2.6 by Bruno# Rev 1.06 2005-01-23 Adapted by Bruno to better suit SUSE and Slackware# Rev 1.07 2005-01-23 Added a bit of interactivity at the end --Bruno# Rev 1.08 2005-01-23 Adapted chkconfig to suit SUSE --Brunoechoecho "soundchk.sh v1.08 - Running Sound Configuration Checks"echoecho# time and userdate=$(date)echo "Today is $date"me=$(whoami)echo "Sound tested by $me"echoechoecho "== Identifying System =="uname -s -r -v -p -ocat /proc/cpuinfo | grep -i "model name"cat /proc/cpuinfo | grep -i "cpu mhz"cat /proc/meminfo | grep -i memtotalcat /proc/meminfo | grep -i swaptotalechoecho "== Checking dsp devices =="ls -l /dev | egrep -i dsp\|soundechoecho "== Checking mixer devices =="ls -l /dev | egrep -i dsp\|mixerechoecho "== Checking Knotify =="cat ~/.kde/share/config/knotifyrc# adapted to suit SUSE and Slackechoecho "== Checking Driver ==" if test -f /usr/bin/lspcidrakethen /usr/bin/lspcidrake -v | egrep -i "(audio|multimedia|host bridge)"elif test -f /sbin/lspcithen /sbin/lspci -v | egrep -i "(audio|multimedia|host bridge)"elif test -f /bin/lspcithen /sbin/lspci -v | egrep -i "(audio|multimedia|host bridge)"elif test -f /usr/bin/lspcithen /usr/bin/lspci -v | egrep -i "(audio|multimedia|host bridge)"elseecho "==> Test not available on this system !"fiechoecho "== Checking Actual Driver in Use (/etc/modules.conf) kernel 2.4 =="if test -f /etc/modules.conf; then cat /etc/modules.conf | egrep -i snd\|soundelse echo "==> Test not available on this system !"fi# added for kernel 2.6 by Brunoechoecho "== Checking Actual Driver in Use (/etc/modprobe.conf) kernel 2.6 =="if test -f /etc/modprobe.conf; then cat /etc/modprobe.conf | egrep -i snd\|soundelse echo "==> Test not available on this system !"fiif test -d /dev/snd; then echo echo "== Checking alsa /dev/snd ==" ls --color=none /dev/sndfiechoecho "== Checking if Module Loaded =="/sbin/lsmod | egrep -i snd\|sound\|audio\|gameecho if test -x /sbin/chkconfig; then echo "== Checking in what level Sound service is configured to run ==" /sbin/chkconfig --list sound echo echo "== Checking in what level Alsa service is configured to run ==" /sbin/chkconfig --list alsa echo echo "== Checking in what level AlsaSound is configured to run ( Only SUSE !! ) ==" /sbin/chkconfig --list alsasoundelse echo "==> Test for run levels not available on this system !"fiechoecho "== Checking if Sound Volume muted =="if test -x /usr/bin/aumix; then aumix -qelse echo "==> Test not available on this system !"fiechoecho "== Checking artsd setup =="ps -A -f | grep -i artsd | grep -v grepechoecho "== Checking which program uses the sound card or cdrom =="echo " (no output is okay)"if test -x /sbin/fuser; then /sbin/fuser -v /dev/dsp /sbin/fuser -v /dev/cdromelse /bin/fuser -v /dev/dsp /bin/fuser -v /dev/cdromfi# Extra test added by Brunoechoecho "== Test wav file . . . . . please wait =="# test on SUSEif test -f /opt/kde3/share/sounds/KDE_Startup.wav then /usr/bin/play /opt/kde3/share/sounds/KDE_Startup.wav# test on Slackwareelif test -f /opt/kde/share/sounds/KDE_Startup.wav then /usr/bin/play /opt/kde/share/sounds/KDE_Startup.wav# test on Mandrake, Fedora and PCloselif test -f /usr/share/sounds/KDE_Startup.wav then /usr/bin/play /usr/share/sounds/KDE_Startup.wav else echo "==> Test not available on this system !"fi# Interactive partecho -n "Did you hear the soundfile Yes/No ?:"read answer# the user did not enter anything:while [ -z "$answer" ]; doecho "You did not tell me Yes or No !!!"echo -n "Did you hear the soundfile Yes/No ?:"read answerdoneecho "You typed: $answer Thanks !"sleep 2echoecho "== End of Checks;-)"echo3). Now save the file ( File --> Save ) and close the kwrite window.4). Next another command:
$ chmod 755 sound.sh. . . it will look like nothing happens, this is okay.5). And the last command is:
$ ./sound.sh. . . now the script is running and will print the output to screen. ( Don't forget the dot before the slash in the command ! )6). You can use the output of the script to post on the forum where you go to solve your Linux related problems.The script has proven to be very useful in the past, so in case of sound related problems: just run the script and post the results.
Posted 28 December 2004 - 02:19 PM
Posted 04 January 2005 - 02:53 PM
$ sed -i 's/ugly/beautiful/g' /home/bruno/old-friends/sue.txtWell, that command speaks for itself "sed" edits "-i in place ( on the spot ) and replaces the word "ugly with "beautiful" in the file "/home/bruno/old-friends/sue.txt"Now, here comes the real magic:Imagine you have a whole lot of files in a directory ( all about Sue ) and you want the same command to do all those files in one go because she/he is standing right at the door . . Remember the find command ? We will combine the two:
$ find /home/bruno/old-friends -type f -exec sed -i 's/ugly/beautiful/g' {} \;Sure in combination with the find command you can do all kind of nice tricks, even if you don't remember where the files are located !Aditionally I did find a little script on the net for if you often have to find and replace multiple files at once:
#!/bin/bash for fl in *.php; do mv $fl $fl.old sed 's/FINDSTRING/REPLACESTRING/g' $fl.old > $fl rm -f $fl.old donejust replace the "*.php", "FINDSTRING" and "REPLACESTRING" make it executable and you are set.I changed a www address in 183 .html files in one go with this little script . . . but note that you have to use "escape-signs" ( \ ) if there are slashes in the text you want to replace, so as an example: 's/www.search.yahoo.com\/images/www.google.com\/linux/g' to change www.search.yahoo.com/images to www.google.com/linuxFor the lovers of perl I also found this one:
# perl -e "s/old_string/new_string/g;" -pi.save $(find DirectoryName -type f)But it leaves "traces", e.g it backs up the old file with a .save extension . . . so is not really effective when Sue comes around ;-/
Posted 11 January 2005 - 03:00 PM
# MM ADDED BY BRUNO NOV 2004body MMVIAGRA2 /viagra/idescribe MMVIAGRA2 mmrulescore MMVIAGRA2 5.0body MMVICODIN2 /vicodin/idescribe MMVICODIN2 mmrulescore MMVICODIN2 5.0body MMPRESCRIPTION /prescription/idescribe MMPRESCRIPTION mmrulescore MMPRESCRIPTION 3.0body MMCIALIS2 /cialis/idescribe MMCIALIS2 mmrulescore MMCIALIS2 5.0body MMROLEX2 /rolex/idescribe MMROLEX2 mmrulescore MMROLEX2 5.0body MMLEVITRA2 /levitra/idescribe MMLEVITRA2 mmrulescore MMLEVITRA2 5.0body MMVIOXX2 /vioxx/idescribe MMVIOXX2 mmrulescore MMVIOXX2 5.0body MMVALIUM2 /valium/idescribe MMVALIUM2 mmrulescore MMVALIUM2 5.0body MMPHARMACY2 /pharmacy/idescribe MMPHARMACY2 mmrulescore MMPHARMACY2 3.5body MMMEDICINES2 /medicines/idescribe MMMEDICINES2 mmrulescore MMMEDICINES2 3.5body MMSOFTABS2 /softabs/idescribe MMSOFTABS2 mmrulescore MMSOFTABS2 5.0body MMMICROCAP2 /microcap/idescribe MMMICROCAP2 mmrulescore MMMICROCAP2 5.0body MMSMALL-CAP2 /small-cap/idescribe MMSMALL-CAP2 mmrulescore MMSMALL-CAP2 5.0body MMSMALLCAP /smallcap/idescribe MMSMALLCAP2 mmrulescore MMSMALLCAP2 5.0body MMTRADERS2 /traders/idescribe MMTRADERSS2 mmrulescore MMTRADERS2 3.5body MMEJACULATION2 /ejaculation/idescribe MMEJACULATION2 mmrulescore MMEJACULATION2 5.0Additionally I found another little tweak on the PCLos forum, posted by Yama HereIt seems that if you add:
score MICROSOFT_EXECUTABLE 5.0Mails with an MS executable as attachment will be seen as spam too !Somehow the virus writers seem to have me scratched from their mailing list because I have not received one in a long time . . . so I have not been able to verify this one. ;)
Posted 18 January 2005 - 02:18 PM
# urpmi.removemedia -aIf you still have the CD's and want to add those: ( Put CD 1 in the CD-ROM )
# urpmi.addmedia --distrib cd- removable://mnt/cdrom/If you have no CD's you can add the FTP sources for the distribution:
# urpmi.addmedia --distrib nluug- ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrake/official/10.1/i586/It will automatically add all the available media . . . . and get the correct paths to the hdlists !If you are on dial-up you may prefer the synthesis-hdlist to the normal hdlist because it takes less time to download:
# urpmi.addmedia --distrib --probe-synthesis --wget nluug- ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrake/official/10.1/i586/( The --wget option is a personal preference, I use it to give priority to wget over curl to get the hdlists )
Posted 25 January 2005 - 02:36 PM
# chkconfig --listThis gives you the full list.Now we know all the services we have 4 commands that are useful ( let us take "numlock" as an example ):
# service numlock stop# service numlock start# service numlock restart# service numlock statusThe first command will stop a service temporary until the next time you reboot. The second one will start it, also until the next reboot. The third command speaks for itself. Now you want to stop a service, but you also want to prevent it from being started the next time you boot:
# service numlock stop# chkconfig numlock offOr the other way around, you want to start a service that is not running and make sure it will be up running next time you reboot:
# service numlock start# chkconfig numlock onNOTE: The first command is "service", but the second one ( with the off and on argument ) is "chkconfig" !! Next time you want to service your car, remember how easy and effortless that was in Linux !
Posted 01 February 2005 - 02:08 PM
Striker, on Forum 2004, said:
Posted 08 February 2005 - 02:04 PM
$ kwrite ~/.kde/share/config/knotifyrcThat will open a file where you see text . . compare it and make it 100% the same as:
Quote
Posted 15 February 2005 - 03:46 PM
Posted 22 February 2005 - 02:14 PM
Julia, on Forum 2005, said:
Quote
Posted 01 March 2005 - 02:24 PM
Julia, on Forum 2005, said:
$ tar zxvf ndiswrapper-1.0.tar.gz$ cd ndiswrapper-1.0$ su<password># make# make install3. Now that you have your ndiswrapper and your wireless tools installed, you are ready to get down to business:
# ndiswrapper -i (name of your file).inf# ndiswrapper -lThis should give you a printout like this:
[root@localhost julia]# ndiswrapper -lInstalled ndis drivers:netasag driver present, hardware presentNow you are ready to continue. 4.Next it is time to probe for your ndiswrapper. It should just continue without any messages. If so, you will then continue to the next step:
# modprobe ndiswrapper# iwconfigThis will give you a printout like this:
lo no wireless extensions.eth0 no wireless extensions.eth1 no wireless extensions.sit0 no wireless extensions.wlan0 IEEE 802.11g ESSID:"YourNetworkname" Nickname:"localhost" Mode:Managed Frequency:2.412 GHz Access Point: 00:00:00:00:00:00 Bit Rate=54 Mb/s Encryption key:off Link Quality:22/100 Signal level:-93 dBm Noise level:-256 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0With this you can continue with
# iwlist wlan0 scanThis will give you all the details to show it is working. Here is mine:
wlan0 Scan completed : Cell 01 - Address: 00:0F:3D:5A:95:BC ESSID:"XXXXXX" Protocol:IEEE 802.11g Mode:Managed Frequency:2.437 GHz (Channel 6) Quality:0/100 Signal level:-50 dBm Noise level:-256 dBm Encryption key:off Bit Rate:1 Mb/s ...... Bit Rate:54 Mb/s Extra:bcn_int=100 Extra:atim=0You can see that I have an ESSID of XXXXXX and am using Channel 6. Managed means I am not running WEP at the moment. If you are then you will need to tell it "open" rather than managed. You will take the information from this printout to do your configuration:
# iwconfig wlan0 mode Managed (or Open or Shared if using WEP)# iwconfig wlan0 key restricted XXXXXXXXXX (if using wep this is where you tell it your key)# iwconfig wlan0 essid YourNetworkName [code]Now that you have it configured you have just a few things left to do.;)You will need to do one of the following three commands. You might have to do trial and error. For me in mandrake it was dhclient wlan0 (which of course was the last I tried. :D The choices are:[code]# ifconfig wlan0 up# dhclient wlan0# dhcpcd wlan0If that worked you are now ready to tell it to load it automatically each time you boot up.
# ndiswrapper -mIn most cases it will finish by saying "Adding "alias wlan0 to ndiswrapper" to /etc/modprobe.conf". Happy wireless browsing.
Posted 08 March 2005 - 02:02 PM
Julia, on Forum 2005, said:
#! /bin/sh##Wireless USB setup##step 1 - enable wireless USB for wlan0wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable# step 2 - set SSID for network SSID requires OpenSystem while a systemwithout encryption would be Managed Authtype will be opensystem ormanaged.wlanctl-ng wlan0 lnxreq_autojoin ssid=**** authtype=****# step 3 - set wep attributes True for Encrypted and False for Not.wlanctl-ng wlan0 lnxreq_hostwep encrypt=true decrypt=true#step 4 set wep key if running encrypted. Key 1 in windows is Key 0 inLinux. Key 2 in Windows is Key 1 and so on. wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKeyID=*wlanctl-ng wlan0 dot11req_mibsetmibattribute=dot11WEPDefaultKey1=**:**:**:**:**:**:**:**:**:**:**:**:**#step 5 - set IP configuration Sample IP, Netmask and Gateway shown:Replace with what you use.ifconfig wlan0 192.168.0.103 netmask 255.255.255.0 broadcast127.255.255.255 route add default gw 192.168.0.102When you are finished configuring this to your situation, save it aswlanscript.
# chmod 755 wlanscript# ./wlanscriptNotes: If you use a SSID name other than default you will find a filecalled /etc/wlancfg/wlancfg-*****. (Replace ***** with the name of yournetwork). If that does not automatically happen when you insert yourSSID then go in and edit /etc/wlancfg/wlancfg-DEFAULT and saveas /etc/wlancfg/wlancfg-(your name).If all else fails, run
# ifup wlan0to try to bring up your network manually.Good Luck!<If you asked for patience, you will know now that you have been tested to see if you need more patience.
Posted 15 March 2005 - 02:26 PM
Julia, on Forum 2005, said:
Posted 26 March 2005 - 04:53 PM
Quote
$ xhost +And (as root)
# set DISPLAY=localhost:0.0In some extreme cases the error returns after a reboot, in that case making a little bash-script for the "user command" and putting it in the ~/.kde/Autostart directory. And adding the "root command" at the end of the /etc/rc.d/rc.local file will do the trick at every next boot.
Posted 29 March 2005 - 01:34 PM
# ifconfig eth0And you will get something similar to this:
Quote
/sbin/ifconfig eth0 mtu 1460And see if you get better results . . . No ? Well, try again
/sbin/ifconfig eth0 mtu 1300or
/sbin/ifconfig eth0 mtu 1200Now imagine you found the value you want to make permanent: MTU 1250 , pull up the file "/etc/sysconfig/network-scripts/ifcfg-eth0" and make it read:
Quote
Posted 05 April 2005 - 01:35 PM
$ vi ~/.kde/Autostart/clean-browser.sh( or use any other editor if you are not comfortable with Vi )Copy and paste the next lines:
Script said:
$ chmod 755 ~/.kde/Autostart/clean-browser.shNow every time you log in the script will run and clear out the cache, cookies and history of the Galeon browser.If you would like to automate the same thing for Konqueror ( so you don't have to go to the KDE Control Center --> Security --> Privacy after every session ) you can add the next lines to the script above:
Script said:
Script said:
Posted 12 April 2005 - 01:09 PM
$ cd /home/bruno/testNow first I will show you the use of diff without any options:
$ diff colors1.txt colors2.txt6c6< # indigo---> # indigo-blue11d10< # sienna12a12> # darkblue15c15< # tomato---> # tomato-redWe have to admit that the output is at least confusing . . . so now we add the -u ( unified ) option:
$ diff -u colors1.txt colors2.txt--- colors1.txt 2005-04-01 20:45:21.954828407 +0200+++ colors2.txt 2005-04-01 20:44:50.152742422 +0200@@ -3,13 +3,13 @@ # darkred # deeppink # firebrick-# indigo+# indigo-blue # limegreen # royalblue # sandybrown # seagreen-# sienna # silver+# darkblue # skyblue # teal-# tomato+# tomato-redNow we start to see clearly . . . . . the differences from color1.txt to color2.txt are marked with "-" and "+" . . . . In the first file it says "indigo" in the second one "indigo-blue" the second one has no sienna but has the darkblue the first one has not . . etc. etc.Okay now we will make it even better to read:
$ diff -y -W 70 colors1.txt colors2.txt# chocolate # chocolate# crimson # crimson# darkred # darkred# deeppink # deeppink# firebrick # firebrick# indigo | # indigo-blue# limegreen # limegreen# royalblue # royalblue# sandybrown # sandybrown# seagreen # seagreen# sienna <# silver # silver > # darkblue# skyblue # skyblue# teal # teal# tomato | # tomato-redSee this ?? . . . . The "|" indicates there is a difference and the ">" and "<" tells us what is left out or added !! The -y option stands for "Side by side" . . and the -W 70 sets the width for the column.Now we have found the best way to compare the two files I will show you the other command: "cmp" The cmp command is a whole other story. Let me first give an example:
$ cmp colors1.txt colors2.txtcolors1.txt colors2.txt differ: byte 64, line 6That is all the output it gives . . . that is because cmp stops at the first byte that differs and then exits, writing the line and the byte that causes it to stop. Not really a clear output is it ?Sure we can give cmp the -l option so it does not stop at the first byte that differs but give all the bytes that are different . . but then you will see that ALL the bytes after byte 64 are different and you will only get a real long list even from the short example we use:
$ cmp -l colors1.txt colors2.txt 64 12 55 65 43 142 66 40 154 67 154 165 68 151 145 69 155 12 70 145 43 71 147 40 72 162 154 73 145 151 74 145 155<<---------------------I did remove byte 75 to 140 to shorten it a bit ---------------------->>141 43 153142 40 171143 164 142144 145 154145 141 165146 154 145151 157 145152 155 141153 141 154154 164 12155 157 43156 12 40cmp: EOF on colors1.txtSo it will be clear to you that I prefer using diff . . . . . and the next time we will be using it together with another command we already know to check out the differences of the content of 2 directories. In the 3rd episode on diff I will post a script Ragnar sent me a while ago : "dirdiff" . . . . see you then !
Posted 19 April 2005 - 02:49 PM
$ cd /home/bruno/testThen we make the checksums of all the files in that directory using the find command: ( you can see all about the find command Here )
$ find . -type f 2>/dev/null -exec md5sum {} \; >list1.txt( Note: the dot just after the command "find" means: current directory and below )This will make a file called "list1.txt" and this is how it will look like:
list1.txt said:
$ find . -type f 2>/dev/null -exec md5sum {} \; >list2.txtAfter that we have 2 files with checksums: list1.txt and list2.txt . . . and we use the "diff" command to see what the difference is and what files in that directory are the same and which files have changed.This shows us that only the "colors.txt" file is different and all the other files have the same checksum . . . now, we can do a diff on the 2 color.txt files to see where the different checksum comes from:
$ diff -y -W 70 colors1.txt colors2.txt# chocolate # chocolate# crimson # crimson# darkred # darkred# deeppink # deeppink# firebrick # firebrick# indigo | # indigo-blue# limegreen # limegreen# royalblue # royalblue# sandybrown # sandybrown# seagreen # seagreen# sienna <# silver # silver > # darkblue# skyblue # skyblue# teal # teal# tomato | # tomato-redAnd now we not only see what file in the two directories was different from the other, but also where the difference comes from.Another approach is this:
$ find . -type f 2>/dev/null -exec md5sum {} \; >test.md5That will make a "test.md5" file that you can use at a later date to check if anything in that directory has changed:
$ md5sum -c list.md5The output will be a list of files present in that directory with "OK" or "FAILED"Next time the "dirdiff" script from Ragnar that automates what we have done here above ;)
0 members, 0 guests, 0 anonymous users