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.
This is what works for me, but then i get another problem which list all directorys and subdirectorys. With sed i removed all characters that i do not need but in the end i feel like I am going in wrong direction and ther is a much more elegant solution.
While we're at it, let's also point out that you can avoid creating "picket fence" strings in sed if you change the delimiter from '/' to something else (sed can use just about any character as the delimiter, as long as it doesn't appear in the expression itself).
sed 's/\/home\/danko\/test\/maps\///' #Hard to read. Let's change it to '|' instead.
sed 's|/home/danko/test/maps/||' #Much easier to read. :)
Nice option to know. . Dont know wher you pull that one out. I think that this is not stated in man pages of sed, but maybe I'm wrong (Would not be the first time).
It's not in the man page, but it is in the texinfo manual (info sed).
3.5 The `s' Command
The syntax of the `s' (as in substitute) command is `s/REGEXP/REPLACEMENT/FLAGS'. The `/' characters may be uniformly replaced by any other single character within any given `s' command.
The `/' character (or whatever other character is used in its stead) can appear in the REGEXP or REPLACEMENT only if it is preceded by a `\' character.
The unix grymoire is an easier read for it though. In fact, I just got done working my way through most of the sed page. It can do a lot of really nice things that most people never realize, like running multiple expressions at once and multiline matches.
And Pixellany, I guess you didn't notice, but I mentioned 'grep -v' in my first post.