I am trying to create a tar file of an existing file or directory (
file_dir_name) in a specified directory (
dir_path). I need the tar file to be named
new_name.tar in the new directory. However, when I execute the below command, the tar file is saved in the directory I am currently in. Can anyone help me fix this?
tar -cvf "$new_name.tar" "$file_dir_name" -C "$dir_path"