aboutsummaryrefslogtreecommitdiffstats
path: root/.zsh.after
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2019-03-19 15:13:06 +0100
committerDavid Runge <dave@sleepmap.de>2019-03-19 15:13:06 +0100
commit5b4f0f0cabe4ae5940a9f739a07a0e561c6f4d87 (patch)
tree1ae0251a498f84b1c80ebd59a0e9481f00a409c9 /.zsh.after
parent2fa2ef3c1c95a242b2c7eecea2a290861d351897 (diff)
downloaddotfiles-5b4f0f0cabe4ae5940a9f739a07a0e561c6f4d87.tar.gz
dotfiles-5b4f0f0cabe4ae5940a9f739a07a0e561c6f4d87.tar.bz2
dotfiles-5b4f0f0cabe4ae5940a9f739a07a0e561c6f4d87.tar.xz
dotfiles-5b4f0f0cabe4ae5940a9f739a07a0e561c6f4d87.zip
.zsh.after/functions.zsh: Adding function to display contents of various compressed files.
Diffstat (limited to '.zsh.after')
-rw-r--r--.zsh.after/functions.zsh44
1 files changed, 44 insertions, 0 deletions
diff --git a/.zsh.after/functions.zsh b/.zsh.after/functions.zsh
index e2af147..16dc6de 100644
--- a/.zsh.after/functions.zsh
+++ b/.zsh.after/functions.zsh
@@ -200,6 +200,50 @@ ex2() {
fi
}
+lstar() {
+ if [ -f "$1" ] ; then
+ case "$1" in
+ *.bz2)
+ tar -tvf "$1" --force-local
+ ;;
+ *.gz)
+ tar -tvf "$1" --force-local
+ ;;
+ *.rar)
+ unrar lb "$1"
+ ;;
+ *.tar)
+ tar -tvf "$1" --force-local
+ ;;
+ *.tbz2)
+ tar -tvf "$1" --force-local
+ ;;
+ *.tgz)
+ tar -tvf "$1" --force-local
+ ;;
+ *.xz)
+ tar -Jtvf "$1" --force-local
+ ;;
+ *.zip)
+ unzip -l "$1"
+ ;;
+ *.Z)
+ uncompress $1
+ ;;
+ *.7z)
+ 7z l "$1"
+ ;;
+ *)
+ echo "Don't know how to look into $1"
+ exit 1
+ ;;
+ esac
+ else
+ echo "'$1' is not a file!"
+ exit 1
+ fi
+}
+
## RSYNC
backupinfo() {