Ubuntu Force empty Recycle Bin Create, delete files and folders method

Source: Internet
Author: User
Tags continue current time touch touch command

mkdir directory name to create a directory

RmDir Empty directory name Delete an empty directory

RM FileName File name Delete one file or multiple files

RM–RF non-empty directory name deletes everything under a non-empty directory

Touch filename Create an empty file

Renaming folders

Execution format: MV source destination

EXAMPLE:MV file1 file2 The file file1, changing the file name to File2. MV File1 dir1 The file file1, moved to the directory dir1, the filename is still file1. MV Dir1 DIR2 If the directory Dir2 exists, the directory Dir1, and all of its files and subdirectories, are moved to the directory Dir2, and the new directory name is Dir1. If the directory Dir2 does not exist, the Dir1, and all its files and subdirectories, are changed to the directory Dir2.

The Rename command is dedicated to file renaming, and the following example shows that rename can also rename a batch file in addition to renaming a single file. At the same time, it is worth noting that the Rename command is a 2 parameter with 3 parameters rather than many people think.

In the example above, the use of the two file batch renames is given, and in fact, the rename is more powerful than the example above, when used in combination with wildcard characters. The basic wildcard characters are as follows:

? Can replace a single character

* Can replace multiple characters

[CharSet] can override any single character in the CharSet set

The following examples illustrate:

If you have these files in the folder Foo1, ..., foo9, Foo10, ..., foo278, if you use

Rename foo foo0 foo?

It will only rename files foo1 to foo9 to Foo01 to foo09, because the wildcard character can only substitute for single characters, so the renamed file is only a file with a 4-character-length name, and Foo in the filename is replaced with foo0.

and continue to use

Rename foo foo0 foo??

All files in the folder that are foo01 to Foo99 are renamed to foo001 to foo099, and foo100 and subsequent filenames are unchanged because of the use of wildcard characters, so only files with 5 character-length names are renamed, and Foo in the file name is replaced with Foo0.

If you continue to use

Rename Foo foo0 foo*

All files foo001 to foo278 are renamed to foo0001 to foo0278 because the wildcard * replaces multiple characters, so all files beginning with Foo are renamed and Foo in the filename is replaced with foo0.

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

Rename Foo0 foo foo0[2]*

All files from foo0200 to foo0278 are renamed to Foo200 to foo278, and foo0 in the filename is replaced with Foo.

In use, three wildcard characters can be combined to use, on the specific other use of the only oneself constantly groping.

Force empty 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 touch command usage

-A Change access time only

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

-D,--date= string uses < string > indicates time instead of current time

-F (ignored)

-M change modification time only

-R, the--reference= file uses the time attribute of the specified < file > instead of the current time

-T STAMP use [[CC]YY]MMDDHHMM[.SS] format time instead of the current time

--time=word time specified with WORD: Access, atime, use are equal to-a

Effects of options, while modify, Mtime equals-M options

--HELP Display this help information and leave

--version display version information and leave

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

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.