Copy the file and Its subdirectories: the new path of the CP-r folder
Generally, the RM file name is used to delete a file.
To delete a folder, use the rmdir folder name.
But rmdir cannot delete non-empty folders. How to delete non-empty folders:
Command: Rm-RF non-empty folder name (it is recommended that you back up the folder before using it, as if this command will not be placed in the recycle bin, and you will no longer see the following files after you delete it ).
Rename a folder:
MV oldfilename newfilename
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 -- delete everything in a non-empty directory
Touch file name -- create an empty file
Rename a file (folder)/Move file (folder) to the specified folder echweb-Technical Community 5]. O "? 8 h. I
Execution format: mV source destination
Example:
MV file1 file2 indicates file1, and the file name is changed to file2. MV file1 dir1 moves the file file1 to the directory dir1, and the file name is still file1. MV dir1 dir2 if the directory dir2 exists, move the directory dir1 and all its files and subdirectories to the directory dir2 with the new directory name dir1. If the directory dir2 does not exist, change dir1 and all its files and subdirectories to the directory dir2.
The RENAME command is used to rename a file. As shown in the following example, rename can be used to rename a single file in batches. At the same time, it is worth noting that the RENAME command contains three parameters instead of the two parameters that many people think.
In the above example, the use of batch Rename for two types of files is given. In fact, rename is used in combination with wildcards, and its function is more powerful than that shown in the above example. Basic wildcards include the following:
? Can replace a single character
* Replace multiple characters
[Charset] can replace any single character in the charset set
The following is an example:
If the folder contains these files foo1,..., foo9, foo10,..., foo278
Rename Foo foo0 Foo?
Then it will only rename the foo1 to foo9 file to foo01 to foo09, because? The wildcard character can only replace a single character. Therefore, the renamed file contains only four characters in length, and foo in the file name is replaced with foo0.
Continue to use
Rename Foo foo0 Foo ??
In this case, all the files from foo01 to foo99 in the folder are renamed to foo001 to foo099, while the names of foo100 and later files remain unchanged because of wildcards? So only the file with a length of five characters is renamed, And the foo in the file name is replaced with foo0.
If you continue to use
Rename Foo foo0 Foo *
All files from foo001 to foo278 are renamed to foo0001 to foo0278. Because wildcard * can replace multiple characters, all files starting with Foo are renamed, replace Foo with foo0 in the file name.
Let's take a look at the usage 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 the foo0 in the file name is replaced with Foo.
In use, the three wildcards can be used together. For other specific usage, you only need to constantly explore them.
Forcibly clear the recycle bin
Versions earlier than ubuntu8.04
Sudo Rm-fr $ home/. Trash /*
Ubuntu 8.04 and later
Sudo Rm-fr $ home/. Local/share/trash/files /*
The following is how to use the touch command:
-A: only change the access time
-C, -- no-create does not create any files
-D, -- date = string uses <string> to indicate the time rather than the current time
-F (ignore)
-M: only change the modification time
-R, -- reference = the file uses the specified <File> time attribute instead of the current time.
-T stamp uses the [[CC] YY] mmddhhmm [. SS] format instead of the current time
-- Time = the time specified by word: Access, atime, and use are both equal to-.
But modify and mtime are equal to-M.
-- Help: displays the help information and leaves
-- Version: displays the version information and leaves.
Note that the-D and-T options can be in different time/date formats.