I have a lot of files to process and I need to replace their original names with this format in bash:   00000000000001_1.jpg  00000000000002_1.jpg 00000000000003_1.jpg   and so on
38379
How to rename file as below  AS1100801000002.RAW7AGS  AS1100801001008.RAW7AH4 AS1100801002001.RAW7AH9 AS1100801003002.RAW7AHE AS1100801004009.RAW7AHT AS1100801005002.RAW7AHY AS1100801010002.RAW7AJ3   to new name  AS1.txt AS2.txt AS3.txt AS4.txt AS5.txt AS6.txt AS7.txt
11572
Script to convert filenames to lowercase depending on extension
79503
I have a set of files on which I would like to apply the same command and the output should contain the same name as the processed file but with a different extension.  Currently I am doing rename /my/data/Andrew.doc to /my/data/Andrew.txt I would like to do this for all the .doc files from the /my/data/ folder and to preserve the name.  I tried several versions but I guess I have something wrong in the syntax as I an new to linux.
25713
I need to rename a bunch of files in order to fix their sort order, therefore I need to be able to do a sort of "find and replace" so I can replace chunks of the filenames at a time.  What tools should I use? I prefer GUI but a command line tool recommendation would also be fine.
13769
I want to rename a lot of files on Mac OS X (10.7.2).. I don't have the perl package for the rename command.  My files have names like "T452-102456-0.png" and I want to delete the "-0" part. I know I can do this action by writing my own php-cli script, but I would like to know of an easier and faster solution.
100484
Other than by renaming the files first, how can I rsync files that may have colons in their names?
72412
I have to deal with a large number of files nested inside of directories (one file per directory), resembling something like this:  fred/result.txt john/result.txt mary/result.txt ...   I am currently using the following command to process each of those files:  find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c \"cd '{}' &amp;&amp; processResult result.txt\" \;   I am looking for something I can add into the end of this command that will change the filenames to fred.txt, etc. and then later move the file into the parent directory to eliminate the extra layer of directories.  What would be the best way to do this?
52153
I have a script that parses the filenames of TV episodes (show.name.s01e02.avi for example), grabs the episode name (from the www.thetvdb.com API) and automatically renames them into something nicer (Show Name - [01x02].avi)  The script works fine, that is until you try and use it on files that have Unicode show-names (something I never really thought about, since all the files I have are English, so mostly pretty-much all fall within [a-zA-Z0-9'\-])  How can I allow the regular expressions to match accented characters and the likes? Currently the regex's config section looks like..  config['valid_filename_chars'] = """0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@£$%^&amp;*()_+=-[]{}"'.,&lt;&gt;`~? """ config['valid_filename_chars_regex'] = re.escape(config['valid_filename_chars'])  config['name_parse'] = [     # foo_[s01]_[e01]     re.compile('''^([%s]+?)[ \._\-]\[[Ss]([0-9]+?)\]_\[[Ee]([0-9]+?)\]?[^\\/]*$'''% (config['valid_filename_chars_regex'])),     # foo.1x09*     re.compile('''^([%s]+?)[ \._\-]\[?([0-9]+)x([0-9]+)[^\\/]*$''' % (config['valid_filename_chars_regex'])),     # foo.s01.e01, foo.s01_e01     re.compile('''^([%s]+?)[ \._\-][Ss]([0-9]+)[\.\- ]?[Ee]([0-9]+)[^\\/]*$''' % (config['valid_filename_chars_regex'])),     # foo.103*     re.compile('''^([%s]+)[ \._\-]([0-9]{1})([0-9]{2})[\._ -][^\\/]*$''' % (config['valid_filename_chars_regex'])),     # foo.0103*     re.compile('''^([%s]+)[ \._\-]([0-9]{2})([0-9]{2,3})[\._ -][^\\/]*$''' % (config['valid_filename_chars_regex'])), ]
14519
I have a bunch of files as follows:  04602635_b0294.DAT20120807164534 04602637_b0297.DAT20120807164713 04602638_b0296.DAT20120807164637 04602639_b0299.DAT20120807164819 04602640_b0298.DAT20120807164748 04602641_b0300.DAT20120807164849 04602650_b0301.DAT20120807164921 04602652_b0302.DAT20120807164956   I need to rename them to exclude the prefix. It needs to look like this..  b0294.DAT20120807164534 b0297.DAT20120807164713 b0296.DAT20120807164637 b0299.DAT20120807164819 b0298.DAT20120807164748 b0300.DAT20120807164849 b0301.DAT20120807164921 b0302.DAT20120807164956   EDIT  I forgot to add that I am using Solaris.
74869
I need to rename files names like this  transform.php?dappName=Test&amp;transformer=YAML&amp;v_id=XXXXX   to just this  XXXXX.txt   How can I do it?  I understand that i need more than one mv command because they are at least 25000 files.
92707
i tried it the following way:  rename 'bla bla .txt' blabla.txt   But this doesn't work, what's the correct syntax for this case?
93123
I am trying to batch-rename a bunch of files in my shell, and even though there is plenty of material about it on the internet, I cannot seem to find a solution for my specific case.  I have a bunch of files that have (what appears to be) a "timestamp-id":  abc_128390.png abc_138493.png abc_159084.png ...   that I'd like to exchange for a counter:  abc_001.png abc_002.png abc_003.png ...   My (plenty) naïve approach would be something like:  mv abc_*.png abc_{001..123}.png  Also, I could not figure out a way to make it work with a for-loop.  FWIW, unfortunately rename is not available on this particular system.  Any advice would be greatly appreciated!
84698
I'm looking to write a script that will find and replace any characters other than [^A-Za-z0-9._-] in a specific file type (in this case .avi) with an underscore _. I want this to exec recursively from the current path. I'm using Ubuntu.  I do not want or need to change any folder names as I have control over those at the time of creation. Here's what I have now after referencing the following link:    find . -depth -exec rename 's!([^/]*\Z)/[^A-Za-z0-9._-]/_/g' *.avi {} +   I'm clearly missing something. Please help. :)
122096
I would like to change this:  Filer   ShareName       IPAddress1    IPpaddres2    IPAddress2    ... ... .... ServerA /share1/tools   192.168.1.52  192.168.1.65  192.168.1.158 ServerA /share/library  192.168.1.65  192.168.1.61  192.168.1.155 ServerB /share/tools    192.168.1.158 192.168.1.159 ServerD /share/misc     192.168.1.7 .. ... ..... .......   To this, in a new worksheet:  Filer   ShareName       IPAddress ServerA /share1/tools   192.168.1.52 ServerA /share1/tools   192.168.1.65 ServerA /share1/tools   192.168.1.158 ServerA /share/library  192.168.1.65  ServerA /share/library  192.168.1.61  ServerA /share/library  192.168.1.155 ServerB ... ... ServerD ... ... .. ... ..... .......
3386
Is there a function to extract the extension from a filename?
18177
I have a text file containing this:  0 0 -1 0 1 0 0 0 0 -1 0 0 1.5 0.0 1.0 1   and I want to replace the 1.0 to 2.0 so that it becomes:  0 0 -1 0 1 0 0 0 0 -1 0 0 1.5 0.0 2.0 1   so I use this command:  sed -i 's/'1.0'/'2.0'/g' /home/user1/file1.txt   or this:  sed -i 's/1.0/2.0/g' /home/user1/file1.txt   but this is the result that appears and I don't know how to fix this:  0 0 -2.0 2.0 0 0 0 -2.0 0 1.5 0.0 2.0 1
91459
I have file1 likes:  0   AFFX-SNP-000541  NA 0   AFFX-SNP-002255  NA 1   rs12103          0.6401 1   rs12103_1247494  0.696 1   rs12142199       0.7672   And a file2:  0   AFFX-SNP-000541   1 0   AFFX-SNP-002255   1 1   rs12103           0.5596 1   rs12103_1247494   0.5581 1   rs12142199        0.4931   And would like a file3 such that:  0   AFFX-SNP-000541     NA       1 0   AFFX-SNP-002255     NA       1 1   rs12103             0.6401   0.5596 1   rs12103_1247494     0.696    0.5581 1   rs12142199          0.7672   0.4931   Which means to put the 4th column of file2 to file1 by the name of the 2nd column.