{"id":2963,"date":"2021-02-05T00:55:53","date_gmt":"2021-02-04T15:55:53","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=2963"},"modified":"2021-02-10T18:21:01","modified_gmt":"2021-02-10T09:21:01","slug":"display-line-feed-code-etc-with-cat-of-gnu-coreutils","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2021\/02\/05\/display-line-feed-code-etc-with-cat-of-gnu-coreutils\/","title":{"rendered":"GNU coreutils\u306ecat\u3067\u6539\u884c\u30b3\u30fc\u30c9\u306a\u3069\u3092\u78ba\u8a8d\u3059\u308b"},"content":{"rendered":"<div class=\"paragraph\">\n<p>\u6700\u8fd1\u77e5\u308a\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">LC_MESSAGES=ja_JP.UTF-8\u306ecat(1)<\/div>\n<div class=\"content\">\n<pre>$ 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)<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">LC_MESSAGES=C\u306ecat(1)<\/div>\n<div class=\"content\">\n<pre>$ 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<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210<\/div>\n<div class=\"content\">\n<pre>$ echo 'hoge\n&gt;       fuga\n&gt; ' | unix2dos &gt; \/tmp\/test<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">od\u3067\u4e2d\u8eab\u78ba\u8a8d<\/div>\n<div class=\"content\">\n<pre>$ 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<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u666e\u901a\u306bcat<\/div>\n<div class=\"content\">\n<pre>$ cat \/tmp\/test\nhoge\n\tfuga<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>-T<\/code> \u3067TAB\u3092 <code>^I<\/code> \u3068\u3057\u3066\u8868\u793a<\/div>\n<div class=\"content\">\n<pre>$ cat -T \/tmp\/test\nhoge\n^Ifuga<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>-v<\/code> \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<\/div>\n<div class=\"content\">\n<pre>$ cat -v \/tmp\/test\nhoge^M\n\tfuga^M\n^M<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>-t<\/code> \u3067 <code>-vT<\/code> \u3068\u540c\u3058<\/div>\n<div class=\"content\">\n<pre>$ cat -t \/tmp\/test\nhoge^M\n^Ifuga^M\n^M<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>-E<\/code> \u3067\u884c\u672b\u306b$\u3092\u8868\u793a\uff0e\\r\u304c\u3042\u308b\u3068\u982d\u306b\u4ed8\u3044\u3066\u3057\u307e\u3046\u3088\u3046<\/div>\n<div class=\"content\">\n<pre>$ cat -E \/tmp\/test\n$oge\n$\tfuga\n$<\/pre>\n<\/div>\n<\/div>\n<div class=\"quoteblock\">\n<blockquote>\n<div class=\"admonitionblock note\">\n<table  class=\" table table-hover\" >\n<tbody>\n<tr>\n<td class=\"icon\">\n<div class=\"title\">Note<\/div>\n<\/td>\n<td class=\"content\">\n\u8ffd\u8a18 2020-02-10)<br \/>\nDebian\u3067reportbug\u3057\u305f\u3089patch\u304c :)<br \/>\nDebian 11 Bullseye\u3084Ubuntu 21.04\u306b\u5165\u308b\u304b\u306a?<br \/>\n<a href=\"https:\/\/bugs.debian.org\/cgi-bin\/bugreport.cgi?att=1;bug=982208;filename=cat\u2014\u200bshow-ends.diff;msg=10\" class=\"bare\">https:\/\/bugs.debian.org\/cgi-bin\/bugreport.cgi?att=1;bug=982208;filename=cat\u2014\u200bshow-ends.diff;msg=10<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/blockquote>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>-A<\/code> \u3067 <code>-vET<\/code> \u3068\u540c\u3058<\/div>\n<div class=\"content\">\n<pre>$ cat -A \/tmp\/test\nhoge^M$\n^Ifuga^M$\n^M$<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>-n<\/code> \u3067\u884c\u756a\u53f7\u3092\u8868\u793a<\/div>\n<div class=\"content\">\n<pre>$ cat -n \/tmp\/test\n     1\thoge\n     2\t\tfuga\n     3<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>-An<\/code> \u3067\u884c\u756a\u53f7\u3068\u8a18\u53f7<\/div>\n<div class=\"content\">\n<pre>$ cat -An \/tmp\/test\n     1\thoge^M$\n     2\t^Ifuga^M$\n     3\t^M$<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>vim\u3067\u306f <code>:set list<\/code>, <code>:set number<\/code> \u3067\u3060\u3044\u305f\u3044\u540c\u3058\u611f\u3058\u3067\u3057\u3087\u3046\u304b\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">vim<\/div>\n<div class=\"content\">\n<pre>  1 hoge$\n  2 ^Ifuga$\n  3 $<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"data:image\/jpg;base64,\/9j\/4AAQSkZJRgABAQAAAQABAAD\/2wEEEAAUABQAFAAUABUAFAAXABkAGQAXAB8AIgAeACIAHwAuACsAJwAnACsALgBGADIANgAyADYAMgBGAGoAQgBOAEIAQgBOAEIAagBeAHIAXQBWAF0AcgBeAKkAhQB2AHYAhQCpAMMApACbAKQAwwDsANMA0wDsASoBGwEqAYUBhQILEQAUABQAFAAUABUAFAAXABkAGQAXAB8AIgAeACIAHwAuACsAJwAnACsALgBGADIANgAyADYAMgBGAGoAQgBOAEIAQgBOAEIAagBeAHIAXQBWAF0AcgBeAKkAhQB2AHYAhQCpAMMApACbAKQAwwDsANMA0wDsASoBGwEqAYUBhQIL\/8I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UA8htRIjY2Qb96qDRT9NwHB0mMpg9ZnYCyPau4CvOkixjhvIzOHEgHC\/bCkD4+RaEyKgYNfA9wHSFIHx8i0JkVAwa+B7gPux4IngfcLd9wjPjYLOlIbBltUtJIwCFAPIbSkNgy2qWkkYBCgHkN1R41jkVowzNW1r\/HWPkJBTCNi4B530p\/saE8ZhSOSIsUvaQ1d9RTIsTxuhZSwbhtpBHSKZEjkjdCyuVPBogrqCaGOOVHidi4okOF4BB8HWPkJBTCNi4B530pvyNRTIsTxuhZSwbhtpBH2wTQRxyq8TsXWiQ4HFg+DqMQf42QXFvaCPnUE0EccqvE7F1okOBxYPg\/cmdNF6IjZlRO6huG5vSTxqsyNGSjsGADUQV1FMiRyRuhZXKng0QV+b\/8QAIREBAAEDBAIDAAAAAAAAAAAAAQIAETEDECEwEkFAUHH\/2gAIAQIBAT8AqK3l+76pHw0ktjqjK7LkQo59b6kAhpoZOkbyS2KnAjGCeze\/QxTJQBgplJAXHyGS5e1kp2qIcH0\/\/8QAGxEAAgEFAAAAAAAAAAAAAAAAAUEQESAwUWD\/2gAIAQMBAT8AsDxmobnfYf\/Z\" alt=\"vim\"\/><\/span><\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u74b0\u5883<\/div>\n<div class=\"content\">\n<pre>$ cat --version\ncat (GNU coreutils) 8.32\nCopyright (C) 2020 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later &lt;https:\/\/gnu.org\/licenses\/gpl.html&gt;.\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<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u77e5\u308a\u307e\u3057\u305f\uff0e LC_MESSAGES=ja_JP.UTF-8\u306ecat(1) $ LC_MESSAGES=ja_JP.UTF-8 man cat | grep &#8216;\\-A&#8217; -A25 -A, &#8211;show-all -vE [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,199],"tags":[583,378],"class_list":["post-2963","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-sid","tag-cat","tag-gnu-coreutils"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=2963"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2963\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=2963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=2963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=2963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}