M
M
maniac_by2018-10-02 20:41:15
linux
maniac_by, 2018-10-02 20:41:15

How to transfer files by part of the name?

Hello. Interested in the question, how to transfer partial files on the Linux command line using patterns?
There are three folders
80x
00x
latest
They need to sort the files that have (year) in the name.

mv `*198*` /home/fywy/task1/video/80x
8.0 Fanny och Alexander (1982).mp4: command not found
mv: missing destination file operand after '/home/fywy/task1/video/80x'
Try 'mv --help' for more information.

How can I transfer and what is the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2018-10-02
@maniac_by

`*198*`
...
8.0 Fanny och Alexander (1982).mp4: command not found

what is the problem

You should at least take an interest in what different quotes mean before using them. The back quotes mean "execute the command written inside and substitute its output". No need to perform mp4.
find -name '*198*' -print0 | xargs -0 -I{} mv \{} /home/fywy/task1/video/80x

V
vreitech, 2018-10-02
@fzfx

at least the problem is that you are wrapping the string in ``.

S
Saboteur, 2018-10-02
@saboteur_kiev

mv *(198?)* /home/fywy/task1/video/80x/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question