Linux

全ユーザーのcronの設定を確認する

/var/spool/cron/ディレクトリ配下にユーザー名のファイルがあるのでそれが、それぞれのユーザーの設定しているcronです。

ls /var/spool/cron/
root user1 user2

などと表示される

tar ballが .gzだろうが.xzだろうが.zstだろうが解凍してやる!

TL;DR

#!/bin/bash

untar_by_file_type() {
  if [[ "$1" == "application/x-tar" ]]; then
    tar -xvf "$2" 
  elif [[ "$1" == "application/gzip" ]]; then
    tar -zxvf "$2" 
  elif [[ "$1" == "application/x-xz" ]]; then
    tar -Jxvf "$2" 
  elif [[ "$1" == "application/zstd" ]]; then
    tar --use-compress-program unzstd -xvf "$2"
  fi
}

untar() {
  if [[ "$1" == "" ]]; then
    echo "usage: untar <archive-filename>"
    exit 1
  fi
  untar_by_file_type "$(file -b --mime-type "$1")" "$1"
}

untar "$@"

パスの通ってるところに置くか、~/.zshrc やら ~/.bash_profileやらに関数を追記