Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to force emptying the Recycle Bin in ubuntu

Shulou Source: shulou.com Published: 2022-06-01 16:52:51 10月25日 Update

Ubuntu how to force emptying the Recycle Bin, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Mkdir directory name create a directory

Rmdir empty directory name delete an empty directory

Rm file name delete one or more files

Rm-rf non-empty directory name deletes everything under a non-empty directory

Touch filename create an empty file

Rename folder

Execution format: mv source destination

Example: mv file1 file2 changes the file file1 and changes the file name to file2. Mv file1 dir1 moves the file file1 to the directory dir1, and the file name is still file1. Mv dir1 dir2 if directory dir2 exists, move the directory dir1, and all its files and subdirectories, to the directory dir2, and the new directory name is dir1. If the directory dir2 does not exist, change dir1, and all its files and subdirectories, to the directory dir2.

The rename command is dedicated to file renaming, and as you can see from later examples, rename can rename files in batches as well as individual files. At the same time, it is worth noting that the rename command takes three parameters instead of two as many people think.

The above example shows the use of two kinds of file batch renaming, but in fact, rename in combination with wildcards is more powerful than the above example shows. The basic wildcards are as follows:

? Can replace a single character

* can replace multiple characters

[charset] can replace any single character in the charset set

The following is illustrated by examples:

If there are these files in the folder foo1,..., foo9, foo10,..., foo278, if you use the

Rename foo foo0 foo?

It will only rename foo1 to foo9 files to foo01 to foo09 because? Wildcards can only replace a single character, so the renamed file is only a file with a four-character name, and the foo in the file name is replaced with foo0.

And then continue to use

Rename foo foo0 foo??

Then all files from foo01 to foo99 in the folder are renamed foo001 to foo099, while foo100 and its subsequent file names remain the same because of the wildcard? , so only rename files with 5-character names, and the foo in the file name is replaced with foo0.

If you continue to use it

Rename foo foo0 foo*

Then all files from foo001 to foo278 are renamed foo0001 to foo0278, because the wildcard * replaces multiple characters, so all files that start with foo are renamed and the foo in the file name is replaced with foo0.

Let's look at the use of the wildcard [charset], or continue to execute the following command in the folder mentioned above.

Rename foo0 foo foo0 [2] *

All files from foo0200 to foo0278 are renamed foo200 to foo278, and the foo0 in the file name is replaced with foo.

In use, the three wildcards can be used together, and you can only constantly explore other specific uses.

Forced emptying of the Recycle Bin

Previous versions of ubuntu8.04

Sudo rm-fr $HOME/.Trash/*

Ubuntu 8.04

Sudo rm-fr $HOME/.local/share/Trash/files/*

Here is the usage of the touch command

-an only change the access time

-c,-- no-create does not create any files

-d,-- date= string is used to represent the time instead of the current time

-f (ignore)

-m only change the modification time

-r,-- the reference= file uses the specified time attribute instead of the current time

-t STAMP uses the [[CC] YY] MMDDhhmm [.ss] format instead of the current time

-- the time specified by time=WORD using WORD: access, atime, use are all equal to-a

The effect of the option, while the effect of the modify, mtime equal to-m option

-- help displays this help and leaves

-- version displays version information and leaves

Note that the-d and-t options accept different time / date formats.

After reading the above, have you mastered the method of how to force emptying the Recycle Bin in ubuntu? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: File time directory character file name wildcard example single command folder empty directory recycle bin mandatory multiple format information content parameter name subdirectory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Tech Info Shulou Technology NVidia vpn