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

前端 未结 18 822
孤城傲影
孤城傲影 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:52

    You can also create archive as usual and extract it with:

    tar --strip-components 1 -xvf my_directory.tar.gz
    

提交回复
热议问题