I know this questions has been asked a lot in variations, but I cannot get this specific problem solved. I have a folder structure like this: -A --reports -B --reports -C --reports -...  I want to delete all PDFs in each 'reports' folder, that is older than 14 days. Of course I could do this with a loop in a bash script, but a oneliner (will be executed in a k8 cron jon) would be much easier to maintain.
I have found the command to delete files older than 5 days in a folder  find /path/to/files* -mtime +5 -exec rm {} \;   But how do I also do this for subdirectories in that folder?
While all the Hobbits I can think of have a combination of first- and lastname (e.g., Bilbo Baggins, Peregrin Took, the Sackville-Baggins's,...), I can't think of any character* of another race that has a lastname:   Men seem to like to add a reference to their ancestors (e.g., Aragorn, Arathorn's son or Isildur's heir) Dwarves seem to like descriptive or honorary names (e.g., Thorin Oakenshield, Dain Ironfoot). They are not lastnames though, since they do not get passed on to descendants. Elves don't have a need for lastnames, since elvish names are unique. Some nevertheless seem to have an additive (e.g., Legolas Greenleaf). Likewise, I can't find any usage of lastnames among Ents, Eagles, Istari, Orcs, trolls,...   But why would a society that is quite rural and not a leader of modernization be the only one to use a modern naming system with first- and lastnames?  *Except for Tom Bombandil. But he is, well, "special". How to remove all files and subdirectories in a directory WITHOUT deleting the directory in bash? Is there a command to remove all files and subdirectories in a directory without deleting the directory?  For example if I have directory dontDeleteMe with subdirectories 1, 2, 3 and each subdirectory has a few pictures in it, how can I remove the subdirectories 1, 2, and 3 and all the files in the them, without removing the parent directory dontDeleteMe? "wait more than" vs. "wait FOR more than" When punctuating the dimensions of something, if both dimensions share the same units, does the punctuation occur after each measurement or just after the last one. For example, if I'm looking at a sheet of paper, which is correct: {8 1/2 x 11"} or is {8 1/2" x 11"}? I read that it makes a difference whether you calculate $\frac{dE(\lambda) }{d \lambda}=0$ or $\frac{dE(\omega)}{d \omega}=0$ in the sense that the maximum energy density with respect to the wavelength does not coincide with the frequency maximum that one would assume to be at $\omega_{max} = \frac{c}{\lambda_{max}}$. Actually, I do not understand why this is so ( Now, I am only interested in a pure physical explanation, mathematically this is clear and due to the chain rule). Does anybody know how to explain this odd thing?  Somehow I feel that the core of the question has not been completely answered. Although I can easily look up wikipedia, where the need for the chain rule is explained, I am rather interested in understanding where the following argument breaks down, which seems to be why this question has caused some confusion in the past(as you can see by googling this question):  So we have $E(\omega)$ the energy radiated at a given frequency. Now this function has a maximum somewhere, so there is a frequency where a maximal amount of energy is emitted. In other words: If you add the sum of the photon's energies at each frequency that are emitted, you will notice that the maximum is reached at this frquency. Now $E(\lambda)$ tells you basically the same for the wavelength, but again: We know where at which frequency the maximal amount of energy is radiated, so we know the corresponding wavelength.   I think there is a need to explain this.   If anything is unclear, please let me know. Regular cast vs. static_cast vs. dynamic_cast String representation of an Enum I have the following enumeration:  public enum AuthenticationMethod {     FORMS = 1,     WINDOWSAUTHENTICATION = 2,     SINGLESIGNON = 3 }   The problem however is that I need the word "FORMS" when I ask for AuthenticationMethod.FORMS and not the id 1.  I have found the following solution for this problem ():  First I need to create a custom attribute called "StringValue":  public class StringValue : System.Attribute {     private readonly string _value;      public StringValue(string value)     {         _value = value;     }      public string Value     {         get { return _value; }     }  }   Then I can add this attribute to my enumerator:  public enum AuthenticationMethod {     [StringValue("FORMS")]     FORMS = 1,     [StringValue("WINDOWS")]     WINDOWSAUTHENTICATION = 2,     [StringValue("SSO")]     SINGLESIGNON = 3 }   And of course I need something to retrieve that StringValue:  public static class StringEnum {     public static string GetStringValue(Enum value)     {         string output = null;         Type type = value.GetType();          //Check first in our cached results...          //Look for our 'StringValueAttribute'           //in the field's custom attributes          FieldInfo fi = type.GetField(value.ToString());         StringValue[] attrs =            fi.GetCustomAttributes(typeof(StringValue),                                    false) as StringValue[];         if (attrs.Length &gt; 0)         {             output = attrs[0].Value;         }          return output;     } }   Good now I've got the tools to get a string value for an enumerator. I can then use it like this:  string valueOfAuthenticationMethod = StringEnum.GetStringValue(AuthenticationMethod.FORMS);   Okay now all of these work like a charm but I find it a whole lot of work. I was wondering if there is a better solution for this.  I also tried something with a dictionary and static properties but that wasn't better either. Identifying which part of a large document is being compiled Ubuntu 16.10 Dual Boot error - 'grub-efi-amd64-signed' package failed to install How to restrict a user from accessing a particular application? I want to restrict an application being opened under ordinary privileges. Only root shall run the application, so that contents wont be seen by others and they wont change anything. OLS is BLUE. But what if I don't care about unbiasedness and linearity? How can an uneducated but rational person differentiate between science and religion? I recently found myself unable to respond to the statement "But the big bang theory is just another creation myth!" during a science vs. religion argument. I found it very difficult to explain the difference between the big bang theory and creation myths without going through a crash course in Newtonian and then Relativistic mechanics.   This had me thinking of the following scenario: Consider a person who for various reasons never got a formal education beyond basic reading and writing. He/She doesn't know any science or math, and was never exposed to any scientific reasoning and experiments. She/He is however an open minded, level headed, and rational person (I've met more than one such person myself).   How would such a person differentiate science from religion? As far as he/she is concerned science has the exact same structure as religion:    A hard to understand scripture: Science treatises and journal papers.  An ordained clergy with a high entry barrier: Doctors, professors, scientists, etc... Seemingly arbitrary injunctions against certain behaviors: "Don't smoke", "Don't pollute",.... Various metaphysical (from his/her perspective) claims about the world around us: The big bang, other galaxies, blackholes, quarks,... Organizations which control and oversee doctrine: The FDA, The NIH, The NFS,...   From his/her perspective, all of these characteristics are no different than the way organized religion presents itself as being the source of truths about the world.   In particular if such a person were to heed the advice of the :         Do not go upon what has been acquired by repeated hearing (anussava),   nor upon tradition (paramparā),   nor upon rumor (itikirā),   nor upon what is in a scripture (piṭaka-sampadāna)   nor upon surmise (takka-hetu),   nor upon an axiom (naya-hetu),   nor upon specious reasoning (ākāra-parivitakka),   nor upon a bias towards a notion that has been pondered over (diṭṭhi-nijjhān-akkh-antiyā),   nor upon another's seeming ability (bhabba-rūpatāya),   nor upon the consideration, The monk is our teacher (samaṇo no garū) Kalamas, when you yourselves know: "These things are good; these   things are not blamable; these things are praised by the wise;   undertaken and observed, these things lead to benefit and happiness,"   enter on and abide in them.'      Following the Buddha's advice (ironically himself a religious figure), such a rational but uneducated person would have just as much reason to doubt the various results of scientists as to doubt the dogmas of organized religion.    How would it be possible for such a person to distinguish scientific facts from religious dogma?  How can we convince such a person of the validity of ideas like those of modern cosmology or evolutionary biology, without first having to teach them enough biology and physics to understand those concepts? maximum of two uniform distributions I have a question. Let's suppose that the two random variables $X1$ and $X2$ follow two Uniform distributions that are independent but have different parameters:  $X1 \sim Uniform(l1, u1)$  $X2 \sim Uniform(l2,u2)$  If we define X3 as the maximum of X1, and X2, i.e., $X3 = max(X1, X2)$, what kind of distribution would it be? It is certainly not a uniform and I can calculate the cumulative probability, i.e., $p(X3 &lt;= a)$, because $p(X3 &lt;= a) = p(X1 &lt;= a) p(X2 &lt;= a)$. But, I wonder if there exists any density function that can model X3. Scanner issue when using nextLine after nextXXX Why is any pgr_* routing function taking forever based on OSM data in an pgrouting enabled DB Which lenses should be included in a travel photography kit? On a crop sensor camera, e.g. Canon EOS 7D, what would be the best kit to travel with around Europe for a few weeks? My shooting style will focus on landscape, architecture, and general travel shots (of note would be my lack of interest for portraits).     Limit to around 1-3 lenses, and I prefer light ones.   Crop sensor camera chosen to save on weight over a full frame option. Question is open to all brands for general guidance, but I will be using a Canon body.   Cost is not a factor, I will rent the lenses I do not already own.   Quality is of paramount importance. I will not have a tripod.   I understand some may consider this subjective, but I do believe that for a crop sensor body, with weight as a consideration, and a limit to the amount of lenses, a true best kit can be determined. How to Disable new terms (free tagging) with Taxonomies? I have a "term reference" field, in a form that uses an auto-complete widget. I want to limit user input to terms in the vocabulary only, and output a message when a user tries to enter a non existing term.  I found the  module. However this does not work with forms that contain a field collection or a field group.  There is also a contributed patch . But I was wondering whether there was a simpler/cleaner solution like a module or maybe I missed an already existing way of doing it with latest drupal and taxonomy versions. QGIS ->ArcGIS Server configuration possible? Is it possible to connect a QGIS Desktop 1.8.0 to an ArcGIS Server 10.0 ? and of course publish services on it?.   The configuration would be like this Quantum GIS-> ArcGIS Server 10.0 on Amazon EC2+ POstgreSQL (+PostGIS)-> web app.   Is it possible to create a configuration like this? Do you think I could use it for networking? We know that the addition and multiplication operators are both commutative, and the exponentiation operator is not.  My question is why.  As background there are plenty of mathematical schemes that can be used to define these operators. One of these is   where $H_0(a,b) = b+1$   (successor op) $H_1(a,b) = a+b$   (addition op) $H_2(a,b) = ab $   (multiplication op) $H_3(a,b) = a^b$   (exponentiation op) $H_4(a,b) = a\uparrow \uparrow b$   (tetration op: $a^{(a^{(...a)})}$ nested $b$ times ) etc.    Here it is not obvious to me why $H_1(a,b)=H_1(b,a)$ and $H_2(a,b)=H_2(b,a)$ but not $H_3(a,b)=H_3(b,a)$  Can anyone explain why this symmetry breaks, in a reasonably intuitive fashion?  Thanks. How does asymmetric encryption work? I've always been interested in encryption but I have never found a good explanation (beginners explanation) of how encryption with public key and decryption with private key works.  How does it encrypt something with one key and decipher it with another key?