rche 033----unit 12   introduction to string processing

unit 12   introduction to string processing
    .head
    .tail
    .wc:     统计字数
    .uniq
    .other string processing tools
    .version comparison with diff
    .spell checking with aspell
    .formatting tools
   
head: head file1        显示前十行
      head -n 15 file1  指定显示行数
      head --lines 17 file1
      head -12 file1
     
     
tail:             默认显示后十行
   . -5 /etc/passwd           后5行    ==========================
[root@mycentos ~]# tail -5 /etc/passwd
avahi:!!:70:70:Avahi daemon:/:/sbin/nologin
avahi-autoipd:!!:100:103:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
xfs:!!:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
u1:!!:500:500::/home/u1:/bin/bash
u2:!!:501:501::/home/u2:/bin/bash
   .use -f to follow the end of a text file as it changes==================
  显示改变过的内容
  tail -f will continue to show updates of the file until <ctrl-c>is pressed
 
   .used to "watch"log files===========================

wc===================================
  行数,字数,字符统计
  [root@mycentos log]# wc maillog
   4     43     365 maillog
  .use -l      line count
  .use -w      word count
  .use -c      character count
 
uniq==============================================重复的行去掉
sort -u  ====与uniq是一个意思
uniq -c file       ===================计算重复行的数目 

paste=====================

other string processing tools
  $表示段落
 
 
aspell :检查单词,字母 是否有问题
look exer:快速检查单词是否拼写正确 

本文出自 “www.51cto.com” 博客,谢绝转载!

你可能感兴趣的:(linux,职场,休闲,rche,033)