如何在不保留目录结构的情况下 tar 目录的某些文件?

How do I tar the certain files of a directory without retaining the directory structure?

我通常这样做:

tar czf $directory_path/file_${1}.tar.gz --目录=$specified_path/ *${1}.csv .

如果我只想包含目录的某些文件而不是目录本身怎么办?

cd [dir]; tar cz ./* >x.tgz

cd [dir]; tar cz file1 file2 >x.tgz