#!/usr/local/bin/python3.9
import os
import glob
import shutil
os.chdir("/root/")
os.mkdir('txt-data')
data=glob.glob("/root/**/*.csv",recursive=True)
for file in data:
    shutil.copy2(file,'/root/txt-data');
-----------------------------------------------
#!/usr/local/bin/python3.9
import os
data=os.popen('df -h').readlines()
for line in data:
    x=line.split()
    if x[-1]=='/':
        print(x[-5])
------------------------------------------------
in directory multiple subdirectory have .txt file and all .txt file data will store in single file and and erage all sub directory
.txt file data.---p-16-12:35--------------------------------------------------------------


import glob

data=glob.glob("/root/abc/**/*.txt",recursive=True)

with open ("all_data.txt","a") as f1:

	for file in data:
		with open(file,"r+") as f2:
			f1.write(f2.read())
			f1.write("*"*30)
			f1.write("\n")
			f2.truncate(0)
------------------------------------------------------------------