[root@localhost ~]# cat web.txt 

http://www.baidu.com/1.txt

http://www.baidu.com/1.txt

http://www.baidu.com/1.txt

http://map.baidu.com/1.txt

http://www.baidu.com/1.txt

http://www.baidu.com/1.txt

http://pan.baidu.com/1.txt

http://www.baidu.com/4.txt

http://pan.baidu.com/2.txt

1. 使用cut 命令取第一个字符

    cut -c1 web.txt


2. 使用awk取第一个字符

    awk -F "" '{print $1}'  web.txt


3. 使用 rev 命令反转字符串

[root@localhost ~]# rev web.txt 

txt.1/moc.udiab.www//:ptth

txt.1/moc.udiab.www//:ptth

txt.1/moc.udiab.www//:ptth

txt.1/moc.udiab.pam//:ptth

txt.1/moc.udiab.www//:ptth

txt.1/moc.udiab.www//:ptth

txt.1/moc.udiab.nap//:ptth

txt.4/moc.udiab.www//:ptth

txt.2/moc.udiab.nap//:ptth