Home / VPS & Dedicated / Moving files on a Linux server

Moving files on a Linux server

Moving files, literally
Question: How do I move an entire directory filled with files on my Linux server?

Answer: While moving physical files can be quite a task, moving files in Linux is very easy. If you have SSH access to your server, you can move files with a simple command called “mv”. With it you can move individual files, multiple files, and entire directories. You can also use it to easily rename files.

First, log on to your server via SSH and navigate to the directory containing the file(s) you want to move. To move a single file, type:

mv filename /home/username/public_html/newdirectory

To rename a file, type:

mv filename new-name

To move a directory:

mv -r directoryname /home/username/public_html/newdirectory

This will move the directory and all of the files inside of it. For more information about “mv”, type man mv from the command line.

Photo Source: Flickr

Check Also


Importance of web hosting to business

The world of business is very ruthless and unfair in some cases. It is a …

Powered by Namesco
© Copyright InternetBlog.Org.Uk 2022, All Rights Reserved