If myfiles is a directory: all files with the extension.Here, * is a wildcard meaning "any number, including zero, of any character." If myfiles does not exist, My file.txt is renamed myfiles.If myfiles a file, My file.txt is renamed myfiles, and the original myfiles is overwritten.If myfiles a directory, My file.txt is moved into myfiles.Here, the spaces in the file name are escaped, protecting them from being interpreted as part of the command. Rename the file " My file.txt" to " My file 2.txt". If file2 exists and is a file, a prompt is given: mv: overwrite 'file2'?Įntering "y", "yes", "Yes", or "Y" results in the file being overwritten. If file2 exists and is a file, it is overwritten. If file2 exists and is a file, nothing happens. If file2 does not exist, file is renamed file2. If file2 exists and is a directory, file is moved into it. Move the files myfile1 and myfile2 to the directory myfiles. Move the file myfile.txt to the parent directory of the current directory. If myfiles2 does not exist, the file or directory myfiles is renamed myfiles2. If myfiles is a file or directory, and myfiles2 is a directory, move myfiles into myfiles2. If the file is marked as read-only, but you own the file, you are prompted before overwriting it. Move the file myfile.txt into the directory myfiles. Numbered if numbered backups already exist, simple otherwise. Never make backups, even if the -backup option is given. The version control method may be specified with the -backup option, or by setting the environment variable, VERSION_CONTROL. For example, file.txt would be backed up as file.txt.~1~, then file.txt.~2~, etc.Īdditional rules for creating backup files are available, called version control methods.
0 Comments
Leave a Reply. |