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.
OK, I'm truly a a newbie. I'm in a Linux class at a community college with the worlds worst instructor and a worthless textbook.
The book starts using the following ed construction:
1,$p 'Print all the lines'
but it doesn't give a clue about what the parts of this construction means. I asked the instructor and he gave me an obviously wrong answer about it putting it in a registry. I know he's confused. This guy knows zero linux.
I understand that the p is for print. I take it from the book that the $ means end of a line.
I have no idea what the 1 means or how the syntax of this line works. Since I gather that ed is a line editor I think it should only print one line anyway, but the "explanation" clearly says "print ALL the lines."
Google is no help, since it doesn't recognize symbols such as , and $.
Actually we're not using ed, we're using sed to learn about regular expressions, but this "beginners" book starts the chapter by saying "Throughout this section we assume familiarity with a line-based editor such as ex or ed."
Of course, that's the first reference to any such thing, and it stopped me dead in my tracks right there.
Anyway - enough blowing off steam. Thanks for your help.
1 is line 1, $ is the last line, so 1,$p means "for line = 1 .. last_line; print line"
Note that this is an ed construction, and ed is a very seldom used Linux editor. ed is a great editor if you are using a real tty to edit a file, where your input and output is printed on paper. Most system in use today use CRT display systems, where the screen can be re-displayed to reflect changes, and - on a simple CRT display (one without a Graphical User Interface, a "GUI") an editor like nano or vi is much more common.
About the only current use of ed-like commands is in old programs (like mail and sed) ported from 1980s UNIX systems, and used, almost exclusively, by system administrators.
Of course, almost all current Linux distributions are shiped wit a GUI, and include several full-screen WYSIWUG (What You See Is What You Get) editors. While learning ed might be of interest to a historian, I can't see much point in including it in a Linux class.
(And, just FYI, no Linux system of which I'm aware has anything like a "registry." Most system and application control files in a Linux system are in the /etc directory, and they are simple, easily read, text files.)
Last edited by PTrenholme; 02-12-2010 at 01:57 PM.
BTW agree with PTrenholme. The main editor to at least know the basics of is vi; its installed by default on just about any/all versions of *nix, inc Linux, *BSD, AIX, Solaris, HP-UX, Mac-OSX (I believe).
The minimal recovery shell ash includes a cut-down version of vi built-in.
Also, very low overhead for low bandwidth cxns.