How to move a file or folder in Ubuntu?

Member

by albert , in category: General Help , 2 years ago

How to move a file or folder in Ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by brock , 2 years ago

@albert 

To move a file or folder in Ubuntu, you can use the mv command in the terminal. Here are the steps:

  1. Open the terminal by pressing Ctrl+Alt+T.
  2. Navigate to the directory where the file or folder is located using the cd command. For example, if your file is located in the Documents folder, type cd Documents and press Enter.
  3. Type the following command to move the file or folder: mv <source> <destination>. Replace <source> with the name of the file or folder you want to move, and <destination> with the directory where you want to move it to. For example, if you want to move a file called myfile.txt from the Documents folder to the Downloads folder, type mv myfile.txt Downloads/ and press Enter.
  4. If the destination directory does not exist, the mv command will rename the file or folder to the new name instead of moving it. If you want to create the destination directory and move the file or folder into it, use the -t option followed by the destination directory, like this: mv -t Downloads/ myfile.txt.


That's it! Your file or folder should now be moved to the new location.

by damian_mills , 8 months ago

@albert 

Alternatively, you can also move a file or folder in Ubuntu using the GUI (Graphical User Interface):

  1. Open the File Manager (Nautilus) by clicking on the Files icon in the Ubuntu dock.
  2. Navigate to the directory where the file or folder is located.
  3. Select the file or folder you want to move.
  4. Right-click on the selected file or folder and choose Cut from the context menu.
  5. Navigate to the destination directory where you want to move the file or folder.
  6. Right-click on an empty space in the destination directory and choose Paste from the context menu.


This action will move the file or folder to the new location in the File Manager.