Ubuntu: What does this specific command do? How does it work?


I just want to know how this command works.

mv wordpress/* .  

my guess is that it moves * meaning all files from wordpress folder to current folder. but still looking for proper answer.


Your assumption that this moves all files from the wordpress folder into the current folder you are in is correct. (the proper terminology for a "folder" is actually a "directory", but that's just semantics, the general idea is the same)

In command line, . indicates "This Directory", or rather the current directory you are in.

The mv command is the "move" command. The wordpress/* indicates that the folder you are inside has another folder called wordpress in it, and is directing the system to move all files and folders that are within the wordpress folder. The . command then indicates the destination, the directory you are in.

This command will move all files within the wordpress folder (which exists in the directory you are currently in) into the directory you are currently in, and will keep the structure of the files and directories through the move (so instead of wordpress/wp-admin it'll be in just wp-admin without the wordpress folder name prepended.)

If you want to know what the path is to the directory you are currently in before you run the command, just type pwd on the command line, and it'll tell you what the directory path you are currently in is. That'll be what . would be.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »