Moving and copying files

We often need to copy or move files from one location to another in order to arrange files according to the need. We also can copy our computer data to an external drive or another computer available locally or remotely in order to keep the backup of the important data.

Moving files

Moving regular files and directories is useful when we want to keep exactly one copy of the data at a new location. The mv command is used to move files from one location to another.

The syntax of using the mv command is as follows:

mv [option] source... destination

Here, source is the file or directory to be moved. Multiple source files can be specified and destination is the location in which the files and directories should be moved.

Some of ...

Get Linux Shell Scripting Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.