Hello DaniWeb Users,
I need some help how I can change a file name but not the file extension.
Doing it one by one is pain.
mv file1.gr2 test1.gr2
doing this will need a lot of time.
I been searching for an hour
find . -name "*.gappedPeak" -exec sh -c 'mv "$1" "${1%.gappedPeak}.bed"' _ {} \;
this command change the file extension but not the file name.
Please help me how I can change file name.
Actually I would just cut some of the file name
Example of my file:
Test_Sample_d01_2016f00300.gr2
Test_Sample_d01_2016f00600.gr2
Test_Sample_d01_2016f00900.gr2
Test_Sample_d01_2016f01200.gr2
Test_Sample_d01_2016f01500.gr2
....
Test_Sample_d01_2016f30000.gr2
I would like to remove this Test_Sample_d01_ without changing the file extension.