PDA

View Full Version : [all variants] Copy files in subdirectories without directory tree.. Just the Files..



@B6Mwu8fN9M
January 22nd, 2009, 02:06 AM
What happened is that I downloaded many fonts. They came in the form of .zip. I unzipped everything and now I have some ttf files that are in no directory and some are in subdirectories. I want to copy them all at once to ~/.fonts using the terminal. Putting directories in ~/.fonts is not useful because the fonts are not detected if in subdirectories. Does anyone know what I have to do?


Thanks in advance.:)

yeats
January 22nd, 2009, 02:24 AM
In the terminal, go to the directory where the fonts are and do


cp *.ttf ~/.fonts

b0b138
January 22nd, 2009, 02:31 AM
That command won't copy anything in subdirectories.

However, fonts that are in your ~/.fonts or /usr/share/fonts should be found through subfolders. After you copy them there you have to update the font cache.
sudo fc-cache -f -v

sisco311
January 22nd, 2009, 02:32 AM
<EDIT>: b0b138's solution should work.

</EDIT>


find /path/to/fonts -type f -name "*.ttf" -exec cp {} ~/.fonts \;

@B6Mwu8fN9M
January 22nd, 2009, 03:02 AM
Thanks! It seems that copying the folders into ~/.fonts worked. It didn't work when I tried it with different fonts a while ago but now it worked.


Thanks.