How do I delete files and folders under Linux? In fact, most users of the Linux system are accustomed to using commands to perform various operations. The command to delete files and folder directories is rm.
Users can delete unwanted files with the rm command. The function of this command is to delete one or more files or directories in a directory. It can also delete a directory and all files and subdirectories under it. For linked files, just the link is broken and the original file remains unchanged.
The general form of the rm command is:
rm [options] File …
If the -r option is not used, rm does not delete the directory.
The options for this command have the following meanings:
- f Ignore files that do not exist and never give a prompt.
- r Instructs rm to recursively delete all directories and subdirectories listed in the parameter.
- i Perform an interactive delete.
Be careful with the rm command. Because once the file is deleted, it cannot be recovered. To prevent this from happening, you can use the i option to confirm the files you want to delete one by one. If the user enters y, the file will be deleted. If you enter anything else, the file will not be deleted.
Be careful when using rm -rf to delete files. Linux does not have a recycle bin.
Direct rm is fine, but add a parameter -f ie: rm -f file path
-f is to forcefully delete, do not make any hints
Delete file usage example:
rm -f /var/log/httpd/access.log
will force the deletion of /var/log/httpd/access.log file
Delete directory use instance:
rm -rf /var/log/httpd/access
will delete the /var/log/httpd/access directory and all files and folders under it
Need to be reminded: Be careful when using this rm -rf, Linux does not have a recycle bin
Of course, rm has more other parameters and usage, man rm Can view
First look at the TCP server side of the program: #include <stdlib.h> #include <stdio.h>
RedHat Linux provides firewall protection for increased system security. A firewall exists between y
Controlling access to files under Linux is a very important issue. Chmod is a method for modifying f
To open a previously compiled normal project (created with IAR5.5), the following error is reported
Detailed linux command: disk check repair command e2fsck
Yum installation error: Error: database disk image is malformed Solution
Keeping your system secure Avoiding common Linux management errors
How to use USB storage in a Linux environment
Clean up memory and Cache method under Linux /proc/sys/vm/drop
RHEL5.5 install GCC compiler environment tutorial
Hard disk installation under Win7 Red Hat Enterprise Linux 6.0 ES method
Linux disk larger than 2T using GPT partition method
Analysis of the lower part of the Linux 2.6 interrupt
Compression and decompression methods for common compression formats under Linux
Win8 app store offline can not enter the application how to solve?
How to install Win7 under PE and Status: 0xc000000f solution
Win8 system login also teaches you to create picture password
Win8.1 Update Tips: Cancel the OneDrive Synchronization Service Strategy
How to bridge the Win7 system wireless router
How to use iTunes? iTunes detailed tutorial
What should I do if the WinXP system U disk file is garbled?
How does the WinXP system run the Chkdsk command? Method of running Chkdsk command
How to use the u disk to install win7 u disk installed win7 system graphic tutorial