Artificial intelligent assistant

tar: extract single file to a directory without creating subfolders My goal is to get the `helm` binary from `helm-v2.5.0-linux-amd64.tar.gz` into my `/usr/local/bin` in as few steps as possible. The challenge is that the `.tar.gz` file contains the binary in a `linux-amd64` subdirectory. So when I do this: $ wget -P /tmp $ tar -xzvf /tmp/helm-v2.5.0-linux-amd64.tar.gz -C /usr/local/bin linux-amd64/helm I end up with `/usr/local/bin/linux-amd64/helm` instead of `/usr/local/bin/linux-amd64/helm`. Is there a `tar` parameter I am missing or do I need to include some `mv` & cleanup steps?

You need to use `--strip-components=NUMBER`:


--strip-components=NUMBER
Strip NUMBER leading components from file names on extraction.


which means that your command should look like this:


tar -xzvf /tmp/helm-v2.5.0-linux-amd64.tar.gz -C /usr/local/bin --strip-components=1 linux-amd64/helm

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 0bca5a21446eaedda5f5a3404069b439