Record some Linux operation command (1)

  1. mkdir
    mkdir -vp shiyanlou/{lib/,bin/,doc/{info,product}}
    you can create serveral directories with regular expression {};
    -v verpose
    -p parent
  2. rm
  3. mv
    rename shiyanlou.log as zhou.log: mv shiyanlou.log zhou.log
    move, and the target directory must exit or it will be renamed as test: mv shiyanlou.log test
  4. cp
    create a symbolic link: `cp -s shiyanlou.log zhou.log
  5. cat(concatenate)
    transplant the content in shiyanlou.log to zhou.log with line number: cat -n shiyanlou.log > zhou.log
    -s --squeeze-blank, compress the multi-blank line to single blank line
    how to show serveral lines content in the interaction panel
shiyanlou:~/ $ cat -A << EOF                                         [23:48:21]
heredoc> 'ls -l'
heredoc> EOF
'ls -l'$
  1. nl
    numerate lines: nl -b t shiyanlou.log
    -b 指定行号指定的方式,主要有两种:
    -b a 表示不论是否为空行,也同样列出行号(类似 cat -n)
    -b t 如果有空行,空的那一行不要列出行号(默认值)

猜你喜欢

转载自blog.csdn.net/weixin_41576308/article/details/89323758