我正在使用rsync递归到该目录中的所有文件(包括子目录中的所有文件):
rathi/20090209.02s1.1_sequence.txt
rathi/20090209.02s1.2_sequence.txt
rathi/20090729.02s4.2_sequence.txt.gz
rathi/Homo_sapiens_UCSC_hg19.tar.gz
rathi/SRR002321.fastq.bz2
rathi/SRR002322.fastq.bz2
rathi/SRR002323.fastq.bz2
rathi/SRR002324.fastq
rathi/SRR002324.fastq.bz2
rathi/human_g1k_v37.fasta.gz
rathi/s_1_1_sequence.txt
rathi/s_1_sequence.txt
rathi/tesssssssssssssssssssssssssssssstttttttt.txt
rathi/test_data.tar.gz
rathi/Homo_sapiens
rathi/Homo_sapiens/UCSC
rathi/Homo_sapiens/UCSC/hg19
rathi/Homo_sapiens/UCSC/hg19/Annotation
rathi/Homo_sapiens/UCSC/hg19/Annotation/Archives
rathi/Homo_sapiens/UCSC/hg19/Annotation/Archives/ok.txt
我对此有一个问题。目录清单,例如
rathi/Homo_sapiens/UCSC
rathi/Homo_sapiens/UCSC/hg19
rathi/Homo_sapiens/UCSC/hg19/Annotation
rathi/Homo_sapiens/UCSC/hg19/Annotation/Archives
对我没有用。我只想获取文件路径。只能与rsync一起使用吗?我subprocess.call用来在Python中调用rsync。
所以,我希望我的输出是这样的:
rathi/20090209.02s1.1_sequence.txt
rathi/20090209.02s1.2_sequence.txt
rathi/20090729.02s4.2_sequence.txt.gz
rathi/Homo_sapiens_UCSC_hg19.tar.gz
rathi/SRR002321.fastq.bz2
rathi/SRR002322.fastq.bz2
rathi/SRR002323.fastq.bz2
rathi/SRR002324.fastq
rathi/SRR002324.fastq.bz2
rathi/human_g1k_v37.fasta.gz
rathi/s_1_1_sequence.txt
rathi/s_1_sequence.txt
rathi/tesssssssssssssssssssssssssssssstttttttt.txt
rathi/test_data.tar.gz
rathi/Homo_sapiens/UCSC/hg19/Annotation/Archives/ok.txt
尚方宝剑之说
繁星coding
aluckdog
相关分类