List the content of the tar archive
for tar archives
tar -tvf archive.tar
for tar.gz archives
tar -ztvf archive.tar
for tar.bz2 archives
tar -jtvf archive.tar
Then to extract the single file
tar -ztvf archive.tar.gz # to see the whole archive
tar -zxvf archive.tar.gz /root/my/file.txt # to get the file or directory
tar -zxvf archive.tar.gz {path/to/file}
might be wise to use -C target_dir aswell so we dont overwrite it!