man cat
-
-A, --show-all
equivalent to -vET-b, --number-nonblank
number nonblank output lines-e equivalent to -vE
-E, --show-ends
display $ at end of each line-n, --number
number all output lines-s, --squeeze-blank
never more than one single blank line-t equivalent to -vT
-T, --show-tabs
display TAB characters as ^I-u (ignored)
-v, --show-nonprinting
use ^ and M- notation, except for LFD and TAB--help display this help and exit
--version
output version information and exitWith no FILE, or when FILE is -, read standard input.
das ist der Output von man cat von meinem System. Aber es gibt manche Optionen, bei denen ich keine Ahnung habe, was sie machen, ich hab extra Textdateien erstellet, mit normalen und Sonderzeichen, aber die Ausgabe von cat ändert sich nicht, bzw. ich merke keinen Unterschied zu (z.B.) cat a.txt und cat a.txt -v oder cat a.txt -u. Was machen beide Optionen?
-
Hallo,
-u wird ignoriert (steht auch in der Manpage) und -v gibt (praktisch bei DOS-Dateien) CR als ^M aus.
-
nman schrieb:
Hallo,
-u wird ignoriert (steht auch in der Manpage) und -v gibt (praktisch bei DOS-Dateien) CR als ^M aus.ja, -u hab ich jetzt auch selber gefunden (info coreutils cat) hat mehr erklärt, warum das ignoriert wurde.
Zum -v: Wird nur der CR als ^M ausgegeben oder gibt es auch andere Sonderzeichen, die von -v berücksichtigt werden?
-
supertux schrieb:
ja, -u hab ich jetzt auch selber gefunden (info coreutils cat) hat mehr erklärt, warum das ignoriert wurde.
Dass es ignoriert wird steht auch in der Manpage und dass das aus Kompatibilitätsgründen akzeptiert wird, war relativ offensichtlich.
Zum -v: Wird nur der CR als ^M ausgegeben oder gibt es auch andere Sonderzeichen, die von -v berücksichtigt werden?
Da Du ja klugerweise bereits die Infoseite angesehen hast:
`-v' `--show-nonprinting' Display control characters except for LFD and TAB using `^' notation and precede characters that have the high bit set with `M-'. On MS-DOS and MS-Windows, this option causes `cat' to read files and standard input in DOS binary mode, so the CR characters at the end of each line are also visible.
-
tja, da hab ich was überlesen
aber jetzt hat mich etwas verwirrt. CR ist carriage return, das ist also \r, oder? LFD ist ??? Line Feed oder so? LFD ist dann das normale \n oder?
-
supertux schrieb:
aber jetzt hat mich etwas verwirrt. CR ist carriage return, das ist also \r, oder? LFD ist ??? Line Feed oder so? LFD ist dann das normale \n oder?
Jup.