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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My new Linux system sometimes does not recognize executables, and I'm not sure what to do.
For example, I am using fortran77, and just wrote a test "hello world" type program. I compiled it, and get an executable, "a.out" When I type "ln -l" for the file, it definately has executable priveledges. However, when I type "a.out" on the command line I get "command not found." This occurs no matter what I name the compiled program.
As a test, I tried compiling the exact same code in the exact same way on an established linux server. It works perfectly. There are other differences between this other system (hereafter called "the good system") and mine.
* on the good system, all exectuables are denoted by an asterisk (e.g. a.out*)
* on the good system, all directories are denoted by a slash (e.g. mydir/)
* on the good system, each file type shows up in a different color.
How can I get these cosmetic changes, too?
And, more importantly, do you have any ideas on why my little test executables aren't executing?
And to make the commands resided in the current working directory to be executed from the current working directory, edit your PATH environment variable to include current working directory, open /home/yourusername/.bash_profile file for editing and append at the end of PATH statement
:. ( it is a colon followed by a dot).
When you just type in the name (ie. hello) the shell will search your $PATH looking for the command 'hello' (to see exactly what it's searching, type 'echo $PATH'). Therefore you must explicitly tell it where it needs to look. In your case you would 'cd' into the directory which contains your file and type, './hello'.
if the shell doesn't find the prog when you're in the directory, that either means that your user's enviro variables weren't set very well, or that you're compiling and running this program as root.
for security reasons, root does not have the current directory in it's path, and it's a really bad idea to add it. this opens the door for trojans and other bad whatnots. it's not a serious issue on a desktop system at your home, but it's a good habit to learn to separate root work and regular user work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.