I have a lot of files in a directory that are named as follows ID_OTHER_STUFF.txt  I'd like to rename them all to ID.txt.  This isn't a duplicate because I don't know how to specify this pattern. 
command to mass rename files according to pattern
bash;rename
Using the perl script prename, which is symlinked to rename on Debian based distros.rename -n 's/^([^_]*)_.*/$1.txt/' *_*.txtRemove the -n once you are sure it does what you want.