Lost PATH variable content
I was trying to add something to the PATH with :
export PATH=/user/home/sbt/bin
but I removed all of the content of PATH and I can not run any command on the terminal even ls ! So what should I do ? Can I fix it ?
command-line environment-variables scripts
add a comment |
I was trying to add something to the PATH with :
export PATH=/user/home/sbt/bin
but I removed all of the content of PATH and I can not run any command on the terminal even ls ! So what should I do ? Can I fix it ?
command-line environment-variables scripts
Have you tried withsudo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games? This will only work for the actual session.
– Lucio
Mar 25 '13 at 18:54
Thank you @Lucio it helped me, but is there any way to undo to the old content ?
– myildirim
Mar 25 '13 at 18:56
Did the method of the answer below worked for you?
– Lucio
Mar 25 '13 at 19:09
Also, to know what paths do you have, entercat /etc/environmentin a terminal.
– Lucio
Mar 25 '13 at 20:29
@Lucio, after log out and log in the below worked for me
– myildirim
Mar 25 '13 at 22:45
add a comment |
I was trying to add something to the PATH with :
export PATH=/user/home/sbt/bin
but I removed all of the content of PATH and I can not run any command on the terminal even ls ! So what should I do ? Can I fix it ?
command-line environment-variables scripts
I was trying to add something to the PATH with :
export PATH=/user/home/sbt/bin
but I removed all of the content of PATH and I can not run any command on the terminal even ls ! So what should I do ? Can I fix it ?
command-line environment-variables scripts
command-line environment-variables scripts
asked Mar 25 '13 at 18:42
myildirimmyildirim
161112
161112
Have you tried withsudo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games? This will only work for the actual session.
– Lucio
Mar 25 '13 at 18:54
Thank you @Lucio it helped me, but is there any way to undo to the old content ?
– myildirim
Mar 25 '13 at 18:56
Did the method of the answer below worked for you?
– Lucio
Mar 25 '13 at 19:09
Also, to know what paths do you have, entercat /etc/environmentin a terminal.
– Lucio
Mar 25 '13 at 20:29
@Lucio, after log out and log in the below worked for me
– myildirim
Mar 25 '13 at 22:45
add a comment |
Have you tried withsudo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games? This will only work for the actual session.
– Lucio
Mar 25 '13 at 18:54
Thank you @Lucio it helped me, but is there any way to undo to the old content ?
– myildirim
Mar 25 '13 at 18:56
Did the method of the answer below worked for you?
– Lucio
Mar 25 '13 at 19:09
Also, to know what paths do you have, entercat /etc/environmentin a terminal.
– Lucio
Mar 25 '13 at 20:29
@Lucio, after log out and log in the below worked for me
– myildirim
Mar 25 '13 at 22:45
Have you tried with
sudo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games? This will only work for the actual session.– Lucio
Mar 25 '13 at 18:54
Have you tried with
sudo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games? This will only work for the actual session.– Lucio
Mar 25 '13 at 18:54
Thank you @Lucio it helped me, but is there any way to undo to the old content ?
– myildirim
Mar 25 '13 at 18:56
Thank you @Lucio it helped me, but is there any way to undo to the old content ?
– myildirim
Mar 25 '13 at 18:56
Did the method of the answer below worked for you?
– Lucio
Mar 25 '13 at 19:09
Did the method of the answer below worked for you?
– Lucio
Mar 25 '13 at 19:09
Also, to know what paths do you have, enter
cat /etc/environment in a terminal.– Lucio
Mar 25 '13 at 20:29
Also, to know what paths do you have, enter
cat /etc/environment in a terminal.– Lucio
Mar 25 '13 at 20:29
@Lucio, after log out and log in the below worked for me
– myildirim
Mar 25 '13 at 22:45
@Lucio, after log out and log in the below worked for me
– myildirim
Mar 25 '13 at 22:45
add a comment |
2 Answers
2
active
oldest
votes
Close the terminal app, and open a new one. The variable will be reset to its original state then.
If you're on a virtual terminal, and not running gnome-terminal or similar under X11, then you can log out and log back in again, to reset the variables. You can type exit to log out, or press Ctrl+D.
add a comment |
In case, the answer by dobey doesn't work for you.
Follow these steps to recover the PATH environment variable :
- Delete the culprit file from /etc/profile.d/ (if any)
- Delete the culprit line from /etc/profile or ~/.bashrc (if any)
- Execute
source /etc/environmentto start reseting the path environment variable - Execute
source /etc/profilefollowed bysource /etc/profile.d/*
- At last
source ~/.bashrc
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f272372%2flost-path-variable-content%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Close the terminal app, and open a new one. The variable will be reset to its original state then.
If you're on a virtual terminal, and not running gnome-terminal or similar under X11, then you can log out and log back in again, to reset the variables. You can type exit to log out, or press Ctrl+D.
add a comment |
Close the terminal app, and open a new one. The variable will be reset to its original state then.
If you're on a virtual terminal, and not running gnome-terminal or similar under X11, then you can log out and log back in again, to reset the variables. You can type exit to log out, or press Ctrl+D.
add a comment |
Close the terminal app, and open a new one. The variable will be reset to its original state then.
If you're on a virtual terminal, and not running gnome-terminal or similar under X11, then you can log out and log back in again, to reset the variables. You can type exit to log out, or press Ctrl+D.
Close the terminal app, and open a new one. The variable will be reset to its original state then.
If you're on a virtual terminal, and not running gnome-terminal or similar under X11, then you can log out and log back in again, to reset the variables. You can type exit to log out, or press Ctrl+D.
answered Mar 25 '13 at 18:57
dobeydobey
33k33886
33k33886
add a comment |
add a comment |
In case, the answer by dobey doesn't work for you.
Follow these steps to recover the PATH environment variable :
- Delete the culprit file from /etc/profile.d/ (if any)
- Delete the culprit line from /etc/profile or ~/.bashrc (if any)
- Execute
source /etc/environmentto start reseting the path environment variable - Execute
source /etc/profilefollowed bysource /etc/profile.d/*
- At last
source ~/.bashrc
add a comment |
In case, the answer by dobey doesn't work for you.
Follow these steps to recover the PATH environment variable :
- Delete the culprit file from /etc/profile.d/ (if any)
- Delete the culprit line from /etc/profile or ~/.bashrc (if any)
- Execute
source /etc/environmentto start reseting the path environment variable - Execute
source /etc/profilefollowed bysource /etc/profile.d/*
- At last
source ~/.bashrc
add a comment |
In case, the answer by dobey doesn't work for you.
Follow these steps to recover the PATH environment variable :
- Delete the culprit file from /etc/profile.d/ (if any)
- Delete the culprit line from /etc/profile or ~/.bashrc (if any)
- Execute
source /etc/environmentto start reseting the path environment variable - Execute
source /etc/profilefollowed bysource /etc/profile.d/*
- At last
source ~/.bashrc
In case, the answer by dobey doesn't work for you.
Follow these steps to recover the PATH environment variable :
- Delete the culprit file from /etc/profile.d/ (if any)
- Delete the culprit line from /etc/profile or ~/.bashrc (if any)
- Execute
source /etc/environmentto start reseting the path environment variable - Execute
source /etc/profilefollowed bysource /etc/profile.d/*
- At last
source ~/.bashrc
answered Feb 28 at 9:32
Prashant Shahi - coolboi567Prashant Shahi - coolboi567
314
314
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f272372%2flost-path-variable-content%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you tried with
sudo PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games? This will only work for the actual session.– Lucio
Mar 25 '13 at 18:54
Thank you @Lucio it helped me, but is there any way to undo to the old content ?
– myildirim
Mar 25 '13 at 18:56
Did the method of the answer below worked for you?
– Lucio
Mar 25 '13 at 19:09
Also, to know what paths do you have, enter
cat /etc/environmentin a terminal.– Lucio
Mar 25 '13 at 20:29
@Lucio, after log out and log in the below worked for me
– myildirim
Mar 25 '13 at 22:45