New answers tagged


Here: while :; do cp /a/b/* /c/d/; sleep 60; done It copies the entire content of /a/b/ to /c/d/ every 60 seconds. It does have a drawback: If the files are big (more than a few GB?) then copying might take a while. If this is a problem, comment and I'll implement something optimised for big files (with tail -f) which will also redirect the content in ...


I too would be wary about using directories which are managed by automounters like that. I think /media/ used to be shared by all users, it wouldn't have been so much of a problem... but it seems ugly to use it now, at least on systems like yours. There is not one best practice. E.g. read: Preferred mount points for internal HDDs A subdirectory of /mnt ...


That is up to you, the system administrator, to determine those conventions but it is indeed a good idea to make sure the mounting points can not conflict with anything else. Considering that the mounting point is dynamic in this case, it would be even safer to do them in another level of sub-directory such as /mnt/usb or something similar.


To install to a custom directory, use this: ./configure --prefix=/desired/path make sudo make install By default, programs installed without the added prefix will be located in /usr/local/bin. To verify this, you can type which program_name after installation. If you install your program in a custom directory, it will be installed in /desired/path/bin. ...


du naturally traverses the directory hierarchy and awk can perform the filtering so something like this may be sufficient: du -ak | awk 'BEGIN {sum=0} /\.jpg$/ {sum+=$1} END {print sum}' This works without GNU.

Top 50 recent answers are included