shell program

Posted: 三月 5, 2011 in linux, shell

1.sort
        -o output the file
        -d dictionary  
        -n number
        -r reverse 
        -k
        -t tab
sort -k3 -n -r -t: /etc/passwd

2.wc
     -l lines
     -w words
     -c characters

3.sed
      -d
      -i
      -a
      -D
sed -n ‘1,4p’ /etc/passwd

4.awk
   awk -F: ‘{print NR,$1,$NF}’ /etc/passwd

5.echo -e “33[40;35mHello World33[0m”
background: 40-49
foreground: 30-39

6.diff file1/dir1 file2/dir2
    -q
    -c
    -b
    -B
    -r

7.grep
      -v 
      -i ignore
      -c count
      -n number

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s