A space-induced tragedy (how to understand the cold joke of the miserable technical staff)

Source: Internet
Author: User

 

Introduce some interesting things in the programmer field to non-programmers (my logs will take care of non-programmers as much as possible in the future ).
This is the case. Let's take a look at the background. github.com is currently the most popular source code hosting website and the programmer community. It is free to use it to host and release shared open source software. Programmers (or companies) from all over the world like to publish their own project source code on this website. They can also easily obtain, view, and comment on others' source code here.
When the code is updated, you can also comment on a line modified in a file updated this time, that is to say, another enthusiastic classmate asks "What does this change mean?" And explains this to him.
But to be honest, I still haven't used it, I haven't noticed anyone who will use it, or I haven't tried to find such a comment on a line of code ...... This file may be the most powerful code comment post in GitHub history.
The key lies in this line: Rm-RF/usr/lib/NVIDIA-current/Xorg
Rm indicates "Remove". In Linux, the command is used to delete files or directories and cannot be used directly in directories. You can add the R parameter to delete the entire directory, while the F parameter indicates force, that is, I can delete all the files that can be deleted without nonsense. Rm accepts the directory or file name separated by * Space.
Please pay attention to it. This line of code contains a space in the middle of/USR and/lib !! This means that after this line of code is run, your/usr directory will be deleted !!
What about the/usr directory? Can I eat it? In this case, we must first talk about the representation and organization of directories in Linux. In Linux, there is no drive letter such as drive C and drive D. There is only one root directory, which is indicated by the Backslash. A directory corresponds to a hard disk partition by means of mounting. A hard disk partition can be mounted to a directory. However, you must first have a partition mounted to the root directory, and then there is a folder under the root directory, if no partition is attached to these folders, the files in the folder are saved to the corresponding directory of the partition mounted to the root directory. If a folder is attached to a partition, it turns out that the files in this folder are invisible, and the files in the mounted partitions are displayed in this folder.
For example, to access the/A/B/C/d.txt file, the Linux operating system will first check whether/A/B/C/has attached a partition. If yes, search for the/d.txt file in this partition. If not, check whether/a/B/has a partition mounted. If yes, search for/C/d.txt in this partition, and so on, if the/A/B/C/d.txt file of the partition mounted to the root directory is not found, the error "file not found" is returned.
This is how the Linux File System Works. After learning about this, let's talk about the file organization method. Linux will distribute programs to different directories, such as binary executable files to/usr/bin, and the library files to be called by the executable files will be placed in the/usr/lib directory, some other resources (such as slice) are put under/usr/share, and the configuration file is put in the/etc or/home/username, that is, the user folder. The/home directory is similar to the C: \ Users directory in Windows 7, which stores user's personalized configuration and user's documents.
The/usr directory is usually used to store all installed applications in the system, including some system tools and programs installed by almost all users. Therefore, it is equivalent to C: \ WINDOWS + c: \ Program Files in windows. To be honest, if you delete these two folders, isn't it equivalent to deleting the Windows operating system, it is equivalent to formatting C: disk. The RM-RF/usr command is the same for Linux systems. Understand. This is not what it is.
Next, let's talk about how to run this line of code. This line of code is written to the install. Sh file. This is an installation script. The so-called script means that the commands in this file are all run in order, just as the actors read the script again.
As you can imagine, there is a bad luck. I just wanted to install the software, run the install. Sh installation script again, and delete my system folder ...... The culprit is the space in the center of/USR and/lib. If there is no such space, this installation script will delete the RM-RF/usr/lib/NVIDIA-current/Xorg file as intended, after spaces are added,/USR and/lib/NVIDIA-current/Xorg are deleted. In addition, this is clearly an operation performed by the user (you need to run the installation script yourself ). In addition, such installation scripts are usually run with sudo, because in general, the installer requires the permission of the system administrator (this permission is also required to delete/usr ), sudo is a thing that contains the soul of the system administrator. Adding sudo before a command is equivalent to running this command as a system administrator.
Now, firewall, anti-virus, and system protection software are all crying: the system administrator wants to delete it, and I cannot help it.
╮(╯▽╰)╭
Why? Why? Why? Do you want to do this for Shenma?


We need your
/Usr directory increase entropy to save the universe.

The author finally fixed the bug. The above link is the record of the file (that is, the space is removed and a version number is added, everyone expressed their reverence for this line of code and their pity for the author to delete this space. Of course, the humor of programmers is here.

Many people have used great, success, epic, fail and other words to indicate that the author's error is too great. It's amazing to see the level of ghosts and gods. Some users said that I didn't like the folder either. Some people also said, thanks to the author for letting me clear a lot of hard disk space that was originally tight ......
Some of the following figures are also interesting. The background has already been introduced. Let's take a look.
PS selects a few of your favorite ones: comments before correction:
I didn't like that folder anyway.
nice! I didn't like the operating system anyways!
This just removed a ton of sh*t from my computer. Thanks!  
Comments after correction:
Come on guys, THIS line is the most important!
2 PS the Linux operating system mentioned above. In fact, this article also applies to Unix systems.
3 Ps that comment page has seen a large number of porcelain divers and programmers ......
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.