How do I tar a directory of files and folders without including the directory itself?

前端 未结 18 637
孤城傲影
孤城傲影 2021-01-29 17:04

I typically do:

tar -czvf my_directory.tar.gz my_directory

What if I just want to include everything (including any hidden system files) in my_

18条回答
  •  时光说笑
    2021-01-29 17:51

    Use pax.

    Pax is a deprecated package but does the job perfectly and in a simple fashion.

    pax -w > mydir.tar mydir
    

提交回复
热议问题