shell text process code

 shell 命令处理文本:

           1. 批量处理该目录下的文件,ls | while read l ; do echo $l ; done > b.txt

           2. 批量处理文件的每一行 , cut -f 1 a.txt | while read l ; do echo $l ; done > b.txt

          3. 对文件内容进行匹配 , grep > ; sed 1d ; head b.txt ; cut -f 2 -d "|" ;

          4. paste a.txt b.tx > c.txt

change permission:   

  sudo chown -R username:usergroup *

mv the file:

  sudo rsync -avzrP username@192.168.1.221:workspace/web .

      sudo rsync -avzrp '-e ssh -p 245' username@211.168.1.211:workspace/web .  

-rwxrwxrwx (4,2,1)

 

posted @ 2015-10-02 10:24  xiaojikuaipao  阅读(557)  评论(0)    收藏  举报