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.
Click Here to receive this Complete Guide absolutely free.
I don't remember what I did. But this afternoon, when I log on to the machine, none of the commands works, ls, top, cd, ssh, nothing. Has this happened to anyone before and what could be the reason? Thanks in advance.
I don't remember what I did. But this afternoon, when I log on to the machine, none of the commands works, ls, top, cd, ssh, nothing. Has this happened to anyone before and what could be the reason? Thanks in advance.
what's weirder is that those terminals I opened earlier which have been not logged out still works. Only if I open up a new terminal and ssh to that machine, it is doing that.
The path printed out with the new terminal is exactly what I have in .bash_profile.
So I added what is missing to the bash_profile and it works now.
That reminds me that I was messing with the path thing as root earlier, but I don't remember deleting anything. I looked /etc/profile and couldn't find the path /opt/apbs/bin. Where else could it be?
/etc/profile 's content in different distributions is different, but I know that it sets the general program paths ( /usr/local/bin:/usr/bin:/bin:/usr/games ). For custom tweaks in the PATH environment I use ~/.bashrc and ~/.bash_profile.
The path /opt/apbs/bin is not a standard Linux path, so you can't expect to find it in the default bash settings. My advice is to always keep the PATH starting in the order /usr/local/bin:/usr/bin:/bin:/opt/bin:YOUR_PATHS_HERE, unless you know what you're doing. And by the way, if you want/need to tweak root's PATHs, use /root/.bash_profile and /root/.bashrc.
Hope this answers your question.
EDIT: Perhaps when you tweaked the PATH as root earlier, you erased the initial content by using
Code:
PATH=/your/path/here
or
Code:
export PATH=/your/path/here
This will erase any content from $PATH and register only your path in it. To avoid this you can always use
Code:
export PATH=$PATH:/your/path/here
This will append your path to the existing value of $PATH.
/etc/profile 's content in different distributions is different, but I know that it sets the general program paths ( /usr/local/bin:/usr/bin:/bin:/usr/games ). For custom tweaks in the PATH environment I use ~/.bashrc and ~/.bash_profile.
The path /opt/apbs/bin is not a standard Linux path, so you can't expect to find it in the default bash settings. My advice is to always keep the PATH starting in the order /usr/local/bin:/usr/bin:/bin:/opt/bin:YOUR_PATHS_HERE, unless you know what you're doing. And by the way, if you want/need to tweak root's PATHs, use /root/.bash_profile and /root/.bashrc.
Hope this answers your question.
EDIT: Perhaps when you tweaked the PATH as root earlier, you erased the initial content by using
Code:
PATH=/your/path/here
or
Code:
export PATH=/your/path/here
This will erase any content from $PATH and register only your path in it. To avoid this you can always use
Code:
export PATH=$PATH:/your/path/here
This will append your path to the existing value of $PATH.
You are absolutely right, that was exactly what I did.
So in case this happens again and I do not have any old terminals open, what should I do to fix it?
to load the default bash settings or you could use
Code:
export PATH=/usr/local/bin:/usr/bin:/bin:$PATH
to add the essential programs to your PATH. By the way, even if the standard programs are not in your path, you can still invoke them with the full path to the program, for example you can use /bin/ls ( or /usr/bin/ls depending on your distro ) to invoke the ls command even if /bin ( or /usr/bin ) is not in your PATH.
to load the default bash settings or you could use
Code:
export PATH=/usr/local/bin:/usr/bin:/bin:$PATH
to add the essential programs to your PATH. By the way, even if the standard programs are not in your path, you can still invoke them with the full path to the program, for example you can use /bin/ls ( or /usr/bin/ls depending on your distro ) to invoke the ls command even if /bin ( or /usr/bin ) is not in your PATH.
I would advise possibly remembering that vi is usually easily locatable at "/bin/vi", then just pull up the file you edited to cause the problem in the first place.
Or whatever other editor you prefer using, nano I believe is at /usr/bin/nano if you prefer that... but it depends. /bin/vi is the best one to remember for emergency purposes.
Last edited by r3sistance; 02-16-2010 at 08:11 PM.
I would advise possibly remembering that vi is usually easily locatable at "/bin/vi", then just pull up the file you edited to cause the problem in the first place.
Or whatever other editor you prefer using, nano I believe is at /usr/bin/nano if you prefer that... but it depends. /bin/vi is the best one to remember for emergency purposes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.