Linux File/Folder creation/copy/delete/clipping __linux
Source: Internet
Author: User
1, create Files/folders: (1) Folder: Format: mkdir [Options] dirname (2) file: 1) format: VI [FileName] dir (new file, will open the created file, at this time can be text input) 2) format: Touch [fil Ename] Dir (not open after new file, need to use VIM command)
Note: If you create a file in the current directory, dir does not need to type
2. Copy files/folders: format: CP [-ADFILPRSU] source file (origin) destination file (destination) CP [-adfilprsu] Source1 source2 source3 ... d Irectory
Note: [-adfilprsu]-A: Refers to the meaning of archive, also means to copy all directories-D: If the source file is a connection file, then copy the connection file properties instead of the file itself-F: Force (Force), and if there are duplicates or other questions, do not ask the user, and forced copy-I: If the target file (destination) already exists, the overwrite will ask if the action is true-L: Establish a connection file for a hard connection (hard link) instead of copying the file itself-P: Copy with the properties of the file instead of using the default properties-r: Recursive replication, Copy operation for directory-S: Copy to the symbolic connection file (symbolic link), that is, the shortcut file-u: If the target file is older than the source file, update the target file instance: 1, run cp:2 at the same time without any parameters, copy multiple files: 3 Copy a directory:
3. Move/Cut File/folder: Format: MV [-FIU] Source (source file) destination (destination file)
Note: [-FIV]-f:force, Force direct movement without questioning-I: If the target file (destination) already exists, it asks if the overwrite-u:uodate, if the target file already exists and the source file is newer, will update
Example: 1 file: chelsea@ubuntu:~/desktop$ mv Text.txt Test Move/2) folder: chelsea@ubuntu:~/desktop$ MV Test Move/. /downloads/
4, delete files/folders: Format: RM [fir] File/dir
Note: [Fir]-f: Force Delete-I: interactive mode, ask the user whether to operate before delete-r: Recursive deletion, commonly used in directory deletion
Example: 1 file: chelsea@ubuntu:~/downloads/Test move $ ls text.txt chelsea@ubuntu:~/downloads/Test Move $ rm text.txt chelsea@ubuntu:~/ downloads/Test Move $ ls 2) folder: chelsea@ubuntu:~/downloads$ rm-r Test Move/
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.