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.
I have a cdrom with some C++ programs on it that I want to compile with gcc. I can mount the cdrom OK but gcc complains about the format. I assume this has to do with LF's and CR's and that sort of stuff. Is there an automatic conversion program that I can use to convert to a format that gcc likes??
No, no. The problem as I understand it is that MS-DOS text files have a CR/LF at the end of each line, and in Unix there is only a LF at the end of each line. I suppose I could write something to do the conversion, but I thought there might be a utility already on there to do it.
Maybe there is a tool, which I do not know, but I have a tip:
Have you tried google search?
I gave it a try with the following keywords:
convert CR LF linux dos
Google found 9510 pages in 0.16 seconds. And right the first seemed to be just what you need. Try it and see.
Oh yes, I did try Google, and found quite a few programs. The question is whether or not such a program ALREADY exists in RH8.0 or whether I have to go get one somewhere else. (I thought it might be in DOSUTILS, but no such luck. :-(
Umm, my 2 cents.
1. dos2unix isn't on my personal machine (older Mandrake)
it's a perl script on one FreeBSD system I use, so I
installed that in usr/local/bin (no man pages though)
The classic Un*x/Linux commands for seeing a file are:
"cat", "more", and "less". "type <file>" won't work everywhere.
"type" is/was the name of a similar MS-DOS command.
My '2 cents':
1. I only hoped that he had the dos2unix binary in his path. And he had. So, where is the problem?
2. I would never use "cat", "more" or "less" to find a binary (or a script), since these would list the contents of the file rather than simply saying where it is. (To see the difference, try the two commands e.g. when logged-in into a remote machine via a slow modem connection).
You are wrong when saying 'type is/was the name of a similar MS-DOS command':
The unix 'type' command and the MS-DOS 'type' command are not similar; they establish two completely different tasks: the unix 'type' command prints out the location of a binary if it is in the path, while the MS-DOS 'type' command lists the contents of the file, if found.
If I was to find an alternative to the unix 'type' command, I would recommend the 'which' command that establishes the same task (however the use of the latter is deprecated on SuSe, it is only an alias to 'type -p')
If dos2unix was not likely to be a binary in his path, I would have rather recommended him the command 'find / -name 'dos2unix'' , but this would have resulted in a very long search time, which seemed (and proved) to be unnecessary in this case.