{ "version": "https://jsonfeed.org/version/1.1", "user_comment": "This feed allows you to read the posts from this site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL -- https://matoken.org/blog/tag/cat/feed/json/ -- and add it your reader.", "home_page_url": "https://matoken.org/blog/tag/cat/", "feed_url": "https://matoken.org/blog/tag/cat/feed/json/", "language": "ja", "title": "cat – matoken's blog", "description": "Is there no plan B?", "icon": "https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9.jpeg", "items": [ { "id": "http://matoken.org/blog/?p=2963", "url": "https://matoken.org/blog/2021/02/05/display-line-feed-code-etc-with-cat-of-gnu-coreutils/", "title": "GNU coreutils\u306ecat\u3067\u6539\u884c\u30b3\u30fc\u30c9\u306a\u3069\u3092\u78ba\u8a8d\u3059\u308b", "content_html": "
\n

\u6700\u8fd1\u77e5\u308a\u307e\u3057\u305f\uff0e

\n
\n
\n
LC_MESSAGES=ja_JP.UTF-8\u306ecat(1)
\n
\n
$ LC_MESSAGES=ja_JP.UTF-8 man cat | grep '\\-A' -A25\n       -A, --show-all           -vET \u3068\u540c\u3058\n\n       -b, --number-nonblank\n              \u7a7a\u884c\u4ee5\u5916\u306b\u884c\u756a\u53f7\u3092\u4ed8\u3051\u308b\u3002-n \u3088\u308a\u512a\u5148\u3055\u308c\u308b\n\n       -e                       -vE \u3068\u540c\u3058\n\n       -E, --show-ends\n              \u884c\u306e\u6700\u5f8c\u306b $ \u3092\u4ed8\u3051\u308b\n\n       -n, --number\n              \u5168\u3066\u306e\u884c\u306b\u884c\u756a\u53f7\u3092\u4ed8\u3051\u308b\n\n       -s, --squeeze-blank\n              \u9023\u7d9a\u3057\u305f\u7a7a\u884c\u306e\u51fa\u529b\u3092\u884c\u308f\u306a\u3044\n\n       -t                       -vT \u3068\u540c\u3058\n\n       -T, --show-tabs\n              TAB \u6587\u5b57\u3092 ^I \u3067\u8868\u793a\n\n       -u     (\u7121\u8996)\n\n       -v, --show-nonprinting\n              ^ \u3084 M- \u8868\u8a18\u3092\u4f7f\u7528\u3059\u308b (LFD \u3068 TAB \u306f\u9664\u304f)
\n
\n
\n
\n
LC_MESSAGES=C\u306ecat(1)
\n
\n
$ LC_MESSAGES=C man cat | grep '\\-A' -A26\n       -A, --show-all\n              equivalent to -vET\n\n       -b, --number-nonblank\n              number nonempty output lines, overrides -n\n\n       -e     equivalent to -vE\n\n       -E, --show-ends\n              display $ at end of each line\n\n       -n, --number\n              number all output lines\n\n       -s, --squeeze-blank\n              suppress repeated empty output lines\n\n       -t     equivalent to -vT\n\n       -T, --show-tabs\n              display TAB characters as ^I\n\n       -u     (ignored)\n\n       -v, --show-nonprinting\n              use ^ and M- notation, except for LFD and TAB
\n
\n
\n
\n
\u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210
\n
\n
$ echo 'hoge\n>       fuga\n> ' | unix2dos > /tmp/test
\n
\n
\n
\n
od\u3067\u4e2d\u8eab\u78ba\u8a8d
\n
\n
$ od -xc /tmp/test\n0000000    6f68    6567    0a0d    6609    6775    0d61    0d0a    000a\n          h   o   g   e  \\r  \\n  \\t   f   u   g   a  \\r  \\n  \\r  \\n\n0000017
\n
\n
\n
\n
\u666e\u901a\u306bcat
\n
\n
$ cat /tmp/test\nhoge\n\tfuga
\n
\n
\n
\n
-T \u3067TAB\u3092 ^I \u3068\u3057\u3066\u8868\u793a
\n
\n
$ cat -T /tmp/test\nhoge\n^Ifuga
\n
\n
\n
\n
-v \u3067\\n\u3084TAB\u3092\u9664\u304f\u5236\u5fa1\u30b3\u30fc\u30c9\u3092\u8868\u793a\u3053\u3053\u3067\u306f\\r\u304c^M\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u308b
\n
\n
$ cat -v /tmp/test\nhoge^M\n\tfuga^M\n^M
\n
\n
\n
\n
-t \u3067 -vT \u3068\u540c\u3058
\n
\n
$ cat -t /tmp/test\nhoge^M\n^Ifuga^M\n^M
\n
\n
\n
\n
-E \u3067\u884c\u672b\u306b$\u3092\u8868\u793a\uff0e\\r\u304c\u3042\u308b\u3068\u982d\u306b\u4ed8\u3044\u3066\u3057\u307e\u3046\u3088\u3046
\n
\n
$ cat -E /tmp/test\n$oge\n$\tfuga\n$
\n
\n
\n
\n
\n
\n\n\n\n\n\n\n\n
\n
Note
\n
\n\u8ffd\u8a18 2020-02-10)
\nDebian\u3067reportbug\u3057\u305f\u3089patch\u304c :)
\nDebian 11 Bullseye\u3084Ubuntu 21.04\u306b\u5165\u308b\u304b\u306a?
\nhttps://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=982208;filename=cat\u2014\u200bshow-ends.diff;msg=10
\n
\n
\n
\n
\n
-A \u3067 -vET \u3068\u540c\u3058
\n
\n
$ cat -A /tmp/test\nhoge^M$\n^Ifuga^M$\n^M$
\n
\n
\n
\n
-n \u3067\u884c\u756a\u53f7\u3092\u8868\u793a
\n
\n
$ cat -n /tmp/test\n     1\thoge\n     2\t\tfuga\n     3
\n
\n
\n
\n
-An \u3067\u884c\u756a\u53f7\u3068\u8a18\u53f7
\n
\n
$ cat -An /tmp/test\n     1\thoge^M$\n     2\t^Ifuga^M$\n     3\t^M$
\n
\n
\n
\n

vim\u3067\u306f :set list, :set number \u3067\u3060\u3044\u305f\u3044\u540c\u3058\u611f\u3058\u3067\u3057\u3087\u3046\u304b\uff0e

\n
\n
\n
vim
\n
\n
  1 hoge$\n  2 ^Ifuga$\n  3 $
\n
\n
\n
\n

\"vim\"/

\n
\n
\n
\u74b0\u5883
\n
\n
$ cat --version\ncat (GNU coreutils) 8.32\nCopyright (C) 2020 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by Torbjorn Granlund and Richard M. Stallman.\n$ dpkg-query -W coreutils\ncoreutils\t8.32-4+b1\n$ lsb_release -dr\nDescription:\tDebian GNU/Linux bullseye/sid\nRelease:\tunstable\n$ uname -m\nx86_64
\n
\n
\n", "content_text": "\u6700\u8fd1\u77e5\u308a\u307e\u3057\u305f\uff0e\n\n\nLC_MESSAGES=ja_JP.UTF-8\u306ecat(1)\n\n$ LC_MESSAGES=ja_JP.UTF-8 man cat | grep '\\-A' -A25\n -A, --show-all -vET \u3068\u540c\u3058\n\n -b, --number-nonblank\n \u7a7a\u884c\u4ee5\u5916\u306b\u884c\u756a\u53f7\u3092\u4ed8\u3051\u308b\u3002-n \u3088\u308a\u512a\u5148\u3055\u308c\u308b\n\n -e -vE \u3068\u540c\u3058\n\n -E, --show-ends\n \u884c\u306e\u6700\u5f8c\u306b $ \u3092\u4ed8\u3051\u308b\n\n -n, --number\n \u5168\u3066\u306e\u884c\u306b\u884c\u756a\u53f7\u3092\u4ed8\u3051\u308b\n\n -s, --squeeze-blank\n \u9023\u7d9a\u3057\u305f\u7a7a\u884c\u306e\u51fa\u529b\u3092\u884c\u308f\u306a\u3044\n\n -t -vT \u3068\u540c\u3058\n\n -T, --show-tabs\n TAB \u6587\u5b57\u3092 ^I \u3067\u8868\u793a\n\n -u (\u7121\u8996)\n\n -v, --show-nonprinting\n ^ \u3084 M- \u8868\u8a18\u3092\u4f7f\u7528\u3059\u308b (LFD \u3068 TAB \u306f\u9664\u304f)\n\n\n\nLC_MESSAGES=C\u306ecat(1)\n\n$ LC_MESSAGES=C man cat | grep '\\-A' -A26\n -A, --show-all\n equivalent to -vET\n\n -b, --number-nonblank\n number nonempty output lines, overrides -n\n\n -e equivalent to -vE\n\n -E, --show-ends\n display $ at end of each line\n\n -n, --number\n number all output lines\n\n -s, --squeeze-blank\n suppress repeated empty output lines\n\n -t equivalent to -vT\n\n -T, --show-tabs\n display TAB characters as ^I\n\n -u (ignored)\n\n -v, --show-nonprinting\n use ^ and M- notation, except for LFD and TAB\n\n\n\n\u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\n\n$ echo 'hoge\n> fuga\n> ' | unix2dos > /tmp/test\n\n\n\nod\u3067\u4e2d\u8eab\u78ba\u8a8d\n\n$ od -xc /tmp/test\n0000000 6f68 6567 0a0d 6609 6775 0d61 0d0a 000a\n h o g e \\r \\n \\t f u g a \\r \\n \\r \\n\n0000017\n\n\n\n\u666e\u901a\u306bcat\n\n$ cat /tmp/test\nhoge\n\tfuga\n\n\n\n-T \u3067TAB\u3092 ^I \u3068\u3057\u3066\u8868\u793a\n\n$ cat -T /tmp/test\nhoge\n^Ifuga\n\n\n\n-v \u3067\\n\u3084TAB\u3092\u9664\u304f\u5236\u5fa1\u30b3\u30fc\u30c9\u3092\u8868\u793a\u3053\u3053\u3067\u306f\\r\u304c^M\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u308b\n\n$ cat -v /tmp/test\nhoge^M\n\tfuga^M\n^M\n\n\n\n-t \u3067 -vT \u3068\u540c\u3058\n\n$ cat -t /tmp/test\nhoge^M\n^Ifuga^M\n^M\n\n\n\n-E \u3067\u884c\u672b\u306b$\u3092\u8868\u793a\uff0e\\r\u304c\u3042\u308b\u3068\u982d\u306b\u4ed8\u3044\u3066\u3057\u307e\u3046\u3088\u3046\n\n$ cat -E /tmp/test\n$oge\n$\tfuga\n$\n\n\n\n\n\n\n\n\n\nNote\n\n\n\u8ffd\u8a18 2020-02-10)\nDebian\u3067reportbug\u3057\u305f\u3089patch\u304c :)\nDebian 11 Bullseye\u3084Ubuntu 21.04\u306b\u5165\u308b\u304b\u306a?\nhttps://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=982208;filename=cat\u2014\u200bshow-ends.diff;msg=10\n\n\n\n\n\n\n\n-A \u3067 -vET \u3068\u540c\u3058\n\n$ cat -A /tmp/test\nhoge^M$\n^Ifuga^M$\n^M$\n\n\n\n-n \u3067\u884c\u756a\u53f7\u3092\u8868\u793a\n\n$ cat -n /tmp/test\n 1\thoge\n 2\t\tfuga\n 3\n\n\n\n-An \u3067\u884c\u756a\u53f7\u3068\u8a18\u53f7\n\n$ cat -An /tmp/test\n 1\thoge^M$\n 2\t^Ifuga^M$\n 3\t^M$\n\n\n\nvim\u3067\u306f :set list, :set number \u3067\u3060\u3044\u305f\u3044\u540c\u3058\u611f\u3058\u3067\u3057\u3087\u3046\u304b\uff0e\n\n\nvim\n\n 1 hoge$\n 2 ^Ifuga$\n 3 $\n\n\n\n\n\n\n\u74b0\u5883\n\n$ cat --version\ncat (GNU coreutils) 8.32\nCopyright (C) 2020 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\nWritten by Torbjorn Granlund and Richard M. Stallman.\n$ dpkg-query -W coreutils\ncoreutils\t8.32-4+b1\n$ lsb_release -dr\nDescription:\tDebian GNU/Linux bullseye/sid\nRelease:\tunstable\n$ uname -m\nx86_64", "date_published": "2021-02-05T00:55:53+09:00", "date_modified": "2021-02-10T18:21:01+09:00", "authors": [ { "name": "matoken", "url": "https://matoken.org/blog/author/matoken/", "avatar": "https://secure.gravatar.com/avatar/38f5f3b575c5eb45cda6aa659bca119ac7a5e16b46565e869d0030e3bd66981d?s=512&d=mm&r=g" } ], "author": { "name": "matoken", "url": "https://matoken.org/blog/author/matoken/", "avatar": "https://secure.gravatar.com/avatar/38f5f3b575c5eb45cda6aa659bca119ac7a5e16b46565e869d0030e3bd66981d?s=512&d=mm&r=g" }, "tags": [ "cat", "GNU coreutils", "Debian", "Linux", "sid" ] } ] }