tarball wont/cant create directory from script

Trying to correctly extract tarball:
1
2
tar xjvf lplinux.tar.bz2
cd lplinux && ./install_lastpass.sh

lplinux is never created though. What am I doing wrong here?
What error do you get?

Does this display anything?
tar -tjf lplinux.tar.bz2 | head
tar xjvf lplinux.tar.bz2
cd lplinux && ./install_lastpass.sh
bash: cd: lplinux: No such file or directory

tar -tjf lplinux.tar.bz2 | head
install_lastpass.sh
uninstall_lastpass.sh
nplastpass
nplastpass64



1. Modern tar (or at least the version in RHEL) detects compression. Hence
tar tvf lplinux.tar.bz2
tar xf lplinux.tar.bz2

should work.

2. If head shows only 4 lines, then the tarball has only 4 files, for head shows (up to) 10 lines by default.

3. Those four lines show no "lplinux". If the tarball has no directories in it, then extracting from it will not create any directories.

4. I have a habit of first looking at the tarball contents with 'tar tvf' before I decide where I want to extract from it. In case of "no directories" tarball I would first create a directory and then extract there.

5. Where did you get your mantra:
tar xjvf lplinux.tar.bz2 && cd lplinux && ./install_lastpass.sh
Your tar file doesn't create directory lplinux, it unpacks to the current directory. So you need to create it yourself:
1
2
3
4
mkdir lplinux
cd lplinux
tar -xjf ../lplinux.tar.bz2
./install_lastpass.sh
Last edited on
Topic archived. No new replies allowed.