Copy File and Rename

Ask a Question related to AIX, Design and Development.

  1. #1

    Default Copy File and Rename

    I need to copy about 200 files from one directory to another while
    renaming them. Does anyone have a short script to do this?

    TIA
    St. Claire Guest

  2. Similar Questions and Discussions

    1. Copy & rename entire folder structure
      I was wondering how to copy an entire folder structure with sub folders and files, then rename the main folder. I have used the cfdirectory to...
    2. Why can't I rename this file?
      Why can't I rename this file under my normal login? $ pwd /var/tmp $ ls -ld drwxrwxrwt 3 bin bin 83456 May 13 11:51 . $ ls -l...
    3. Quick way to rename text boxes when copy/paste
      Hi Folks, I am trying to add text boxes to document. I did see that I can copy and paste, but it leaves the name the same. Then when you add text to...
    4. #25555 [Opn->Bgs]: rename/copy/fopen should be able to handle uploaded
      ID: 25555 Updated by: sniper@php.net Reported By: xuefer at 21cn dot com -Status: Open +Status: ...
    5. #25555 [NEW]: rename/copy/fopen should be able to handle uploaded
      From: xuefer at 21cn dot com Operating system: all PHP version: 4.3.3 PHP Bug Type: Feature/Change Request Bug description: ...
  3. #2

    Default Re: Copy File and Rename

    Uzytkownik "St. Claire" <tstclaire@hotmail.com> napisal w wiadomosci
    news:8581fcb0.0309261059.53c84e90@posting.google.c om...
    > I need to copy about 200 files from one directory to another while
    > renaming them. Does anyone have a short script to do this?
    >
    > TIA
    for safe reasons do check that files are the correct one you are going to
    move:
    cd /dir;for i in *;do ls -al $i;done


    example - this will move files to "newdir" with "newname" before old name.
    You can also play with "basename":
    for i in *;do mv $i /newdir/newname$i;done


    Marrek Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139