Immediately make a file empty. This even works if the file is still being written to. Great for cleaning up huge log files!
ä»åã¯ãæè¿ããããã¨ãããæ©ä¼ã®å¤ãã£ãLinuxã®è©±ã§ãã 大ãããªã£ããã°ãã¡ã¤ã«ãªã©ããä¸æ¦ã¯ãªã¢ãã¦ãã¾ãããæã£ã¦ããã¾ããããrmãã¦touchã¨ãã§ãã§ããªãã¯ãªãã§ããããã¼ããã·ã§ã³ãè¨å®ãç´ãããããªãã¨ãããªãã£ããããã®ã§ããã¾ãã¹ãã¼ããªæ¹æ³ã§ã¯ãªãããã§ããããããæãæ®éã¯ã©ãããã®ããªã¨æã£ã¦èª¿ã¹ã¦ãããããããªãã¼ã¸ãè¦ã¤ããã¾ããã ãã¡ã¤ã«ã空ã«ãã â æ®çºæ§ã®ã¡ã¢ http://d.hatena.ne.jp/iww/20071007/cat $ :> foo.log ããããããªããæ¹ããããã§ãããç¥ãã¾ããã§ããããããããã®ã¹ãã¤ãªã¼ã¿ãããª:>ã®æå³ãåããã¾ãããã¨ããããã試ãã«ç®ã¨å£ã®éã«(ç¬)ã¹ãã¼ã¹ãå ¥ãã¦ã¿ã¾ãã $ : > foo.log ãããå ã»ã©ã¨åãçµæã«ãªãã¾ãããã¨ãããã¨ã¯:ã¨>ã¯å¥ã ã®ããã§ãã>ã¯ãªãã¤ã¬ã¯
ã·ã§ã«ã¹ã¯ãªããã¨awkã«ãããã¼ã¿è§£æ 2006/01/10 ç波大å¦è¾²æå·¥å¦ç³» 西ç°é¡é ã¯ããã« ããã¹ãå½¢å¼ã®æ°å¤ãã¼ã¿ã®å¦çã»è§£æã«ã¯ãawk+ã·ã§ã«ã¹ã¯ãªãããæå¼·ã§ãããèªå¼µã§ã¯ãªããããã¾ã§ã¨ã¯ã»ã«ãCè¨èªãFORTRANãªã©ããç¥ããªãã£ã人ã«ã¯ããã²awk+ã·ã§ã«ã¹ã¯ãªããã®ä¸çãä½é¨ãã¦æ¬²ãããæ°è±¡ãã¼ã¿ãªã©ã大éã®ããã¹ãå½¢å¼æ°å¤ãã¼ã¿ãããã人ã«ã¯ã人çã®è»¢æç¹ã¨è¨ããã»ã©ã®è¡æãå¾ ã£ã¦ããã ãªããawk+ã·ã§ã«ã¹ã¯ãªããã®ä½¿ç¨ç°å¢ã¯ãå½ç¶ãªããUNIXã·ã§ã«ã§ãããWindowsã¦ã¼ã¶ã¼ã¯ãCygwinã§æ¬ä¼¼çã«UNIXã·ã§ã«ç°å¢ãæ§ç¯ãã¦ãã ããã åèã«ãªããã¼ã¸ ããã¨ã ããã¨ã awkã¨ã¯? awkã¯ãããã¹ããã¼ã¿ã®1è¡ã¥ã¤ã«å¯¾ãã¦å¦çããããããã°ã©ãã³ã°è¨èª(ã¹ã¯ãªããè¨èª)ã§ãããã³ã³ãã¤ã«ã¯å¿ è¦ãªããUNIXã®ã³ãã³ãã©ã¤ã³ã®åºåã«ããã¤ã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}