shell
çµè« 空æåã§grepããã $ find . | xargs grep ""
ã«ã¬ã³ããã£ã¬ã¯ããªã«ãã*.csvã®æ¡å¼µåã.txtã«å¤ããã for fname in *.csv; do mv $fname ${fname%.csv}.txt; done
çµè« (ãªãããã®ãªã«ã) | tee output.txt ããã§ãoutput.txtã«å®è¡çµæãæ¸ãè¾¼ã¾ãã¤ã¤ãç»é¢ã«ã表示ãããã
ç°ãªããã£ã¬ã¯ããªã«å ¥ã£ãååã®ãã¡ã¤ã«ã1ç®æã«ã¾ã¨ãããã ãã¡ã¤ã«åãåä¸ãªã®ã§ãä½ãã¦ãã¼ã¯ãªååã«å¤ããå¿ è¦ãããã çµè« for i in `find . | grep .gz` do before=$i after=`echo $before | sed 's/\.\///g' | sed 's/\//_/g'` `cp $beforeâ¦
ããã³ãã³ãã®å®è¡çµæã¨ãã¦å¾ããããã¹ã¦ã®è¡ã«å¯¾ãã¦å¥ã®å¦çãè¡ãããã ä¾ãã°find .ã®çµæã«å¯¾ãã¦ç¹°ãè¿ãåãå¦çãé©ç¨ãããã çµè« for line in `find .` ; do ; echo $line ; done 解説 find .ã®çµæãå¤æ°$lineã«æ ¼ç´ãããã echo $lineãfâ¦
çµè« $nohup ã³ãã³ã
çµè« du -d 1ã§OK
çµè« for f in *.csv ; do ;cat $f | iconv -f CP932 > $f.utf8 ; rm $f ; mv $f.utf8 $f ; done 説æ ã·ã§ã«ã§ã¯ã¤ã«ãã«ã¼ãã§æå®ãããã¡ã¤ã«å ¨ã¦ã«å¯¾ãã¦ç¹å®ã®å¦çãããã - æç³»åã®ããªã¼ã©ã³ãshinya131-note.hatenablog.jp Excelã§ä½æãããSJISâ¦
çµè« for f in *.csv ; do ; (ããã好ããªå¦çãæ¸ãã$fã«ãã¡ã¤ã«åãå ¥ã£ã¦ãã) ; done 説æ ã¤ãã¬ã¼ã¿ã¼ã¿ãããªãã¤
çµè« mã³ãã³ãã®mjoin使ãã®ãè¯ããã mjoin k=Ticket m=ticket_duplicate_count_table i=train.csv 説æ i=ã§æå®ãããã¡ã¤ã«ã«ãåã追å ãã¦ããã çµåã®ãã¼ã¯k=ã§æå®ããã«ã©ã ãã¼ã¿ã½ã¼ã¹ã¯m=ã§æå®ããã«ã©ã ãã®ãããªæä½ãã³ãã³ãã©ã¤ã³â¦
çµè« cat ãããã¡ã¤ã« | sort | uniq -c | awk '$1 > 1' 解説 sortãã¦uniq -cãããã¨ã§ã1åç®ã«åºç¾åæ°ã2åç®ã«å 容ãåºåãããã awkã§1åç®ã2以ä¸ã«ãªã£ã¦ããè¡ï¼ï¼éè¤ããè¡ï¼ãåãåºãã¦ãã
çµè« -Iãªãã·ã§ã³ã使ãã find .| xargs -I{} cp {} ~/scenario Man page of XARGS 解説 -Iãªãã·ã§ã³ã§ç½®æ対象æåãæå®ã§ããã
çµè« find .ã§å ¨ãã¡ã¤ã«åãåå¾ãã¦æ£è¦è¡¨ç¾ã§æ¢ã $ find . -type f | awk -F / '{print $NF}' | awk '!/^[a-zA-Z0-9._-]+$/' has_space_file_name 2.png has_ampersand_file&name.jpg æ¥æ¬èªã®ãã¡ã¤ã«å.txt 説æ find . -type f | # å ¨ãã¡ã¤ã«åãåâ¦
aliasä¾¿å© shellã®aliasã¯ä¾¿å©ãªæ©è½ã ã ãã使ãã³ãã³ãã«ç縮åãè¨å®ãã¦ã·ã§ã«ã®æä½ãå¹çåãããã¨ãã§ããã #.zshrc alias g='git' $ g status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working diâ¦
çµæã¤ã¡ã¼ã¸ ãããã .zshrcã«ãããè¿½è¨ ## enterããããæã«ls & git status function do_enter() { if [ -n "$BUFFER" ]; then zle accept-line return 0 fi echo echo -e "\e[0;33m--- ls ---\e[0m" ls # âãããã # ls_abbrev if [ "$(git rev-parsâ¦
vcs_infoã¨ããzshã®æ¡å¼µæ©è½ã使ãã°å®ç¾ã§ããã ã§ããã ä¾ .zscrhã®ä¸ã«ãããªæãã§æ¸ãã autoload -Uz vcs_info ## ããã³ããã表示ãããæ¯ã«å®è¡ãããé¢æ° precmd () { vcs_info } ## prompt ### vcs_info 表示å 容ãã«ã¹ã¿ãã¤ãº zstyle ':vcs_â¦
çµè« .zshrcã§PROMPTå¤æ°ãè¨å®ããã°ããã ä¾ ãã®ããã«è¨å®ãã: # .zshrc PROMPT="%~ %# " 以ä¸ã®ããã«ãªã: ~/Desktop % %~ã¯ã«ã¬ã³ããã£ã¬ã¯ããªã表ãã ãã®ãããªç¹æ®å¤æ°ãããã¤ãç¨æããã¦ããã®ã§å¥½ããªããã«ã«ã¹ã¿ãã¤ãºããã ç¶ã ã°ã°â¦
èª²é¡ Terminalã§exitããæã«[ããã»ã¹ãå®äºãã¾ãã]ãªã©ã¨è¡¨ç¤ºããã¦ãå³åº§ã«ã¿ããéããªãããã®æåãå¤ãããã 解決ç command + ,ã§Terminalã®è¨å®ãéããã·ã§ã«çµäºæ:ã®åä½ãã¦ã¤ã³ãã¦ãéããã«ããã°è¯ãã