Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Note that the solution proposed by Ignotum per Ignoius assumes that your two files were literally named "file1" and "file2." If your actual names are different from those, the diff command should be written with the two file names following the -y option.
You can look at the output of man diff for a description of the diff command. (And, of course, man sed for a description of the stream editor into which the diff output is piped.)
Note that the solution proposed by Ignotum per Ignotius assumes that your two files were literally named "file1" and "file2." If your actual names are different from those, the diff command should be written with the two file names following the -y option.
Thanks for pointing that out: I'm a lazy typist...
But i have one doubt is it necessary to redirect the output to a hidden file.
The step of creating a temporary file is necessary --- you can't simply redirect the output of diff/sed to file2, as file2 is still being read line-by-line. However, it's not necessary to make the file hidden --- it's just my usual practice with temporary files.
if thats the case can you please explain me why we cant redirect to a regular file.
You can redirect to a "regular" file: really, a hidden file is "regular" in every sense except that it's not (normally) listed by ls --- it doesn't have any special attributes in and of itself. The reason why (or at least one of the reasons why) I generally choose to hide temporary files containing redirected output is to reflect the fact that they exist only fleetingly as a stop-gap. You could just as easily have used an unhidden file. ...So yes, if it's bothering you, feel free to remove the period!
Last edited by Ignotum Per Ignotius; 03-06-2011 at 12:22 PM.
Reason: Excising pleonasm.