From 63da5b3514a58ecc9ae6f4349065af4a714de457 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 26 Jul 2025 10:58:52 +0200 Subject: posix-shell: utils: Add `lar()` The list archive (`lar`) util creates a temporary directory, unpacks the given tar archive into it, switches to that folder, starts the terminal file manager `lf` and on quit jumps back and deletes the temporary directory. This is useful to quickly inspect the contents of a tar archive. --- posix-shell/utils.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'posix-shell') diff --git a/posix-shell/utils.sh b/posix-shell/utils.sh index 596263e..b1ffc21 100644 --- a/posix-shell/utils.sh +++ b/posix-shell/utils.sh @@ -216,3 +216,12 @@ url() { # open selected URL in browser firefox "${url}" } + +lar() { + temp="$(mktemp -d)" + tar -xf "$1" -C "$temp" + pushd "$temp" + lf + popd + rm -rf "$temp" +} -- cgit v1.2.3-70-g09d2