Zettel 202109141140 : Helpful mv Command Options

The b flag creates a backup of the destination file.

The mv command creates a backup in the destination directory. This protects against overwrites.

$ ls
somefile.txt

$ mv -b somefile.txt /home/destination

$ ls /home/destination 
somefile.txt somefile.txt~

The file with the tilde (~) character is the backup. That is a copy of the file that the mv command would have overwritten.

Another helpful option is the u flag.

The update or u flag only overwrites a file if the source is newer than the destination file. This flag also has the i or interactive option built into it.

September 14, 2021 unlinked cli


Previous post
Zettel 202109122305 : Passwordless SSH Key setup for RedHat/CentOS Running these commands will set up passwordless SSH between two servers. You do this by generating a public and private key pair. Then, you share
Next post
Zettel 202109140245: Setting Up a TFTP Server for RHEL/CentOS7/8/Fedora To set up a tftp server in RHEL/CentOS7/8/Fedora, do the following: Next, start and enable the service: I get stumped by the fact that you install