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.
Ive been following a tutorial and Ive come to a part about writing and executing shellcode. It told me to create a file called myfile.sh, and then to run the command "chmod 0755 myfile.sh". I did this, and it appeared to work; it turned the file name green when I view it with the ls command. Well, anyway, it then told me to open it up and write a few shell script commands into it just to basically get the hang of executing these files. So I wrote a simple shell script, just echoing some things, and then I saved it. Well, when I tried to run it via "./myfile.sh" it gave me the following error:
-bash: ./myfile.sh: bin/sh: bad interpreter: No such file or directory
The no such file or directory part didnt seem to make much sense to me, because I can see that the file IS there. I also tried making another file and doing the exact same thing but without the chmod part. That gave me a "Permission denied" error message. I then thought that maybe I didnt have sufficient permission on this account, so I switched to root and tried again and got the same results. I have tried everything I can think of, but maybe its something that should be obvious. I have only had linux a few days, so Im still learning.
If anyone can help me out with this, Id really appreciate it. Until then Ill just skip over this part of the tutorial. Thanks.
I had a similar problem but the solution for me was different. I was going through the script tutorial on my Windows workstation and had copied and pasted the "Hello World" script into my windows text editor and then SSH'd the script to my Linux box. I was getting the same "bad interpreter" error unitil I opened the script again in a linux editor and resaved it. It turns out that linux uses a different end of file marker than DOS/Windows and the script would not run until it had been corrected for linux.
You can also use: dos2unix < oldfile > newfile
to convert the dos/windows file to a valid linux file.