从终端撤消对bashrc的更改 [英] undoing changes to bashrc from terminal

查看:98
本文介绍了从终端撤消对bashrc的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不幸的是,我只是用

echo "command" > ~/.bashrc

与通过

echo "command" >> ~/.bashrc.

这对我来说不是一个巨大的回扣,因为我刚在码头工作. 我很想知道,如果可以在重新启动终端会话之前恢复我的.bashrc

Not a huge throwback as I am newer to working in the terminal. HOWEVER I AM WONDERING if it is possible to recover my .bashrc before I restart my terminal session!

是否存在存储会话命令的位置?如果是这样-我该如何提取我的自定义脚本?

Is there a location where a session's commands are stored? If so - how can I extract my custom scripts?

期待最坏的消息,希望得到最好的消息!我正在运行Ubuntu 13.04盒,并且该会话位于Guake Terminal中-如果这完全改变了事情.

Expecting for the worst of news, hoping for the best of news! I'm running an Ubuntu 13.04 box and the session is in Guake Terminal - if that changes things at all.

推荐答案

您无法完全恢复.但是您可以使用set部分恢复.

You can't completely recover. But you can partially recover using set.

如果您在同一终端上运行set,则将能够获取自定义脚本和其他环境变量集的完整列表.在这种情况下,可以区分.bashrc的一部分和该终端上键入的其他部分.但是您将无法恢复以前作为bash登录的一部分执行的命令.

If you run set on the same terminal you'll be able to get a whole list of custom scripts and other environment variables set. And in that, it's upto to differentiate the ones that were part of .bashrc and others typed on that terminal. But you won't be able to recover the commands which used to be executed as part of bash login.

这篇关于从终端撤消对bashrc的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆