Windows system >> Windowsの知識 >  >> Linuxシステムチュートリアル >> Linuxチュートリアル >> あなたのUnix /Linuxのchmodファイルがx属性でキャンセルされたとしたら?

あなたのUnix /Linuxのchmodファイルがx属性でキャンセルされたとしたら?

  

ある日、Unix /Linuxシステム上のcomdコマンドがx属性(実行属性)のために誰かに削除された場合、どうすれば回復できますか?

以下がその答えです。

1)再インストールします。 Debianシステムの場合:1 sudo apt-get install - coreutilsを再インストールします。

2)言語レベルのchmodを使用します。 Perl:perl-e&chmod 0755、' /bin /chmod’ Python:python -c' import os; os.chmod(‘ /bin /chmod’、0755)Node.jsが必要です。 (< fs")。chmodSync(&bin /chmod< 0755); Cプログラム:123456 #include #includevoid main(){chmod(' /bin /chmod& 0000755)}} p> 3)既存の実行ファイルを使用してください。 1234567 $ cat–> chmod.cvoid main(){} ^ D

$ cc chmod.c $ cat /bin /chmod> a.out $。/a.out 0755 /bin /chmod123 $ cp true> new_chmod $ cat /bin /chmod> new_chmod $。/new_chmod 0755 /bin /chmod

4)GNU tarコマンドを使用します。12 $ tar– mode 0755 -cf chmod.tar /bin /chmod $ tar xvf chmod.tar1 tar–モード755 -cvf– chmod |  Tar -xvf -

5)cpioを使用します(19から24までのファイルはファイルモードです - http://4bxf.sl.pt)。 Cpio -o | Perl -pe‘ s /^(。{21})… /$ {1} 755 /’ | Cpio -i -u

6)hardcore1のエイリアスを使うchmod =’ /lib/ld-2.11.1.so ./chmod’

7)Emacsを使う

Ctrl + xb> * scratch *(ファイルモードの設定/bin /chmod'(文字列と数字の間の< 0755″ 8))Ctrl + j

非常に強力ですが、なぜinstallコマンドを使わないのですか? 12 install -m 755 /bin /chmod /tmp /chmodmv /tmp /chmod /bin /chmod

あなたの方法はどうですか。

Copyright © Windowsの知識 All Rights Reserved