file or directory already exists -V: Display procedureExample:#cp-I file1 file2//interactively copy the file file1 to a file file2#cp-F file1 file2//Copy the file File1 to File2 because the destination file already exists, so specify to useMode of forced replicationMV, move command: Move files or rename files, often used to back up files or directoriesGrammar: MV [OPTION] ... [-T] SOURCE DESTMV [OPTION] ... SOURCE ... DIRECTORYMV [OPTION] ...-t DIRECTORY SOURCE ...Common parameter options:-I: I
1. Command format:RM [ options ] file ...2. Command function:Delete one or more files or directories in a directory, and RM does not delete the directory if the-r option is not used. If you use RM to delete a file, you can usually still restore the file to its original state. 3. Command parameters explained in detail:-F,--force ignores nonexistent files and never gives hints.-I,--interactive for interact
Statement writing: Find corresponding directory-mtime + days-name "filename"-exec rm-rf {} \;
Example 1: The/usr/local/backups directory is all 10 days ago with "." The file deletion
Find/usr/local/backups-mtime +10-name "*.*"-exec rm-rf {} \;
Find:linux Lookup command, the user finds the file for the specified condition
/usr/local/backups: Any directory that you want to clean
-mtime: The standard sent
Statement writing: Find corresponding directory-mtime + days-name "filename"-exec rm-rf {} \;
Example 1: The/usr/local/backups directory is all 10 days ago with "." The file deletion
Find/usr/local/backups-mtime +10-name "*.*"-exec rm-rf {} \;
Find:linux Lookup command, the user finds the file for the specified condition
/usr/local/backups: Any directory that you want to clean
-mtime: The standard se
touch new file touch filename such as:touchfile1 New file named File1 in the current directory Note: 1) The same directory cannot create a file with the same name 2) the file name of Linux is case-sensitive mv Modify the file name (or the name of the directory), move the path mv old file name new file name ======= Modify the file name mv old directory name New directory name ======= "Modify directory name mv file name directory name ======= "Move path cp (copy abbreviation) Copy file (dir
Town Yard text:The Confucian School of the practical and practical, line Buddhism Purdue sentient beings, the monastic Kangsheng fidelity, understanding of the easy to change the image. To science and technology to shine a good law, the achievement of a conscience blog.______________________________________________________________________________________________________My system: Ubuntukylin 16.04 LTS 64bitCode1 Viewing the current folder2 delete the specified file3 Viewing folders after deletin
=never not display color (always display color, Auto automatically judge)LS--full-time output in full time mode(2) Copy, delete and move (CP,RM,MV)Cp-a/var/log/wtmp wtmp_test Copy all of the file's features pastCp/var/log/wtmp. Copy to current directoryCp-i if the target file exists, the overwrite asks for the actionCp-p is copied along with the file attributesReplication of the Cp-r directorycp-d If the source file is a property of a connection file,
replicate directories and all content inside them-A: Archive, equivalent to-DR--preserv=all (that is, preserve the attributes of the source file or directory, including the owner, the owning group, the permissions and the time)-D:--no-dereference--preserv=links (if the original file is a link, keep the original link format)--preserv=[attr_list] (reserved property)Mode: PermissionsOwnership: Belong to the main groupTimestamp: Time stampLinks: LinkXATTR: Special AttributesContext: ContextsAll: Al
1. Use the root user to create the/usr/local directory. rmov.sh#!/bin/shpara_cnt=$#Trash_dir= "/data01/.trash"For i in $*; Doif [$i = = "-rf"-o $i = = "-r"-O $i = = "F"]Then:Elsestamp= ' Date +%s 'Filename= ' basename $i 'MV $i $TRASH _dir/$fileName. $STAMPFiDone2, check the disk which space capacity is large, I am currently using the/DATA01 directory, in this directory created. Trash Directory3. Add aliases alias rm= "Sh/usr/local/.rmov.sh" in the/et
effect, and you'll find the file has been copied. On the second machine.Go to the. SSH directory to delete the previously generated Id_rsa otherwise the problem is using the command RM-RF./id_rsa* The above deletion may still cause problems, the best solution is to remove all, and then re-copy the public key from node oneUse the command in the. SSH directory: RM-RF./* Switch
Original address: http://blog.chinaunix.net/space.php? Uid = 7450016 Do = Blog cuid = 334050
Frequently used:Function: delete a file or directory;Rm-r directory (including its subdirectories)
Rm command details:
Function Description: delete a file or directory.
Syntax: Rm [-dfirv] [-- help] [-- version] [file or directory...]
Note: Execute the
If you are not good at writing, you may not be clear about the original meaning in some places. If you make a mistake, correct it.
In Linux, there are several common commands: cp --> copy, mv --> move/move, rm --> delete/remove.
Although we often use them, do we have a deeper understanding of these commands.
Let's take a look:
Impact of cp on inode:
1. When the replication happens, the system finds an empty inode number and writes the data to the inod
1. mv
1) mV-move (rename) files
MV [Option] source dest
MV [Option]... source... directory
Rename source to DEST, or move source (s) to directory.
2) Options
①-F, do not prompt before Overwriting
②-I, prompt before Overwrite
③-N, -- no-clobber do not overwrite an existing file
If you specify more than one of-I,-F,-N, only the final one takes effect.
④-U, -- Update move only when the source file is newer than the destination file or when the destination file is missing
⑤-V, --
Commands for copying, moving, and deleting files in Linux are CP, MV, and RM.
I. file copy command CP command format:
CP [-adfilprsu] source file (source) Destination File (destination) CP [Option] source1 source2 soure3... directory
Parameter description:
-A: Refers to archive, or copying all directories.
-D: if the source file is a link file, copy the properties of the connection file instead of the file itself.
-F: force. If you have repeated or ot
and target command execution results, can refer to the CP command, will not repeat. Similarly, the MV command has some command options:-F,--Force: If the target file already exists, it will not be queried and overwritten directly650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/85/2A/wKiom1ebTLDRivOHAAAXqZScv7E850.png "title=" Capture 5. PNG "alt=" Wkiom1ebtldrivohaaaxqzscv7e850.png "/>-I,--Interactive: If the destination file (destination) already exists, you will be asked to overwrit
backup.-F or--force if the destination file or directory is duplicated with an existing file or directory, overwrite the existing file or directory directly.-I or--interactive to ask the user before overwriting.-s--suffix=-U or--update does not overwrite the destination file when it moves or changes the file name, if the destination file already exists and its file date is newer than the source file.-V or--verbose displays detailed information when executed.-v=The--version-control=--help displa
Tag: CP RM MV1. cp and inode when the file does not exist, assign a new inode number and create a new file;When a file exists, the inode number takes the inode number of the target file before it is overwritten650) this.width=650; "src=" Http://www.178linux.com/wp-content/uploads/2017/07/20170721201255_45558.png "style=" font-family: ' Song body ', simsun;font-size:20px;height:auto;vertical-align:middle;border:0px; "/> 2.
Rm:remove files or directories: Deleting a file or directoryRM option:-F:--force:ignore nonexistent files, never prompt: Ignore nonexistent files, do not prompt-i:prompt before every removal: prompt on each deletion, the default RM is rm-i in the environment variable, the alias is not present when RM is used in the Task Scheduler's script-R,-R,--recursive:remove
Objective
This article mainly learn Hadoop HDFs from HDFs move to local, move from local to Hdfs,tail view last, rm delete file, expunge empty trash,chown change owner, setrep change file copy number, CHGRP change belong group,, Du, DF Disk Footprint
Movefromlocal
Copy a local file to HDFs, and when successful, delete the local fileInstruction usage
Movefromlocal
Example
HDFs Dfs-movefromlocal/home/dataflair/desktop/sample/user/dataflair/dir1Movetol
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.