Linux Command Line Tar – Error When Extracting Tar File in Satrap Folder

command linelinuxtar

I am new in Linux , when I want to extract the tar file in the folder satrap I get this error :

You may not specify more than one `-Acdtrux' or `--test-label' option
Try `tar --help' or `tar --usage' for more information.

I write this command in Linux :

tar  -xf  satrap.tar.gz -c /satrap_dir

please help me .

Best Answer

Options are case sensitive. Your command as written is simultaneously trying to extract data (-x) and create it (-c). From context it looks like you actually want to change directory for the extraction (-C). The untested command therefore becomes,

tar -xf satrap.tar.gz -C /satrap_dir

Please note that generally you shouldn't be writing into a root level folder (/satrap_dir). That's what your own home directory is for.

Related Question