I have a main directory bp and it has many sub-directories bp01, bp02, bp04. In each directory it has a file and the name of each file is randomly but start with co. I want to change each file name the same as its parent directory.  The following is the structure of my folder:    I want it look like this:    I am green hand in Linux,hope some one can help me. Thank you:)
I have to deal with a large number of files nested inside of directories (one file per directory), resembling something like this:  fred/result.txt john/result.txt mary/result.txt ...   I am currently using the following command to process each of those files:  find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c \"cd '{}' &amp;&amp; processResult result.txt\" \;   I am looking for something I can add into the end of this command that will change the filenames to fred.txt, etc. and then later move the file into the parent directory to eliminate the extra layer of directories.  What would be the best way to do this?
This might be a bizarre but crucial question, can I fully trust leaving my laptop in repairs (Genius Bar) while they have full access to it ?  I recently went to the genius bar to get my display fixed, and apparently they asked for my laptop's password just in case they need some "testing" after they're done. Can't they do that as a guest account ?  I got sensitive information on my laptop such as passport copies etc, as well as passwords saved in Safari's keychains for my bank account, paypal, amazon etc ..  The service is due later on today, shall I change my password and ask them to contact me directly if they need something specific ?? They're going to fix in 3 hours so I'll be in the mall whilst they finish. Recommendations on a free library to be used for zipping files I need to zip and password-protect a file. Is there a good (free) library for this?  This needs to be opened by a third party, so the password protection needs to work with standard tools. Why don't absorption and emission lines cancel out in our Sun? I was looking at  on why  and emission lines don't cancel out:      An experiment shining light on the material and looking at the   reflected spectrum will see absorption lines at those frequencies,   because the relaxation of the excited electrons will emit back   radiation all around randomly, whereas the reflected spectrum is at a   specific angle.   However it is not totally convincing to me. The photons that get emitted towards the center of the Sun (by the electrons in higher energy states that absorbed a photon earlier) would get absorbed again when they hit a different electron (and then re-emitted) and would eventually make it out. So why don't absorption and emission lines cancel out in our Sun? Repeating an equation including its content and number Showing that $Q_n=D_n+D_{n-1}$ Let $T_n$ be the set of permutations of $\{1,2,\ldots,n\}$ which do not have $i$ immediately followed by $i+1$ for $1\le i\le n-1$; in other words, let \begin{align} T_n=\{\sigma \in S_n: \sigma(i)+1\ne\sigma(i+1) \text{ for all } 1\le i\le n-1\} . \end{align} Let $Q_n$ be the number of elements of $T_n$.    Let $D_n$ be the number of  of $\{1,2,\ldots,n\}$.  It is not hard to show algebraically that $Q_n=D_n+D_{n-1}$, but I am having difficulty coming up with a combinatorial argument to show why this is true.  (I believe there are $D_{n-1}$ elements of $T_n$ that leave $n$ fixed, and $D_n$ elements of $T_n$ that move $n$, but I don't know how to justify this combinatorially.) Prove that there is a bijection between the set of all subsets of $X$, $P(X)$, and the set of functions from $X$ to $\{0,1\}$. Given any set $X$, let $P(X)$ be the set of all subsets of $X$, and let $\{0,1\}^X$ be the set of all functions $X \rightarrow \{0,1\}$. Construct a bijection (and its inverse) between P(X) and $\{0,1\}^X$.    Let us define $f: P(X) \rightarrow \{0,1\}^X$ by $f(\alpha) = g_{\alpha}$ where $\alpha \in P(X)$ and $g_{\alpha} : X \rightarrow \{0,1\}$ is defined by  $$g_{\alpha}(x) =\begin{cases}        1 &amp; x \in \alpha \\       0 &amp; x \in X-\alpha     \end{cases}$$  We need to check if this function is well-defined. Let $\alpha, \beta \in P(X)$. If $\alpha=\beta$, then $\alpha$ and $\beta$ correspond to the same set, and so correspond to the same function since both $g_{\alpha}$ and $g_{\beta}$ send that set to 1 and the ($X-$that set) to 0.   If we have a function $g_{\alpha} \in \{0,1\}$, then $\alpha$ is a set in $X$ that is sent to 1. But since $P(X)$ is the set of all sets of $X$, we must have $\alpha \in P(X)$. So the function is surjective.  Finally, if $g_{\alpha}=g_{\beta}$ then both $g_{\alpha}$ and $g_{\beta}$ send the set $\alpha$ or $\beta$ to 1. So $\alpha$ and $\beta$ must be same set. In other words, the function is injective; and hence bijective.   The inverse function is $f^{-1}: \{0,1\}^X \rightarrow P(X)$ where $f^{-1}(g_{\alpha}) = \alpha$.     Another way to prove this is to first construct the inverse function, show that it is well defined, and then show that $ff^{-1}$ and $f^{-1}f$ are the identity functions, right?  So if we let $g_{\alpha}=g_{\beta}$, then $\alpha=\beta$, because otherwise $g_{\alpha} (\beta)=0$ and $g_{\beta} (\beta)=1$; a contradiction.   Now we have $f \circ f^{-1} (g_{\alpha}) = f(\alpha) = g_{\alpha}$ and $f^{-1} \circ f(\alpha) = f^{-1}(g_{\alpha}) = \alpha$ , and so $f$ and $f^{-1}$ must be bijective. How to prove $\text{Rank}(AB)\leq \min(\text{Rank}(A), \text{Rank}(B))$? Find generator of multiplicative group of $\mathbb{F}_{27}$ I have a finite field $\mathbb{F}_{27}$. I need to find an element of order 13. I know that multiplicative group of this field is cyclic with order 26. So I want to find a generator $g$ of this cyclic group, then $g^2$ will have order 13. Also I know that all elements of this field can be represented by polynomials from $\mathbb{F}_3[t]$, where t is root of irreducible polynom $x^3-x-1$.  Probably we can find generator of $\mathbb{Z}_{26}$ and than build an isomorphism to $\mathbb{F}_{27}\setminus 0$.  Anyway I don't know were to start.  Thanks! Position vs Part How can I define a custom listing environment? I am trying to define an enviroment for a specific programming language, F#. Here's my code:  \definecolor{bluekeywords}{rgb}{0.13,0.13,1} \definecolor{greencomments}{rgb}{0,0.5,0} \definecolor{turqusnumbers}{rgb}{0.17,0.57,0.69} \definecolor{redstrings}{rgb}{0.5,0,0}  \lstdefinelanguage{FSharp}     {morekeywords={let, new, match, with, rec, open, module, namespace, type, of, member, and, for, in, do, begin, end, fun, function, try, mutable, if, then, else},     keywordstyle=\color{bluekeywords},     sensitive=false,     morecomment=[l][\color{greencomments}]{///},     morecomment=[l][\color{greencomments}]{//},     morecomment=[s][\color{greencomments}]{{(*}{*)}},     morestring=[b]",     stringstyle=\color{redstrings}     }  \newenvironment{fslisting}   {     \lstset{         language=FSharp,         basicstyle=\ttfamily,         breaklines=true,         columns=fullflexible}     \begin{lstlisting}   }   {     \end{lstlisting}   }   Then I'm trying to use it as such:  \begin{fslisting} type 'a Process = 'a Signal IObservable \end{fslisting}   But it doesn't work. The output log says that the listing is not terminated - or is terminated by the document. So the rest of the document is also formatted as a listing, which is of course not the intention.  What am I doing wrong here? Speed of object towards a point not in the object's trajectory? When clicking between "Week", "Month", "Quarter", "Year" and "All" on the users page, the name I have typed in to filter on disappears. I feel like it should stay there, so that I can type in my name, and see how I've done in a week/month/etc. Is it possible to include one CSS file in another? Is it possible to include one CSS file in another? Given the positive integer numbers $n$,prove that $$\sum_{k=1}^{2^{n-1}}\sigma{(2^n-2k+1)}\sigma{(2k-1)}=8^{n-1}$$  where $\sigma(n)$ is defined as $$\sigma{(N)}=\sum_{d|N}d$$  This problem I think is very interesting, and have nice methods?  Thank you everyone.  and I find some of this     or can see: How do I Uninstall Windows 10 or Windows 10 preview? Where does the partial derivative come from in Sakurai's derivation of the momentum operator? How is the momentum operator derived in Dirac formalism? I am reading Quantum Mechanics by Sakurai and he gives the following derivation. But I don't understand how he goes from the third equation to the last equation in (1.7.15). What I don't understand is where the partial derivative with respect to $x^{\prime}$ comes from. Here is the derivation from the book.     Momentum Operator in the Position Basis      We now examine how the momentum operator may look in the $x$-basis - that is, in the representation where the position eigenkets are used as base kets. Our starting point is the definition of momentum as the generator of infinitesimal translations:      $$\begin{align} \biggl(1 - \frac{ip\Delta x'}{\hbar}\biggr)\lvert\alpha\rangle &amp;= \int dx' \mathcal{J}(\Delta x')\lvert x'\rangle\langle x'\lvert\alpha\rangle \\ &amp;= \int dx' \lvert x' + \Delta x'\rangle\langle x'\lvert\alpha\rangle \\ &amp;= \int dx' \lvert x'\rangle\langle x' - \Delta x'\lvert\alpha\rangle \\ &amp;= \int dx' \lvert x'\rangle\biggl(\langle x'\lvert\alpha\rangle - \Delta x'\frac{\partial}{\partial x'}\langle x'\lvert\alpha\rangle\biggr).\tag{1.7.15} \end{align}$$      Comparison of both sides yields      $$p\lvert\alpha\rangle = \int dx'\lvert x'\rangle\biggl(-i\hbar\frac{\partial}{\partial x'}\langle x'\lvert\alpha\rangle\biggr)\tag{1.7.16}$$      or      $$\langle x'\rvert p\lvert\alpha\rangle = -i\hbar\frac{\partial}{\partial x'}\langle x'\lvert\alpha\rangle,\tag{1.7.17}$$ Linearization of PDE: $0$ is an eigenvalue since all translates of travelling waves are also travelling waves If n is such that every element $(\mathbb{Z}/n\mathbb{Z})^{\times}$ is a root of $x^2-1$. Prove that $n$ divides 24. How can I easily share links or text between my Android phone and my laptop? Do continuous linear functions between Banach spaces extend?