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 an executable file HelloWorld in a subfolder of my home directory. I can only make it run if I include the path: ./HelloWorld. I want to make it run only by typing HelloWorld without the ./ part. Any idea how to do this? I am running the bash shell.
Its because Linux has a default search path for executable files ..... you can find the default search path from the console with the
For example mine is;
So you can either move helloworld into one of your default PATH directories, or you can add the folder that contains the helloworld program into your default path (The link should assist you with doing that)
as above it is a path issue. i'd advise you to try to go with the flow where possible though, don't fight the linux conventions, as they are there for very good reasons. if you do add anythign to it, please try to use a fixed bin/ directory, not your home directory or such like.
You need the ./ in there. Otherwise linux thinks your trying to use an internal command rather then a binary file
this is a security feature. if you have a program you created which you called ls and which actually deletes files. if you just type ls the internal command will get executed. if you type ./ls your program will get executed. so you know which one is yours and which one is built in. it will prove very useful if you are system admin. even if you are not this is a safety feature. you can add the current directory to the path but dont do it
Originally posted by Abdul This is probably a dumb question.
I have an executable file HelloWorld in a subfolder of my home directory. I can only make it run if I include the path: ./HelloWorld. I want to make it run only by typing HelloWorld without the ./ part. Any idea how to do this? I am
running the bash shell.
No problem, do a symlink in your $PATH, such as /usr/bin/..
# cd /usr/bin
# ln -s /home/username/HelloWorld/whatever helloworld
That'll do it.
Or you can just move/copy the HelloWorld thingie to /usr/bin/.
Edit: oh sry, didn't notice the previous post about it...