Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
追è¨ãå¢ããã®ã§æ´ç çµç·¯ 2.5GBã®ããã¹ããã¡ã¤ã«ãå å·¥ããå¿ è¦ããããâ vimã§éãã¦å å·¥âvimæ»äº¡â¡sublime textã§éãã¦å å·¥âsublime textæ»äº¡ã¨ãªã£ããããawkãç¨ãã¦ä»¥ä¸ã®æ§ãªã³ãã³ããå®è¡ããã $ cat sample.txt | awk '$5 ~ /((26|27|28|29|30)\/Jun|(01|02|03)\/Jul)/{ print }' > result.txt ãã㨠ãcatãããªããï¼ãã¨ææ ããã«MATSUMOTO, Ryosuke (@matsumotory) | Twitterãï¼ãããã£ãã·ã¥ã«å ¥ãã¦é«éåãã¦ãããã¨æã£ãã ã¨ã³ã¡ã³ãããããã¾ãããã®ã§ãã©ã£ã¡ãéããã®æ¤è¨¼ã§ãã 注æ å å·¥ã®ç®çã¯ãã°ãã¡ã¤ã«ããããæéã ãã®è¡ãæãåããã æ£è¦è¡¨ç¾ãããã¦ãªãã®ã¯æ°ã«ããªã æ¯è¼ awkã«ãã¡ã¤ã«æå®ã
ããã«ã¡ã¯ã ããã¼ãã©ã¯ã¼ãã§ã¢ã°ãªã²ã¼ã·ã§ã³éçºãæ å½ãã¦ãã¾ãä¸å·ã§ãã ä»åã®ããã°ã¯ãç§ã bash ã¹ã¯ãªãããæ¸ãéã«å¿ããã¦ããäºã®ããããããã¾ãã ç¥ã£ã¦ã¦å½ããåã®ãã¨ããç¥ãã¾ããããæå¤ã¨ç解ããã¦ããªãã¢ã¬ã§ãã ã§ã¯ãç§ã bash ã¹ã¯ãªãããæ¸ãéã«ãã使ãè¨è¿°ãä¸ã¤ãã¤ç´¹ä»ãã¾ãã 2種é¡ã® shebang ã·ã§ã«ã¹ã¯ãªããã®ä¸è¡ç®ã«å¿ ãè¨è¿°ãã #! ã§å§ã¾ãè¡ã shebang ã¨è¨ãã¾ãã bash ã¹ã¯ãªããã® shebang ã¯ãbash ã絶対ãã¹ã§æå®ããæ¹æ³ã¨ãenv ã使ã£ã¦æå®ããæ¹æ³ã®äºç¨®é¡ããã¾ãã bash ã絶対ãã¹ãæå®ããæ¹æ³ #!/bin/bash env ã使ã£ã¦ãæå®ããæ¹æ³ #!/usr/bin/env bash åè 㯠/bin/bash ã使ããã¾ãã ï¼/bin/bash ãåå¨ããªããã°ã¹ã¯ãªããã®èµ·åæã«
æè¿ Stop using tail -f (mostly) ã ãtail -fãã使ãã®ã¯æ å¼±ãæ å¼·ã¯ãless +Fãã使ã ãªã©lessæ¼ããªè¨äºãå¹¾ã¤ãä¸ãã£ã¦ãããã ãã©ãã¿ã¤ãã«ãç ½ãæ°å³ãªã®ãè¥å¹²åæãå¼ãã§ãããããªã®ã§lessæ´¾ãè·å ´ã§è©èº«ã®çãæããããªãããã«ããå°ã便å©ãªä½¿ãæ¹ãç´¹ä»ãããã tail -fã®æ§ãªScroll forward less +Fã§èµ·åã¾ãã¯lessèµ·åä¸ã«F å è¨äºã«ãããtail -fã¨åæ§ã®æ¯ãèããæ£ç´ãã®æ©è½ã¨æ¤ç´¢ã ãã§ããã®ã§ããã°tailã§ååãlessã®ä¾¿å©ãªã¨ããã¯æ§ã ãªæ©è½ã¨ã®çµã¿åããã«ãã£ã¦ãããããç´¹ä»ããæ©è½ã¯åºæ¬çã«ãã®ã¢ã¼ãã¨çµã¿åãããå¯è½ã ããã¨ãlesséãã¦Fã®ã»ããã¿ã¤ããé¢åããããªãã®ã§ããããã 1è¡ã§è¡¨ç¤ºãã (æ¹è¡ããªã) less -Sã§èµ·åã¾ãã¯lessèµ·åä¸ã«-Sr(-Sã§ã¢ã¼ãå
ãã¼ã æ¤ç´¢Â - ãã°ã¤ã³ | |  ãã«ã æè¡/UNIX/ãªãnohupãããã¯ã°ã©ã³ãã¸ã§ãã¨ãã¦èµ·åããã®ãå®çªãªã®ãï¼(æ¬ä¼¼ç«¯æ«, Pseudo Terminal, SIGHUPä») [ Prev ] [ Next ] [ æè¡Â ] ä½ããã¾ããå½ããåã®äºãã»ã»ã»ã¨æãããã ããã $ nohup long_run_batch.sh & SSHãããã°ã¢ã¦ãå¾ãå®è¡ãç¶ããããããã¸ã§ããã"&"ãä»ãã¦ããã¯ã°ã©ã¦ã³ãã¸ã§ãã¨ãã¦nohupããèµ·åããã®ã¯å®çªä¸ã®å®çªã§ããã ãããããnohupã使ããªãã¦ãå®è¡ãç¶ãããã¨ãåºæ¥ããããæ¹ããã£ãããããã«ã¯ãnohupãä»ãã¦ããã°ã¢ã¦ãæã«çµäºãã¦ãã¾ãããã¿ã¼ã³ãããã¨ãããã©ãã ããï¼ ããã¦ãããæ¥ããªãã®å¾è¼©ãååããããã«ã¤ãã¦ããªãã«è³ªåãã¦ããããããªãã¯ã©ãçããã ãããï¼ ãWebä¸ã§æ¤ç´¢ãããè¦ã¤ã
ã·ã§ã«ããã°ã©ãã³ã°ã«ããã¦ãã«ã¼ãã«ã¦ã³ã¿ãªã©ãã¤ã³ã¯ãªã¡ã³ãããã¨ããã©ã®ããã«ãã¾ããï¼ ãããªãã§ãããµã³ãã«ããã #!/bin/bash COUNT=0 while [ $COUNT -lt 1000 ]; do # ä½ãã®å¦ç COUNT=`expr $COUNT + 1` # COUNT ãã¤ã³ã¯ãªã¡ã³ã done expr ã³ãã³ãã使ãï¼ ã·ã§ã«ããã°ã©ãã³ã°ã®å ¥éè¨äºãªã©ãè¦ãã¨ãå¤æ°ã®ã¤ã³ã¯ãªã¡ã³ãã«ä¸è¨ã®ãã㪠COUNT=`expr $COUNT + 1` ãç¨ãã¦ãããã®ãå¤ãããã¾ãã ãããããã®æ¸ãæ¹ã¯ ã¨ã¦ãé ã ã§ãã空ã®ã«ã¼ãã1000åç¹°ãè¿ãã ãã§ãæå ã® mac (Core i7) ã§ç´2ç§ãããã£ã¦ãã¾ãã¾ããã
naoya @naoya_ito ã·ã§ã«ã§ãã¹ã¯ã¼ãå ¥åããã³ããã§ããããªãã§ãããéä¸ã¾ã§æã£ã¦ééããã¨ãããããªãã§ãããCtrl + u æã¤ã¨ãªã»ããã§ããã®ç¥ã£ã¦ã? 俺ã¯ç¥ã£ã¦ã 2014-04-07 19:40:06
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}