バックアップされた構成ファイルに復元する方法がわかりません

バックアップされた構成ファイルに復元する方法がわかりません

デフォルトでは、TTYにログインするとすぐに実行されたファイル/etc/profile(または記憶がうまくいかない)のバックアップコピーが作成され、そこからファイルが変更され、ログインすると自動的にログアウトされます。~/.profile

現在ファイルを表示してスクリプトを変更する必要がありますが、アクセスできる方法が見つかりません。

Ubuntu Live CDを試しましたが、ドライブをローカルにインストールした後にライセンスを取得する方法がわかりません。

Grubをインストールしましたが、メニューからデフォルトオプション以外のすべてのオプションを削除しました。

編集:また、関連がある場合、私のディスクは.vhdvirtualboxを介してアクセスしたいディスクです。

ベストアンサー1

他のシェルの使用

次のように別のシェルを実行してみることができます。

$ ssh -t remoteserver '/bin/csh'

中に入ると、目的のファイルを移動し、完了したら終了できます。

シェルがない場合は、csh別のシェルを試してみることもできます。

  • /bin/ksh
  • /bin/zsh
  • /bin/tcsh

bashに初期化ファイルを無視するように指示する

上記と同じトリックを使用することもできますが、代わりに呼び出してファイルのbash読み取りを無視するように指示するか、 。profilebashrc

$ ssh -t remoteserver '/bin/bash --noprofile'

または

$ ssh -t remoteserver '/bin/bash --norc'

から抜粋バッシュのマニュアルページ

--noprofile
          Do not read either the system-wide startup file /etc/profile or any 
          of the personal  initialization  files  ~/.bash_profile,
          ~/.bash_login,  or  ~/.profile.   By  default,  bash  reads  these 
          files when it is invoked as a login shell (see INVOCATION
          below).

--norc    Do not read and execute the personal initialization file ~/.bashrc 
          if the shell  is  interactive.   This  option  is  on  by default
          if the shell is invoked as sh.

おすすめ記事