An extension to the previous question that I asked: Rename an alphanumeric file
I have a directory that has subdirectories with an extension of *_upstream:
DHX30_vs_Control18.txt_events_without_u2af1_srsf2_altexons_upstream
GEMIN5_vs_Control19.txt_events_without_u2af1_srsf2_altexons_upstream
I want to rename them by removing everything after first '_' such that it becomes something like
DHX30
GEMIN5