en ese caso te recomendaria hacer un bash asi:
#!/bin/bash
# Check if two parameters are provided
if [ $# -ne 2 ]; then
echo "Usage: $0 <new_directory> <file.ar>"
exit 1
fi
dir=$1
file=$2
mkdir -p "$dir"
if [ $? -ne 0 ]; then
echo "Failed to create directory: $dir"
exit 1
fi
tar xf "$file" -C "$dir"
# Check if extraction was successful
if [ $? -ne 0 ]; then
echo "Failed to extract archive: $file"
exit 1
fi
echo "Extraction successful."
ejecutas como
$ nano ~/bin/extracttar.sh
$ chmod 750 ~/bin/extracttar.sh
$ export PATH="/home/yourUSER/bin:$PATH"
$ extracttar.sh nuevo salida.tar
Extraction successful.