If one day your comd command on a Unix/Linux system is removed by someone for the x attribute (execution attribute), how do you recover it?
The following are some answers:
1) Reinstall. For Debian systems: 1 sudo apt-get install –reinstall coreutils
2) Use language-level chmod. Perl:perl-e ‘chmod 0755, “/bin/chmod”‘Python:python -c “import os;os.chmod(‘/bin/chmod’, 0755)”Node.js:require (“fs”).chmodSync(“/bin/chmod”, 0755); C program: 123456 #include #includevoid main(){chmod(“/bin/chmod”, 0000755);}
3) Use an existing executable file. 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)Use the GNU tar command 12 $tar –mode 0755 -cf chmod.tar /bin /chmod$tar xvf chmod.tar1 tar –mode 755 -cvf – chmod |
Tar -xvf -
5)Use cpio (files 19 to 24 are file mode – http://4bxf.sl.pt)1234 echo chmod |
Cpio -o |
Perl -pe ‘s/^(.{21})…/${1}755/’ |
Cpio -i -u
6)Use hardcore1 alias chmod=’/lib/ld-2.11.1.so ./chmod’
7)Use Emacs
Ctrl+xb > * scratch*(set-file-modes “/bin/chmod” (string-to-number “0755″ 8)) Ctrl+j
Well, quite powerful, but Why not use the install command? 12 install -m 755 /bin/chmod /tmp/chmodmv /tmp/chmod /bin/chmod
You, how about your method?
xenserver XenCenter can bind the network card, support Active-Active and Active-Standby mode, but on
process represents a running instance of a program that is the smallest unit of allocated resources.
Requirement scenario Using the proxy server HAProxy to load balance Mysql is a common solution. To
Overview This article describes how to transfer files between a Linux host and a Windows host. Beca
Linux directory creation and deletion commands basics
Simple file exchange method for virtual machine and host under Linux
Linux (with CentOS as an example) Network configuration considerations
Linux Security: Step by Step Defense (2)
How to implement VM automatically with Xenserver host
Linux build SSH server basic tutorial
Linux operating system, Advanced Power Management
The principle of file deletion under linux
Centos view port usage and enable port command
8.1 The latest version of Build 9385 leaked screenshots
Win10 system how to set virtual memory is best
Win7 Ultimate system how to view the DirectX version, you need to install 9.0C?
Causes and solutions for Win7 splash screen
Let XP support multiple users to log in at the same time
Windows 8 will integrate next-generation anti-malware
Win10 can't open EXCEL "There is a problem when sending commands to the program". How to do
Win7 system computer connected to the U disk prompt "specified path does not exist" how to do