I want to copy every .ttf file to current working directory but nothing seems to happen.
I am currently using this command :
find / | grep .ttf | xargs cp .
The detection is fine, if i run find / | grep .ttf it gives me the exact location
of every .ttf file in my disk.
but it just doesn't work with xargs cp .
I already tried this method to delete every file containing a word like this:
find / | grep chrome | xargs rm -rf
The method is fine, So what am i missing ?
The syntax is
cp <source> <destination>. When you usexargs cp .it expands tocp . <files found>which is why it doesn't work.If your
cpsupports-toption, you can usexargs cp -t .since-thelps you specify the destination directory. But I'd suggest to usefind+execand this will also avoid issues due to shell metacharacters in filenames: