I tried to replace the existing file with ">" symbol but it ends up with empty file, can someone help me to check my code?  $ grep -c "ERROR" server.log.2016-03-15  633 $ grep "ERROR" server.log.2016-03-15 &gt;error  $ grep -c "ERROR" error  633 $ grep -c "Login errors" error  95 $ grep "ERROR" error | grep -v "Login errors" &gt;error $ grep -c "ERROR" error  0
I was trying to remove all the lines of a file except the last line but the following command did not work, although file.txt is not empty.  $cat file.txt |tail -1 &gt; file.txt  $cat file.txt   Why is it so?
How to connect to Android through SSH over 3G/4G public IP? Is there a way to add a timer to a Beamer presentation? How many "super imaginary" numbers are there? How many "super imaginary" numbers are there? Numbers like $i$? I always wanted to come up with a number like $i$ but it seemed like it was impossible, until I thought about the relation of $i$ and rotation, but what about hyperbolic rotation? Like we have a complex number $$ z = a + bi $$ can describe a matrix $$ \begin{bmatrix} a &amp; -b \\ b &amp; a\end{bmatrix} $$ You can "discover" $i$ by doing (which is used for another discovery) $$ \begin{pmatrix} a \\ b \end{pmatrix} \cdot \begin{bmatrix} c &amp; -d \\ d &amp; c\end{bmatrix} = \begin{pmatrix} ac - bd \\ ad + bc \end{pmatrix} $$ $$ (a + bi) \cdot (c + di) = ac + adi + bci + bdi^2 $$ From here on you can infer that $ i^2 = -1 $.  So what if we do the same thing, but a different matrix? $$ z = a + bh$$ can describe a matrix $$ \begin{bmatrix} a &amp; b \\ b &amp; a\end{bmatrix} $$ and we can discover it the same way $$ \begin{pmatrix} a \\ b \end{pmatrix} \cdot \begin{bmatrix} c &amp; d \\ d &amp; c\end{bmatrix} = \begin{pmatrix} ac + bd \\ ad + bc \end{pmatrix} $$ $$ (a + bh) \cdot (c + dh) = ac + adh + bch + bdh^2 $$ From here we infer that $ h^2 = 1 $.  Also $$ e^x = 1 + \frac{x}{1!} + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \frac{x^5}{5!} + \cdots  $$ $$ \begin{align} e^{xh} &amp; = 1 + \frac{xh}{1!} + \frac{(xh)^2}{2!} + \frac{(xh)^3}{3!} + \frac{(xh)^4}{4!} + \frac{(xh)^5}{5!} + \cdots \\ &amp; = 1 + \frac{xh}{1!} + \frac{x^2}{2!} + \frac{x^3h}{3!} + \frac{x^4}{4!} + \frac{x^5h}{5!} + \cdots \\ &amp; = \cosh{x} + h \cdot \sinh{x} \end{align} $$  How many more numbers like this are there? And does that mean that for each set of trigonometric functions there exists a number which can turn multiplication into a rotation using those trigonometric functions?  (Sorry if I got some things wrong) How can I change my Minecraft username? Proof that all abelian simple groups are cyclic groups of prime order Just wanted some feedback to ensure I did not make any mistakes with this proof. Thanks!  Since $G$ is abelian, every subgroup is normal. Since $G$ is simple, the only subgroups of $G$ are $1$ and $G$, and $|G| &gt; 1$, so for some $x\in G$ we have $x\neq 1$ and $\langle x\rangle\leq G$, so $\langle x\rangle = G$. Suppose $x$ has either infinite order or even order. Then $\langle x^2\rangle \leq G$ but $\langle x^2\rangle \neq \langle x \rangle$, a contradiction. So $x$, and therefore $G$, has odd order, and by Feit-Thompson, $G\cong Z_p$ for some prime $p$.  Edit: Thanks, I see that Feit-Thompson is too much.  Since $G$ is abelian, every subgroup is normal. Since $G$ is simple, the only subgroups of $G$ are $1$ and $G$, and $|G| &gt; 1$, so for some $x\in G$ we have $x\neq 1$ and $\langle x\rangle\leq G$, so $\langle x\rangle = G$. Suppose $x$ has infinite order. Then $\langle x^2\rangle \leq G$ but $\langle x^2\rangle \neq \langle x \rangle$, a contradiction. So $x$, and therefore $G$, has finite order. Suppose $x$ has composite order $n$ so for some $p &gt; 1$ that divides $n$, $\langle x^p \rangle$ is a proper non-trivial subgroup of $G$, so $G$ is not simple. So $G$ is a cyclic group of prime order. Who was the piano player that Starbuck met in the bar on Galactica? Towards the end of season four, Starbuck meets a piano player in the makeshift bar on Galactica.  Now, it appears that this guy is some kind of ghost/angel like Caprica-6 and the ghost Baltar - but I have an idea that he could also be the original copy of the seventh model (Daniel). It's mentioned right in the episode before that Cavil poisoned all of the bodies that were being prepared to accept a copy of Daniel - but it's ambiguous about the fate of the original cylon with that personality. Daniel was also mentioned as an 'artist' and 'sensitive' person.  So - could it have been Daniel that helped Starbuck realise what the music meant? What is needed for a game's stats to be saved? Last night I played a few games with my friend. While in the last game, I suddenly remembered something I had to do and was about to leave but my friend told me that I would lose my progress if I did so. I stayed until the end, through the scoreboard screen and quit while the next map was loading. Taking a look  now, I can't see any of yesterday's games. I don't remember how much XP I had yesterday so there is no sure way for me to check that. I had gotten a dozen ribbon and I don't see them in the feed, but there could be specific conditions to be showing them.  My questions then.   If you quit a game early, do you lose progress / XP? What if you quit on the scoreboard? Do you need to wait for the next map to load to save your progress? Any idea why the games aren't showing up? Some of them I definitely waited for the next map to load. Is there a delay for them to be shown on Battlelog?   Thanks. C++: delete vs. free and performance Possible Duplicate:          As answered in  I want to use git diff --color=always filename | less -r to get a colored output of my git diffs. Since I use this a lot it would be nice to set up an alias for this. But how to include the filename in this command?  I tried the following without success:  alias gdiff='git diff --color=always $1 | less -r'   Typing gdiff example.php displays the content of example.php with less but ignores the diff part.  Any ideas? View history of changes Possible Duplicate:          How do I view the changes made to a question, in the SO-style visual diff?  I'm sure I've seen this before, but the "history" button eludes me. Clicking "edit" gives me a drop down of the revisions, but not the actual diff.    Edit  This edit is a demonstration of the revision history functionality. Input password into SSH without typing When creating accounts on Windows 10, you get a choice between "Your family" and "Other users".  If you choose "Your family" you are forced to use a Microsoft account to sign in. There are various reasons why one wouldn't want to do that, such as too much sharing of private information with Microsoft, etc.  If you choose "Other users" you can create regular accounts just fine. However, if you need to setup time limits for some accounts, it is impossible to do so. It is a feature exclusive to "Your family". Not all time-restricted users I want to create are my family, and not everyone is okay with sharing their info with Microsoft.  So, is there a way to setup login time limits for the "Other users" type of accounts? $X=(-\infty,0]\cup\left\{{1\over n}:n\in\mathbb N\right\}$ with subspace topology Then $X=(-\infty,0]\cup\left\{{1\over n}:n\in\mathbb N\right\}$ with subspace topology. Then   $0$ is an isolated point $(-2,0]$ is an open set $0$ is a limit point of the subset $\left\{{1\over n}:n\in\mathbb N\right\}$ $(-2,0)$ is open set.   $0$ is not an isolated point of $X$ as every nbd of $0$ contains a point of the form $1\over n$ so  $3$ is true and $1$ is false, $2$ is false as $0$ is not interior point, $4$ is true as every point is interior point. Am i right? Delete questions/answers in iOS app There is currently no way to delete questions or answers in the iOS app, even with the required Trusted User privilege. We can edit and vote, but not delete.  Can this option please be added to the app? Top Down RPG Movement w/ Correction? I would hope that we have all played Zelda: A Link to the Past, please correct me if I'm wrong, but I want to emulate that kind of 2D, top-down character movement with a touch of correction. It has been done in other games, but I feel this reference would be the easiest to relate to.  More specifically the kind of movement and correction I'm talking about is:   Floating movement not restricted to tile based movement like Pokemon and other games where one tap of the movement pad moves you one square in that cardinal direction. This floating movement should be able to achieve diagonal motion. If you're walking West and you come to a wall that is diagonal in a North East/South West fashion, you are corrected into a South West movement even if you continue holding left (West) on the controller. This should work for both diagonals correcting in both directions. If you're a few pixels off from walking squarely into a door or hallway, you are corrected into walking through the hall or down the hallway, i.e. bumping into the corner causes you to be pushed into the hall/door.   I've hunted for efficient ways to achieve this and have had no luck. To be clear I'm talking about the human character's movement, not an NPC's movement. Are their resources available on this kind of movement? Equations or algorithms explained on a wiki or something?  I'm using the XNA Framework, is there anything in it to help with this? unable to printout arrayOfInt initialised within the class constructor What is a bus error? What does the "bus error" message mean, and how does it differ from a segfault? Prove that at most $2k+1$ independent sets form the set of vertices of a graph, where $k$ is the maximum degree. whether it be vs whether it is I brought the sentences from the speech about conversation tips.     They don’t just want to know about news and the weather.   They want to know about you.   So what are three things that you have going on right now, that you can talk about.   Whether it be school, whether it be a personal relationship, whether it be a hobby that you’re involved with.   My questions:     What is the difference in nuance between 'whether it is' and 'whether it be'?   Before posting this question, I googled, and some websites say 'whether it be' is subjunctive. I don't get why it is called 'subjunctive'. Because from what I know about subjunctive, it's supposed to be past of be verb.    If I say 'whether it should be' or whether it would be', is the meaning same? How to execute a script just by double clicking like .EXE files in Windows?