在尝试在我的Mac OSX机器上安装某些东西的过程中,我想我已经破坏了我的〜/ .bash_profile文件。我编辑了它,突然,现在,当我打开终端时,我无法运行任何内容,甚至列出文件:
$ ls
-bash: ls: command not found
不好了!我尝试打开emacs来编辑〜/ .bash_profile,但我不能:
$ emacs ~/.bash_profile
-bash: emacs: command not found
$ port install emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Computing dependencies for emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Fetching emacs
---> Attempting to fetch emacs-23.2.tar.gz from http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Verifying checksum(s) for emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Extracting emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Configuring emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Building emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Staging emacs into destroot
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Installing emacs @23.2_1
Error: Target org.macports.install returned: MacPorts requires root privileges for this action
Error: Status 1 encountered during processing.
Before reporting a bug, first run the command again with the -d flag to get complete output.
我不能sudo,我不能改变Finder显示隐藏文件从那里打开它:
$ sudo port install emacs
-bash: sudo: command not found
$ defaults write com.apple.Finder AppleShowAllFiles YES
-bash: defaults: command not found
救命!如何打开〜/ .bash_profile来修复它?
我认为你对什么构成“灾难恢复”的看法可能与大多数人的情况有所不同......
—
skaffman 2010年
据我所知,您应该可以删除自己的问题。在问题的左下角,在答案之上但在标签下方,应该有一些像“edit | delete | flag”这样的链接。无论如何,我确信如果有必要,主持人或社区将负责关闭/删除此项。
—
大卫Z 2010年