Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.