Find the answer to your Linux question:
Results 1 to 4 of 4
I have some file, I want copy to another data. But i don't kown. Exp: i have files abc.def1.wav, abc.def2.wav,..., abc.def3-in.wav, abc.def3-out.wav,..., on /monitor I want wirte script move 2 ...
  1. #1
    Just Joined!
    Join Date
    Nov 2008
    Posts
    3

    Script to copy files

    I have some file, I want copy to another data. But i don't kown.
    Exp: i have files abc.def1.wav, abc.def2.wav,..., abc.def3-in.wav, abc.def3-out.wav,..., on /monitor
    I want wirte script move 2 file abc.def1.wav and abs.def2.wav to /data/wav/ , but keep file abc.def3-in.wav and abc.def3-out.wav.

    Please help me,

  2. #2
    Just Joined! garry_3peace's Avatar
    Join Date
    Oct 2008
    Posts
    67
    I thought manual copy should be the best solution since it's only 2 files....

  3. #3
    Just Joined!
    Join Date
    Nov 2008
    Posts
    3
    Thank reply, but not only 2 file on my server. When I copy by hand about 1000 file . I want write scrip auto copy all file i need.

  4. #4
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    You need to learn how to use globs in pathname expansion. In your example the following command would work:

    Code:
    # mv /monitor/abc.def?.wav /data/wav/
    The '?' means match any single character. Refer to bash manpage, pathname expansion, Pattern Matching for more information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...