


Use the rm command carefully. If you accidentally type the wrong one, your efforts for several days will be wasted.
rm-rf use with caution
There are too many commands to type on the Linux virtual host. If you often walk on the beach, your shoes will inevitably get wet
Tomorrow, I made a mistake and typed the wrong command, and lost the folder I originally wanted to keep to rm-rf
All the hard work of the past few days has been lost. Damn it, I feel like dying.
After trying Baidu, Google and other methods to no avail, hey, let’s study how to retrieve it later
Some lessons:
1.rm, especially before rm-rf, be careful, think twice, or rewrite the command directly
2. Make a good backupHow to recover files deleted from the Recycle Bin in Linux, there is a convenient backup script
3. Make scheduled backups. There is a master who can create a scheduled script and execute it by yourself every night. Even if you delete it by mistake, you won’t be so frustrated.
First of allHow to recover files deleted from the Recycle Bin in LinuxIs there a future for learning Linux and setting up a Recycle Bin
Add .bashrc or .bash_profile under ~
mkdir -p ~/.trash alias rm=trash alias r=trash alias rl='ls ~/.trash' alias ur=undelfile undelfile() { mv -i ~/.trash/$@ ./ } trash() { mv $@ ~/.trash/ }
This is execution
rm is equivalent to executing mv
Note: There is no rm-rf at this time
Deleted files will appear in .trash
can be restored
urfilename
This brings up a problem, how to delete things in the recycle bin, this is why rm is useless here
Continue to add functions under .bashrc just now
cleartrash() { read -p "clear sure?[n]" confirm [ $confirm == 'y' ] || [ $confirm == 'Y' ]&& /usr/bin/rm -rf ~/.trash/* }
$..bashrc
Afterwards, if you want to empty the Recycle Bin
$cleartrash will do
The backup script is working
Includes packaged and compressed fast backup scripts and midnight scheduled backup scripts
I haven’t learned how to delete and repair files under Linux yet, hey
Blood lessons, take precautions
The above is the detailed content of Use the rm command carefully. If you accidentally type the wrong one, your efforts for several days will be wasted.. For more information, please follow other related articles on the PHP Chinese website!

This article provides a comprehensive guide to identifying and resolving hard drive bottlenecks in Linux systems. Experienced server administrators will find this particularly useful. Slow disk operations can severely impact application performance,

Efficient QR code generation tool under Linux system In today's digital world, QR codes have become a way to quickly and conveniently share information, simplifying data access from URLs, texts, contacts, Wi-Fi credentials, and even payment information. Linux users can use a variety of tools to create QR codes efficiently. Let's take a look at some popular QR code generators that can be used directly on Linux systems. QRencode QRencode is a lightweight command line tool for generating QR codes on Linux. It is well-received for its simplicity and efficiency and is popular with Linux users who prefer direct methods. Using QRencode, you can use the URL,

Elementary OS 8 Circe: A Smooth and Stylish Linux Experience Elementary OS, a Ubuntu-based Linux distribution, has evolved from a simple theme pack into a fully-fledged, independent operating system. Known for its user-friendly interface, elegant de

Mastering Linux is crucial for any machine learning (ML) engineer. Its command-line interface offers unparalleled flexibility and control, streamlining workflows and boosting productivity. This article outlines essential Linux commands, explained fo

Arch Linux: A Beginner's Command-Line Cheat Sheet Arch Linux offers unparalleled control but can feel daunting for newcomers. This cheat sheet provides essential commands to confidently manage your system. System Information & Updates These com

This guide provides a comprehensive walkthrough of installing and using the Scikit-learn machine learning library on Linux systems. Scikit-learn (sklearn) is a powerful, open-source Python library offering a wide array of tools for various machine l

This guide explains how to leverage Docker for accessing Kali Linux tools, a safer and more efficient alternative to outdated methods like Katoolin. Katoolin is no longer actively maintained and may cause compatibility problems on modern systems. Do

Linux service management is a must-have skill for Linux system administrators and users. A service is a process running in the background, providing various functions, such as a web server, a database, or a network service. This article will guide you on how to start, stop, and restart Linux services. Why start, stop or restart the service? Starting the Service: Services may be required to start after software is installed or when certain services are not automatically started when the system starts. Stop Service: Stop Service can free up system resources or prevent unwanted programs from running. Restart the service: If the service fails or after a configuration change is made, restarting is usually the fastest way to resolve the problem. Key commands for managing services In Linux, management services are the most common


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment
