1

This question already has an answer here:

So for example i have one folder called "test". Inside that folder, i created one another folder called "player" and a lot of text file, let's say 50 files.

[root@ip-10-0-7-70 test]# ls
kaka.txt  player  rooney.txt

Now i want to move all of that text file into "player" folder. What's the best way to do this?

I tried

cp -r ls | ^egrep 'player'

but it didn't work.

marked as duplicate by Gilles, MelBurslan, Jakuje, Anthon, Jeff Schaller May 9 '16 at 23:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

From the test directory, do:

mv -t player *.txt

Assuming all text files end in .txt.

This will mv all .txt files from current directory (test/) to player/ subdirectory.

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