I have a few folders each containing large filenames that downloaded in a strange naming format and obscures the file extension and I want to convert to something very simple.  Here's an example of what I want to do. Let's say these four files are located in one of the folders:  HTTP_services.cgi?FILENAME=%2Fdata%2FMERRA2%2FM2I6NPANA.5.12.4%2F1992%2F08%2FMERRA2_200.inst6_3d_ana_Np.19920818.nc4&amp;FORMAT=bmM0Lw&amp;BBOX=-90%2C-180%2C90%2C180&amp;LABEL=MERRA2_200.inst6_3d_ana_Np.19920818.SUB.nc4&amp;SHORTNAME=M2I6NPANA&amp;SERVICE= HTTP_services.cgi?FILENAME=%2Fdata%2FMERRA2%2FM2I6NPANA.5.12.4%2F1992%2F08%2FMERRA2_200.inst6_3d_ana_Np.19920819.nc4&amp;FORMAT=bmM0Lw&amp;BBOX=-90%2C-180%2C90%2C180&amp;LABEL=MERRA2_200.inst6_3d_ana_Np.19920819.SUB.nc4&amp;SHORTNAME=M2I6NPANA&amp;SERVICE= HTTP_services.cgi?FILENAME=%2Fdata%2FMERRA2%2FM2I6NPANA.5.12.4%2F1992%2F08%2FMERRA2_200.inst6_3d_ana_Np.19920820.nc4&amp;FORMAT=bmM0Lw&amp;BBOX=-90%2C-180%2C90%2C180&amp;LABEL=MERRA2_200.inst6_3d_ana_Np.19920820.SUB.nc4&amp;SHORTNAME=M2I6NPANA&amp;SERVICE= HTTP_services.cgi?FILENAME=%2Fdata%2FMERRA2%2FM2I6NPANA.5.12.4%2F1992%2F08%2FMERRA2_200.inst6_3d_ana_Np.19920821.nc4&amp;FORMAT=bmM0Lw&amp;BBOX=-90%2C-180%2C90%2C180&amp;LABEL=MERRA2_200.inst6_3d_ana_Np.19920821.SUB.nc4&amp;SHORTNAME=M2I6NPANA&amp;SERVICE=   I would like these to just be renamed something very basic like  1.nc4 2.nc4 3.nc4 4.nc4   The new numbers have no relation to the original filenames. I just want to be able to iterate through them easily with another program I have.  I've attempted to use batch renaming programs like pyrenamer and metamorphose but they seem to be good at replacing patterns in names with other patterns, not just overwriting the name with a pattern.
89541
I would like to rename all files in a folder so to have consecutive numbers. For instance:  1.png 2.png 3.png etc   I know there is the rename command and I know there are DOZENS of similar questions in here but I can't find the way.  NOTE: Suggested duplicate doesn't contain a solution specific for my case. Please stop flagging this as duplicate, because suggested duplicate does not answer my question
45287
I have thousands of files named 1.txt 2.txt and so on. Some of those files are missing. Which would be the easiest way to find out which files are missing?
7585
Is it possible to find duplicate files on my disk which are bit to bit identical but have different file-names?
41809
I have a string that I want to use as a filename, so I want to remove all characters that wouldn't be allowed in filenames, using Python.  I'd rather be strict than otherwise, so let's say I want to retain only letters, digits, and a small set of other characters like "_-.() ". What's the most elegant solution?  The filename needs to be valid on multiple operating systems (Windows, Linux and Mac OS) - it's an MP3 file in my library with the song title as the filename, and is shared and backed up between 3 machines.
13792
My wife has several files and folders that somehow ended up having filenames that have caused them to be undeleteable (can't be deleted) by normal means or via the command line. I believe the filenames are too long due to the depth of the folder structures. Does anyone know of a good utility for cleaning up files like this?
29569
How do I batch convert many Word documents and have them saved as [originalfilename].pdf?
96996
Suppose that I have a directory with thousands of files; how could I open all files whose name contains both the strings "red" and "green"?
77643
Looking to find all files (recursively) which have an underscore in their file name and then delete them via command line.
83439
I have a directory full of files with names in this format (with numbers as the start of each filename):  102_file.txt 104_list.txt 242_another_file.txt   I would like to rename them as follows (i.e. removing the numbers):  file.txt list.txt another_file.txt   Can anyone suggest a way to do this (presumably from the terminal)?
42800
I have a bunch of files that are displayed in a view; i'm using 'generic files' setting to display them; the problem is that some files have really ugly names like '1002-32-eda.pdf' i'd like to change the name to 'download' but keep the 'mime' detection (small icon on the left side; like pdf, word etc).  Any example on how to change this ?
25249
I realized I had named a bunch of files in an off-by-one fashion so I wanted to rename any file starting with "1" to the same thing except starting with 2.  For example mv 1.4.5.txt 2.4.5.txt or mv 1-chart.jpg 2-chart.jpg etc.  I tried mv 1* 2* but this was not accepted because it interprets 2* as a directory.
21155
I have the below list of files  aro_tty-mIF-45875564pmo_opt aro_tty-mIF-45875664pmo_opt aro_tty-mIF-45875964pmo_opt aro_tty-mIF-45875514pmo_opt aro_tty-mIF-45875524pmo_opt   that I need to rename to  aro_tty-mImpFRA-45875564pmo_opt aro_tty-mImpFRA-45875664pmo_opt aro_tty-mImpFRA-45875964pmo_opt aro_tty-mImpFRA-45875514pmo_opt aro_tty-mImpFRA-45875524pmo_opt
51777
'4800483343' is a directory, and 'file1' &amp; 'file2' are two files in it.  Why is the following happening?  $ ls 4800483343 file1 file2  $ md5sum 4800483343/* 36468e77d55ee160477dc9772a99be4b  4800483343/file1 29b098f7d374d080eb006140fb01bbfe  4800483343/file2  $ mv 4800483343 4800[48]3343  $ md5sum 4800[48]3343/* md5sum: 4800[48]3343/*: No such file or directory  $ md5sum '4800[48]3343'/* 36468e77d55ee160477dc9772a99be4b  4800[48]3343/file1 29b098f7d374d080eb006140fb01bbfe  4800[48]3343/file2   What other characters cause this?
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.
97967
So, I'm using a script I've made to convert videos to the webm format. A certain program calls the script, sending %f which is the full, absolute file name of the video, like this:  converter.sh %f   where %f has two possible extensions, .avi or .mpg.  # /bin/bash ffmpeg -i $1 `dirname $1``basename $1 avi`webm &amp;&amp; rm $1   It currently works perfectly when $1 contains a .avi file, because basename removes the .avi extension. When $1 ends with .mpg instead, the result is .mpgwebm.  How can I modify that script to be able to receive those two possible different formats?    Resuming: If $1 is /somedir/video.avi, the script should do:  ffmpeg -i /somedir/video.avi /somedir/video.webm   And if $1 is /somedir/video.mpg, the script should do:  ffmpeg -i /somedir/video.mpg /somedir/video.webm   I know this might be fool for some people, but I'm kind of new with the bash.
73988
Everybody knows :-) that in Windows plain text files lines are terminated with CR+LF, and in Unix&amp;Linux - with LF only. How can I quickly convert all my source code files from one format to another and back?
55257
I have the following files   SSt12.precip.374.sub.climatology.ctl SSt12.precip.2874.sub.climatology.ctl SSt12.precip.3764.sub.climatology.ctl SSt12.precip.6774.sub.climatology.ctl   I want to rename the files as   SSt12.precip.1.sub.climatology.ctl SSt12.precip.2.sub.climatology.ctl SSt12.precip.3.sub.climatology.ctl SSt12.precip.4.sub.climatology.ctl