I have a bunch of text files in several directories I want to copy into another. What can I do, instead of going inside each directory and cp *.txt in this directory?
How can I find just the *.mp3 files with a recursive command like ls -R *.mp3 in a directory that contains several sub-directories and at the end copy these files in a directory that I choose.  Thanks for your support.
How can I remove duplicates in my .bash_history, preserving order? I really enjoying using control+r to recursively search my command history. I've found a few good options I like to use with it: # ignore duplicate commands, ignore commands starting with a space export HISTCONTROL=erasedups:ignorespace  # keep the last 5000 entries export HISTSIZE=5000  # append to the history instead of overwriting (good for multiple connections) shopt -s histappend  The only problem for me is that erasedups only erases sequential duplicates - so that with this string of commands: ls cd ~ ls  The ls command will actually be recorded twice. I've thought about periodically running w/ cron: cat .bash_history | sort | uniq &gt; temp.txt mv temp.txt .bash_history  This would achieve removing the duplicates, but unfortunately the order would not be preserved. If I don't sort the file first I don't believe uniq can work properly. How can I remove duplicates in my .bash_history, preserving order? Extra Credit: Are there any problems with overwriting the .bash_history file via a script? For example, if you remove an apache log file I think you need to send a nohup / reset signal with kill to have it flush it's connection to the file. If that is the case with the .bash_history file, perhaps I could somehow use ps to check and make sure there are no connected sessions before the filtering script is run? What does this pen notation in my UK entry stamp mean? I entered the UK from Paris once (riding the Eurostar train), and after the UK border control officer placed an entry stamp in my passport, he added a notation in pen (picture below).  What does it mean?  I suspect it is some sort of "warning" (the border control officer was not happy with me, though thankfully did not refuse entry).  I've always been curious about what it means more precisely or whether my prediction is even correct.  I've entered the UK only once again after getting this stamp.  I was admitted then too, but it took a while (the border control officer went away for about 10 minutes to do something before letting me in). Creating a single index from several principal components or factors retained from PCA/FA I am using Principal Component Analysis (PCA) to create an index required for my research. My question is how I should create a single index by using the retained principal components calculated through PCA.  For instance, I decided to retain 3 principal components after using PCA and I computed scores for these 3 principal components. What is the appropriate ways to create, for each respondent, a single index out of these 3 scores?   Is it relevant to add the 3 computed scores to have a composite value? Or to average the 3 scores to have such a value?  Or should I just keep the first principal component (the strongest) only and use its score as the index?   Alternatively, one could use Factor Analysis (FA) but the same question remains: how to create a single index based on several factor scores? I have a current view set up that displays a feed of stories and is sorted in descending order. I now need to have the first 4 stories display as a different style then the remaining ones. I have pagination set to 10. I only want the first 4 to show differently on page 1, and then the current style will show on the remaining pages. Is there a way to do this? Which Defiant was shown in ST: First Contact? In Memory Alpha, the page on the  states that two Defiant-class ships had that name: the prototype Defiant, and a successor, the U.S.S. Sao Paulo, which was assigned to DS9 and renamed Defiant after the loss of the original. All of this happened during the DS9 series.  In the Star Trek: First Contact movie, the Defiant participates in the opening battle, where a Borg Cube penetrates the Sol system's defenses and besieges Earth. Worf is in command, and is transported out of the crippled Defiant along with whatever's left of his crew by the Enterprise; out-of-universe, this is a rather transparent method to get Worf back into the TNG side of things after the events of ST: Generations, when he moved to DS9 as tactical officer and unofficial envoy to the Klingon Empire.  The question is, was Worf's Defiant in the movie the original, or the Sao Paulo? This would primarily depend on where the movie falls in the overall canon timeline. According to in-movie dialog, whichever one it was was salvageable and therefore would have survived the movie, so the movie would have had little impact on the canon of any running TV series at the time. Install button in the software center is grayed out when trying to install .debs without an internet connection I just installed ubuntu 11.10 from a usb stick.   After installation, none of the software which I had collected and run on 11.10 or 11.04 runs on it. Even my newly downloaded opera or chrome installations does not work.  I do not have a internet connection.  Whenever i try to install any .deb file by double clicking it,software center opens up but the install button is grayed out. $\bigcup \emptyset$ is defined but $\bigcap \emptyset$ is not. Why? Why does $\bigcup \emptyset = \emptyset$ but $\bigcap \emptyset$ is not defined?    If I had to guess, I'd say it's also equal to $\emptyset$. How can I communicate with a Unix domain socket via the shell on Debian Squeeze? I’m running a Debian Squeeze web server. I’ve installed memcached on it, and configured memcached to listen on a Unix domain socket (at /tmp/memcached.sock), as it only needs to receive messages from the website, which lives on the same server.  It seems to be working fine, but I’d also like to communicate with memcached via the shell, to check that it’s doing what I think it’s doing.  memcached accepts messages via a simple ASCII protocol (if I understand correctly). If it was listening on TCP/IP, I could send messages to it via e.g. nc:  $ echo "stats settings" | nc localhost 11211   But I can’t figure out how to send that text to the domain socket instead.  On my laptop (which runs OS X Lion), both nc and telnet have options (-U and -u respectively) to use domain sockets. However, on my Debian Squeeze web server, these options aren’t present. Backup GNOME-Terminal Google map signed api key errors in Android How to return only the Date from a SQL Server DateTime datatype SELECT GETDATE()   Returns: 2008-09-22 15:24:13.790  I want that date part without the time part: 2008-09-22 00:00:00.000  How can I get that? Add ability to flag answers as duplicates Can HTML checkboxes be set to readonly? Precedence between implication and bi-implication I came across this question:  Let p, q, and r be the propositions  p : Grizzly bears have been seen in the area. q : Hiking is safe on the trail. r : Berries are ripe along the trail. Write these propositions using p, q, and r and logical connectives (including negations).     If berries are ripe along the trail, hiking is safe if and   only if grizzly bears have not been seen in the area.   I see an If r,q iff ~p where If r,q is the part "If berries are ripe along the trail, hiking is safe" and ~p is "grizzly bears have not been seen in the area"  and I came up with (r -&gt; q) &lt;-&gt; ~p  But the answer given is: r -&gt; (q &lt;-&gt; ~p)  Can someone please explain the difference in precedence? Lualatex and bm package I've updated my latex packages yesterday and have now issues with lualatex. One problem arising for me now is, that lualatex does not print bold characters using the bm package.  When I compile the following MWE with pdflatex everything looks okay, but for lualatex it doesn't:  \documentclass{article} \usepackage{bm} \begin{document} % Bold $\bm{E}$ \\ Normal $E$ % \end{document}   Output using pdflatex    using lualatex    Also trying to fall back to an earlier version of lualatex by using \RequirePackage{luatex85} does not work for me.  When having a look at the log file, there are the suspicious messages   LaTeX Font Info:    Redeclaring math alphabet \mathbf on input line 142. LaTeX Info: Redefining \bm on input line 208. [...] Missing character: There is no х (U+0445) in font cmmi10!   Can anyone tell me, what is going on here and what I need to do to solve this problem, since I am quite sure lualatex and bm worked before? How do I end a Tkinter program? Let's say I have this code:  from Tkinter import *  def quit():     # code to exit  root = Tk() Button(root, text="Quit", command=quit).pack() root.mainloop()   How should I define the quit function to exit my application? Deriving Newton's Third Law from homogeneity of Space Why does the new review page sometimes shows questions to vote to close without anybody having voted to close it? I was reviewing  for , and noticed that nobody voted to close it, even though the page reports a duplicate.      Why does this happen? I have been trying to show these two inequalities hold for all positive integers n, but I don't know how to proceed at all... I have tried playing around with them but I didn't find anything helpful. I have also tried induction but I couldn't make it work. If $G$ is abelian, then the set of all $g \in G$ such that $g = g^{-1}$ is a subgroup of $G$ Prove that if $G$ is abelian then the set $H$ of all elements of $G$ that are their own inverses is a subgroup of $G$.   Naturally in an abelian group, $ab = ba$ for $a, b \in G$, however I'm not sure how to show the set elements that are their own inverses is a subgroup of $G$ using arbitrary elements.