Saturday, September 13, 2008

Removing a particular prefix from all files listed by ls

Removing a particular prefix from all file names listed by ls -lrt e.g. dbo.manu.sql-->manu.sql ......
------------------------------------------------------------------------

#! /bin/ksh
for i in `ls *.sql`
do
NEW=`echo $i | sed -e 's/^dbo.//g'`
mv ${i} ${NEW}
done

1 comment:

Unknown said...

It was very nice article and it is very useful to Linux learners.We also provide Linux online training

 

Blogger news

Blogroll