Benutzer-Werkzeuge

Webseiten-Werkzeuge


commands-general-tools

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
commands-general-tools [2019/03/13 12:57]
alex [Conversion Stuff] make an image grayscale and remove any transparency with ImageMagick && change the character encoding of a file‘s content
commands-general-tools [2019/03/13 18:38] (aktuell)
alex [Conversion Stuff] file content character/byte occurences
Zeile 232: Zeile 232:
 </​code>​ </​code>​
 [[https://​www.freebsd.org/​cgi/​man.cgi?​query=convert&​sektion=1|convert(1)]] [[https://​www.freebsd.org/​cgi/​man.cgi?​query=ImageMagick&​sektion=1|ImageMagick(1)]] [[https://​www.freebsd.org/​cgi/​man.cgi?​query=convert&​sektion=1|convert(1)]] [[https://​www.freebsd.org/​cgi/​man.cgi?​query=ImageMagick&​sektion=1|ImageMagick(1)]]
 +
 +=== Unix timestamp to human readable time ===
 +<code bash>
 +## with BSD date
 +date -r 1523210382
 +## with GNU date
 +date -d @1523210382
 +</​code>​
 +[[https://​www.freebsd.org/​cgi/​man.cgi?​query=date&​sektion=1|date(1)]] from BSD — [[https://​manpages.debian.org/​stretch/​coreutils/​date.1.en.html|date(1)]] from GNU
  
 === format XML === === format XML ===
Zeile 259: Zeile 268:
 [[https://​www.freebsd.org/​cgi/​man.cgi?​query=recode&​sektion=1|recode(1)]] ​ (more lightweight and probably already installed alternative:​ [[https://​www.freebsd.org/​cgi/​man.cgi?​query=iconv&​sektion=1|iconv(1)]]) [[https://​www.freebsd.org/​cgi/​man.cgi?​query=recode&​sektion=1|recode(1)]] ​ (more lightweight and probably already installed alternative:​ [[https://​www.freebsd.org/​cgi/​man.cgi?​query=iconv&​sektion=1|iconv(1)]])
  
-=== Unix timestamp to human readable time === +=== occurrences of non-ASCII characters in a file‘s content (with GNU grep) === 
-<​code ​bash+<​code>​ 
-## with BSD date +ggrep --color='​auto'​ -P -n "​[\x80-\xFF]"​ file.txt 
-date -r 1523210382 +</​code>​ 
-## with GNU date + 
-date -d @1523210382+=== occurrences of invalid UTF-8 characters in a file‘s content (this assumes you have an UTF-8 locale set) === 
 +<​code>​ 
 +grep -axv '​.*'​ file.txt 
 +</​code>​ 
 +[[https://​stackoverflow.com/​questions/​29465612/​how-to-detect-invalid-utf8-unicode-binary-in-a-text-file|some StackOverflow discussion]] 
 + 
 +=== count how many time each byte value occurs in a file‘s content === 
 +<​code>​ 
 +recode latin1/​..count-characters < input.dat
 </​code>​ </​code>​
-BSD-[[https://​www.freebsd.org/​cgi/​man.cgi?​query=date&​sektion=1|date(1)]] GNU-[[https://​manpages.debian.org/​stretch/​coreutils/​date.1.en.html|date(1)]]+[[https://​www.freebsd.org/​cgi/​man.cgi?​query=recode&​sektion=1|recode(1)]]
 ==== Process Stuff ==== ==== Process Stuff ====
  
commands-general-tools.txt · Zuletzt geändert: 2019/03/13 18:38 von alex