linux and robert

2009年10月1日 星期四

Sed : remove empty lines, remove beginning spaces, tabs

Remove empty lines:
cat file|sed /^$/d

Remove beginning spaces:
cat file|sed s/^\ *//g

Remove beginning tabs:
cat file|sed s/^\\t*/d

(Remove=Replace with nothing)
張貼者: no 於 上午10:25
以電子郵件傳送這篇文章BlogThis!分享至 X分享至 Facebook分享到 Pinterest

沒有留言:

張貼留言

較新的文章 較舊的文章 首頁
訂閱: 張貼留言 (Atom)

網誌存檔

  • ►  2016 (1)
    • ►  6月 (1)
  • ►  2014 (1)
    • ►  3月 (1)
  • ►  2012 (5)
    • ►  12月 (2)
    • ►  3月 (1)
    • ►  2月 (2)
  • ►  2011 (9)
    • ►  12月 (1)
    • ►  10月 (1)
    • ►  6月 (2)
    • ►  5月 (1)
    • ►  3月 (1)
    • ►  2月 (2)
    • ►  1月 (1)
  • ►  2010 (9)
    • ►  12月 (2)
    • ►  5月 (1)
    • ►  4月 (3)
    • ►  1月 (3)
  • ▼  2009 (16)
    • ►  12月 (3)
    • ►  11月 (3)
    • ▼  10月 (4)
      • Use ntfs-clone to backup to / restore from an image
      • 安裝與設定 apache 2.2 with WebDAV and AuthType=Digest
      • 認識 initrd 與 initramfs
      • Sed : remove empty lines, remove beginning spaces,...
    • ►  9月 (5)
    • ►  8月 (1)

關於我自己

no
檢視我的完整簡介
簡單主題. 技術提供:Blogger.