to move all file with certain common string except the extension of the file to another directory

Suppose there is directory with files and most of them have "ubuntu" string in common to the name of file .

i used the command

mv ubuntu1 ubuntu2 ubuntu3 ubuntu/

now i want to move all these files from this directory to other directory without moving each file differently.

1 Answer

Use the command

mv *ubuntu* destination_directory_path/

where *ubuntu* indicates that ubuntu may appear anywhere in between the file/folder name.

NOTE: This will move all files which have ubuntu in their name in the current directory and the destination folders name should not have ubuntu in it. If it is present, first rename the destination to somthing else and then try the above command.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like