NoPaste

catallfiles

von heisenberg
SNIPPET_DESC:
zeigt alle dateien - egal wie komprimiert - an
SNIPPET_CREATION_TIME:
14.10.2020 21:06:35
SNIPPET_PRUNE_TIME:
Unendlich

SNIPPET_TEXT:
  1. catfile() {
  2.  
  3.         local file="$1"
  4.  
  5.         command="cat"
  6.         [[ "$file" =~ \.xz$             ]] && command=xzcat
  7.         [[ "$file" =~ \.gz$             ]] && command=zcat
  8.         [[ "$file" =~ \.bz(ip)?2$       ]] && command=bzcat
  9.  
  10.         $command "$file"
  11.  
  12. }
  13.  
  14. catallfiles() {
  15.         for logfile in $(ls -1 "$@" | xargs ls -1tra);do
  16.                 catfile $logfile
  17.         done
  18. }

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN