>> Hai milisers, >> >> Saya ingin menghapus banyak file dg rm, masalahnya nama dan lokasi file >> tsb ada di sebuah file daftar.txt, seperti ini contohnya: >> >> $ cat daftar.txt >> /home/data/samba/Data/Master/Office XP/Office XP.exe >> /home/data/samba/Data/Master/Office XP/FILES/MOD/MOD.exe >> /home/data/samba/Data/Master/Office XP/FILES/OSP/1033/1033.exe >> /home/data/samba/Data/Master/Office XP/FILES/OSP/1033/IE5/EN/EN.exe >> >> Cara yg lazim spt ini tdk bisa: >> >> $ for i in `cat daftar.txt`; do rm -f "$i"; done >> > > --- seperti nya ga butuh looping untuk urusan di atas om yudi. cukup : > > $ cat daftar.txt | xargs rm --force > > >> Ada yg tahu caranya ? > > > --- coba gini om : > > [EMAIL PROTECTED] test]$ touch test\ 1.exe > [EMAIL PROTECTED] test]$ touch test\ 2.exe > [EMAIL PROTECTED] test]$ touch test\ 3.exe > [EMAIL PROTECTED] test]$ ls > test 1.exe test 2.exe test 3.exe > [EMAIL PROTECTED] test]$ find . -type f -mtime -1 -print > ./test 1.exe > ./test 2.exe > ./test 3.exe > [EMAIL PROTECTED] test]$ find . -type f -mtime -1 -print0 > ./test 1.exe./test 2.exe./test 3.exe > [EMAIL PROTECTED] test]$ find . -type f -mtime -1 -print0 | xargs -0 rm > [EMAIL PROTECTED] test]$ ls > [EMAIL PROTECTED] test]$ > > cuma trick aja :-) >
--- kalau mau di paksain juga : [EMAIL PROTECTED] test]$ for a in `cat daftar.txt`; do find . -name $a -print0 |xargs -0 rm ; done [EMAIL PROTECTED] test]$ ls 1.txt 2.txt 3.txt daftar.txt test [EMAIL PROTECTED] test]$ for a in `cat daftar.txt`; do find . -name $a -print0; done ./1.txt./2.txt./3.txt./daftar.txt./test [EMAIL PROTECTED] test]$ for a in `cat daftar.txt`; do find . -name $a -print0 |xargs -0 rm ; done [EMAIL PROTECTED] test]$ ls [EMAIL PROTECTED] test]$ silahkan di modip. Regards, ./avd @ http://www.avudz.cc -- FAQ milis di http://wiki.linux.or.id/FAQ_milis_tanya-jawab Unsubscribe: kirim email ke [EMAIL PROTECTED] Arsip dan info milis selengkapnya di http://linux.or.id/milis