ä½æ°ãªã使ã£ã¦ãhistoryã³ãã³ãã«ã¤ãã¦ã¡ãã£ã¨èª¿ã¹ã¦ã¿ããMacã®ã
history
ã³ãã³ãã«ã¤ãã¦èª¿ã¹ã¦ã¿ã¾ããã調ã¹ãã®ã¯å²ã¨åãªã®ã§ããªãã§èª¿ã¹ããã¨æã£ãã®ãããå¿ãã¾ããã
historyã³ãã³ãã¯ã·ã§ã«ã«çµã¿è¾¼ã¾ããã³ãã³ãã ã£ã
$ whereis history $ which history $ type history history is a shell builtin
history
ã³ãã³ããã©ãã«ããã®ãæ°ã«ãªã£ããã§ãããwhereis
ã¨which
ã§ã¯ä½ãåºã¾ããã§ãããè²ã
調ã¹ã¦type
ã³ãã³ããç¥ã£ã¦ã使ã£ã¦ã¿ãããã«ãã¤ã³ã¨ã®äºããªã®ã§ãä¸ã«æ¸ããå¤æ°ãªãããbashã®ã話ã½ããbashãã使ã£ã¦ãªãã®ã§ã»ãã®ã·ã§ã«ã®ãã¨ã¯åããã¾ããã
ã¡ãªã¿ã«Macでのwhereisコマンドとwhichコマンドの違い - kanonjiの日記ã¨ããã¨ã³ããªã¼ãããã¾ãã
historyã³ãã³ãã«é¢é£ããbashã®å¤æ°
HISTFILE | ãã¹ããªã¼ãã¡ã¤ã«ã®å ´æ |
HISTCMD | 次ã«ã³ãã³ããå®è¡ããéã«ä»ããã¹ããªçªå· |
HISTCONTROL | HISTCONTROL=ignoredups:åãã³ãã³ããé£ç¶ãã¦å®è¡ããéãå±¥æ´ã«ã¯1åã ãè¨é²ãããHISTCONTROL=ignorespace:ã³ãã³ãã®é ã«ãã¯ã¤ãã¹ãã¼ã¹ãã¤ãã¦å®è¡ããã¨ãå±¥æ´ã«è¨é²ãããªããHISTCONTROL=ignoreboth:ignoredupsã¨ignorespaceã®ä¸¡æ¹ãé©ç¨ãããã |
HISTFILESIZE | ãã¹ããªã¼ãã¡ã¤ã«ã«è¨é²ãããè¡æ° |
HISTSIZE | è¨é²ããã¦ããã³ãã³ãã®æ°ããã¹ããªã¼ãã¡ã¤ã«ã§ã¯ãªããä¸ãã¼ãhistoryã³ãã³ãã§è¡¨ç¤ºãããã³ãã³ãæ°ãããã*1ã |
HISTTIMEFORMAT | è¨å®ããã¨å±¥æ´ã«æ¥ä»ã»æéãä»ããããã |
HISTIGNORE | å±¥æ´ã«æ®ããªãã³ãã³ããæå®ãããè¤æ°æå®ããå ´åã¯: ã§åºåãã* ã? ã¨ãã£ãã¯ã¤ã«ãã«ã¼ãã使ãããããã |
å¤æ°ãechoãã¦ã¿ãã
$ bash -version GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0) Copyright (C) 2005 Free Software Foundation, Inc. $ echo $HISTFILE /Users/kanonji/.bash_history $ echo $HISTCMD 509 $ echo $HISTCONTROL $ echo $HISTFILESIZE 500 $ echo $HISTSIZE 500 $ echo $HISTTIMEFORMAT $ echo $HISTIGNORE
ç¹ã«ä½ãè¨å®ãã¦ãªãã®ã§ãMacã§ã®åæå¤ã®ã¯ãã§ãã空è¡ãªã®ã¯ãæªè¨å®ã ããããªã
ç°å¢
Mac | Mac OS X 10.5.8ï¼Leopardï¼ |
bash | GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0) |
åè
*1:ã¡ãã£ã¨ããåãã£ã¦ãªã