sort

SORT(1)                     General Commands Manual                    SORT(1)



å称
       sort - ããã¹ããã¡ã¤ã«ãè¡ã§ã½ã¼ããã

æ¸å¼
       sort [-cmus] [-t separator] [-o output-file] [-bdfiMnr] [+POS1 [-POS2]]
       [-k POS1[,POS2]] [file...]

解説
       sort ã¯ãfile ãæå®ããã¦ããã°ãã®ãã¡ã¤ã«ããããã¡ã¤ã«ãæå®ãããªã ã `-'
       ã§ããã°ãæ¨æºå¥åãèªã¿è¾¼ã¿ãå¥åããåè¡ãæ¯è¼ãã¦ãã½ã¼ããè¡
       ãªããçµæãæ¨æºåºåã«åºåãã¾ãã

       æ¬ sort ã¯ãGNU ãã¼ã¸ã§ã³ã®ã½ã¼ãã§ãã大ãã次㮠3 ã¤ã®ã¢ã¼ãã«åããã¾ãã
       ã½ã¼ã (ããã©ã«ã) ã¨ããã¼ã¸ã¨ããã§ãã¯ã§ãã以ä¸ã®ãªãã·ã§ã³ã§
       åä½ã¢ã¼ããå¤æ´ãã¾ãã

       -c     ãã¡ã¤ã«ãæ¢ã«ã½ã¼ãããããã®ã§ãããã©ãããã§ãã¯ãã¾ãã
              ãããã½ã¼ãããã¦ãªããã°ãã¨ã©ã¼ã¡ãã»ã¼ã¸ã表示ããã¨å±ã«ã æ»ãå¤ã« 1
              ãè¿ãã¾ãã

       -m     è¤æ°ã®ãã¡ã¤ã«ã®éã§ã½ã¼ãããªãããã¼ã¸ãã¾ããåãã®ãã¡ã¤ã«ã¯ã
              ãããããã½ã¼ããã¦ãããªããã°ãªãã¾ããã
              åç´ã«åãã¡ã¤ã«ãé£çµããå¾ã½ã¼ããããããåãã«ã½ã¼ãå¾ãæ¬
              ãªãã·ã§ã³ã§ã½ã¼ãããªãããã¼ã¸ããæ¹ãé«éã§ãã

       ãã®ä»ã«ã次ã®ãªãã·ã§ã³ãããã¾ãã

       -b     åè¡ã®æ¯è¼ã®éãé ã«ãã空ç½ãç¡è¦ãã¾ãã

       -d     è¾æ¸é ã§ã½ã¼ããã¾ããã¢ã«ãã¡ããããæ°åã空ç½ä»¥å¤ã®æåãç¡è¦ãã¾ãã

       -f     è±å¤§æåã¨å°æåã®åºå¥ããã¾ããã

       -i     ASCII ã³ã¼ãã® 32ã126 (空ç½ãã `~'ã¾ã§) ã«å«ã¾ããªãæåãç¡è¦ãã¾ãã

       -M     空ç½ãç¡è¦ããæåã®æååã®ãã¡ã3 æåããæã®å称ã®çç¥ã¨ã¿ãªã㦠`jan' <
              `feb' < ... < `dec' ã®é ã§ã½ã¼ããã¾ããæã®å称ã«ãªãæåå
              ããã£ãå ´åã¯ãjan (1æ) ããããã«åã«åºåãã¾ãã

       -n     æååããæ°åã¨ã¿ãªãã¦æ¯è¼ãã¾ãã

       -r     æ¯è¼ã®é çªãéã«ãã¾ãã

       -o output-file
              çµæãæ¨æºåºåã«åºåãã代ããã«ã output-file ã«åºåã
              ã¾ããåºåãã¡ã¤ã«ããå¥åãã¡ã¤ã«ã¨åããã¡ã¤ã«åã®å ´åã§ãã
              ãã³ãã©ãªãã¡ã¤ã«ãä½ã£ã¦å¦çããã®ã§ãåé¡ããã¾ããã

       -u     ã½ã¼ã (ããã©ã«ã) ããã³ãã¼ã¸ ( -m ãªãã·ã§ã³) åä½æãéè¤ããè¡
              ããã£ãå ´åã¯ãæåã® 1 è¡ã ãåºåããå¾ã¯åºåããªãããã«ãã¾
              ããã½ã¼ãæ¸ã¿ãã®ãã§ãã¯( -c ãªãã·ã§ã³) ã®å ´åã¯ãéè¤ããå容
              ã®è¡ãé£ç¶ãã¦ãªãäºããã§ãã¯ãã¾ãã

       -t separator
              separator ã§æå®ããæåãããã£ã¼ã«ãã®åºåã¨ã¿ãªãã¾ãã

       sort ã¯ãããã©ã«ãã§ã¯åè¡ã®åé ããå¨ã¦ã®æåãè¦ã¦ã½ã¼ããè¡ãã¾ããã
       次ã®ãªãã·ã§ã³ã«ããç¹å®ã®ãã£ã¼ã«ãã ãã«æ¯è¼ãéå®ãããã¨ãã§ãã¾ãããªãã -t
       ãªãã·ã§ã³ã§åºåæåãæå®ããªãå ´åã¯ã空ç½ã§ãªãæå㨠空ç½æå‐
       ã®éã«ãã£ã¼ã«ãã®åºåããåå¨ãããã®ã¨ã¿ãªãã¾ãããã®ããã ä¾ãã°ã` foo bar'
       ã¨ããè¡ã¯ã` foo' 㨠` bar' ã¨ãã 2 ã¤ã®ãã£ã¼
       ã«ãã¨ã¿ãªããã¾ããããã«å¯¾ããåºåæåãæå®ããå ´åããã®æåãé¤ã
       ãé¨åããã£ã¼ã«ãã¨ãªãã¾ãããã®ãããä¾ãã°ã``,'' ãåºåæåã¨ãã å ´åã``foo,,,bar''
       ã¨ããè¡ã¯ã``foo'' 㨠2 ã¤ã®ç©ºæåå㨠``bar'' ã® 4 ã¤ã®ãã£ã¼ã«ãã«åããã¾ãã

       +POS1 [-POS2]
              æåã®ãã£ã¼ã«ãã 0 çªã¨ãã¦é çªã«æ°ãã¦ããã POS1 çªãããPOS2 ã®å
              (POS2ãçç¥ããå ´åã¯ãæå¾) ã¾ã§ã«ãè¡ã®æ¯ è¼ãéå®ãã¾ãã POS1ãPOS2 ã«ã¯ã
              ãã£ã¼ã«ãçªå·ã®å¾ã«ããªãªããä»ãã¦ããã£ã¼ ã«ãåã®ä½æåç®ãã (POS2
              ãªãä½æåç®ã¾ã§) ã対象ã¨ãããæå®ã ããã¨ãã§ãã¾ãããããæåã®æåã 0
              çªã¨æ°ããããã``+0.1'' ãªããæåã®ãã£ã¼ã«ãã® 2 æåç®ããã対象ã«ãªãã¾ãã

       -k POS1[,POS2]
              ãã£ã¼ã«ãã®æå®ã®ãã 1 ã¤ã®æ¸å¼ã§ãã +POS1 [-POS2]
              ã¨ã»ã¼åãã§ãããæåã®ãã£ã¼ã«ãããã³æå ã®æåã 1 çªã¨ãã¦æ°ãã¾ãã

æ»ãå¤
       æåããå ´åã¯ã0 ããã¨ã©ã¼ããããå ´åã¯ã0 ãã大ããª
       å¤ãè¿ãã¾ãããã ããã½ã¼ãæ¸ã¿ãã©ããã®ãã§ãã¯åä½ã§ãã½ã¼ã ããã¦ãªãå ´åã 1
       ãè¿ãã¾ãã

ç°å¢å¤æ°
       TMPDIR ãã³ãã©ãªãã¡ã¤ã«ãä½ãæã®ä½æ¥ãã£ã¬ã¯ããªãæå®ãã¾ããããã© ã«ãã§ã¯ /tmp
              ã使ç¨ãã¾ãã



                                                                       SORT(1)