Linux Ubuntu move file from one directory to another directory command

linux move file folder

In Linux, type:
To move file
mv somefile /anotherfolder/

To move all folder content:
mv /somefolder/* /anotherfolder/*

In Ubuntu, type:
To move file
sudo mv somefile /anotherfolder/

To move all folder content:
sudo mv /somefolder/* /anotherfolder/*

There’s almost always more than way to do something in Linux. And more importantly, there are almost always caveats. There are more and less precise ways to do things. For example, using cp or cp -r will copy files from one place to another, but can / will still alter those files as far as the file system is concerned. A file is more than its contents after all. There is metadata for that file that is used by the files system, like creation time, access time, owner, permissions, etc. cp will not perserve this information.

By Keenlio, November 26, 2014

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *


8 − two =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>