I have around 255 files in the current directory. A list of some of them is
ALLT042194_TAB20.tsv_20180117_001434_0084
ALLT194_TAB20.tsv_20180117_0083
ALLT194_TAB20.tsv_20180117_0084
ALLT194_TAB20.tsv_20180117_0089
ALLT194_TAB20.tsv_20180117_0085
ALLT194_TAB20.tsv_20180117_0082
ALLT194_TAB20.tsv_20180117_0060
ALLT194_TAB20.tsv_20180117_0044
ALLT194_TAB20.tsv_20180117_0064
ALLT194_TAB20.tsv_20180117_0094
I want to remove all chars after .tsv
. For this I have used the code below. In the code I am removing the last 14 characters, so I am getting the file name up through .tsv
. But my code is giving output for 15 files only and removing the rest of the files from the 255.
for i in *
do
j=`echo $i | sed -e 's/..............$//'`
mv $i $j
done
How can I remove everything after .tsv
?