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!

Notices

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.

I have an executable file in the directory that I'm currently in called XYZ. Why can't I just type XYZ to get it to run? instead I have to type ./XYZ in order to get it to run. what is the ./ all about?

Or i'm pretty sure you could make a file called let's say 'XYZ' and put it in /usr/local/bin and make it link to /whatever/whatever/XYZ instead of editing your path, whatever you feel comfortable with...

Originally posted by trickykid What directory is it in.. ?? Most likely the case is that the directory your trying to run it in isn't in your PATH, which causes you to have to type ./ in front of it so it finds it to execute it.

Yeah, this is what has me confused. "./" means the directory above the one your in right?

heres is my situation.

if i type "pwd" I get /A/B/C
then I type "ls" and I see XYZ (the executable file i want to run)
but when I type "XYZ" I get : "bash: XYZ command not found"

if I type "./XYZ" it will run
Why?!?!

ok so if I type "cd .." and move into /A/B
and then do an "ls" XYZ is not there.

trickykid answered that question. maybe you didn't actaully read his reply. your current directory is not on your path as there is no conventional reason for this. when you type a command, you will typically be running a program that is installed in your system and on your path. the exception we have in your case is that you are writing your own code, so the program is not installed. if you really want you can add . (the current directory) to your path, but it's not advised, as you could easily get into many daft situations you're just not aware of at the moment.

personally i'm also developeing a program, http://acidrip.thirtythreeandathird.net and it is insatlled on my system, so when i run "acidrip" it runs the installed version. Now, i am still writing it as wel, asnd obviously don't wish to get the developement version confused with the installed one. if my working directory was on my path, then i wouldn't necessarily know which version i was running, however specifying the relative path "./acidrip" means i know what i am running, and i am in control.

you may not quite get the hang of it yet, but it all makes sense when you get used to it. conventions are tehre for a reason.