Skip to main content

Shell Tool

shell#

  • ncdu => 查看檔案大小工具(取代du)
  • jg => 處理json字串好工具
  • tail => offset by \n
  • head => limit by \n
  • less => print data with big file
  • nl => show line numbe
  • wc(算數/算行)
  • man(manual)
  • pipe(|)
    • 將前一個的standand out 放到下一個的standard in
  • > >>
    • > 完全覆蓋
    • >> 累計加上
for i in a b c; do echo $i; done

# generate serial output(number or string)
seq 10

shell calculate#

# $(()) 兩個括號就可以算數
echo $((10+20))

shell note#

  • fd => Simple, fast and user-friendly alternative to find
  • rg => rip grep

查Port#

lsof -PiTCP -sTCP:LISTEN