Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash: How can I move all the content in the folder up to one level?

Tags:

bash

move

How can I move the whole folder of _vim into ~/.vim?

$ mv ~/.vim/_vim/ ~/.vim
mv: `/home/kithokit/.vim/_vim/' and `/home/kithokit/.vim/_vim' are the same file

I cannot do that. Basically what I want to do is just move all the contents inside _vim folder up to one level, which is in ~/.vim/

like image 636
TheOneTeam Avatar asked Apr 01 '12 11:04

TheOneTeam


People also ask

How do I move the contents of a directory up one level in Linux?

You need to use the mv command that moves one or more files or directories from one place to another. You must have have write permission for the directories which the file will move between. The syntax is as follows to move /home/apache2/www/html directory up one level at /home/apache2/www/ directory.

How do I move up one level in a folder?

To go up one level of the directory tree, type the following: cd .. The special file name, dot dot ( .. ), refers to the directory immediately above the current directory, its parent directory.

How do I move the contents of a folder in Linux?

After you have selected each file (Figure 2), you can either right-click one of the selected files and then choose the Move To option, or just drag and drop them into a new location. The selected files (in this case, folders) will each be highlighted. Moving files on the Linux desktop is incredibly easy.


1 Answers

mv ~/.vim/_vim/* ~/.vim

Bash expands the * such the command now reads

mv ~/.vim/_vim/file_1 ... ~/.vim/_vim/file_n ~/.vim
like image 77
Dunes Avatar answered Sep 28 '22 08:09

Dunes