¿Qué sucede si su archivo chmod de Unix /Linux se cancela con el atributo x?

  
 

Si un día su comando comd en un sistema Unix /Linux hace que alguien elimine el atributo x (atributo de ejecución), ¿cómo lo recupera?

Las siguientes son algunas respuestas:

1) Reinstalar. Para sistemas Debian: 1 sudo apt-get install – reinstalar coreutils

2) Use chmod a nivel de idioma. Perl: perl-e ‘ chmod 0755, " /bin /chmod " ‘ Python: python -c " import os; os.chmod (‘ /bin /chmod ’, 0755) " (" fs "). chmodSync (" /bin /chmod ", 0755); Programa C: 123456 #include #includevoid main () {chmod (" /bin /chmod ". 00007555); p> 3) Usa un archivo ejecutable existente. 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) Utilice el comando tar de GNU 12 $ tar – mode 0755 -cf chmod.tar /bin /chmod $ tar xvf chmod.tar1 tar – modo 755 -cvf – chmod

Copyright © Conocimiento de Windows All Rights Reserved