https://www.google.de/search?q=byobu+tmux&tbm=isch
It's a fancy statusbar that shows CPU speed, IP-address, hostname, ...
Screenshot: http://i.imgur.com/u6JY0.png
Config file: https://github.com/tylerkahn/dotfiles/blob/master/.tmux.conf...
Works with OSX and Linux.
Spong 'soaks up' input an releases it all on one chunk so that you can do things like:
cat foo | sponge foo
(`cat foo > foo` does not work)That's neat and all, but what if you don't have sponge? Well, just use tac twice!
cat foo | tac | tac > foo
(Obviously this is rather wasteful ;))"cat foo > foo" breaks, because the shell truncates the file "foo" while it's setting up the redirection, before it launches "cat foo", and so cat has nothing to read.
"cat foo | sponge foo" works because the shell is not responsible for writing to foo; it launches cat (which opens the file for reading) then launches sponge (which eventually opens the file for writing).
I would thus expect "cat foo | tac | tac > foo" to fail in the same way as "cat foo > foo" because the shell is still going to open the file foo and truncate it, but experimentation shows that it does actually work. Is it because the shell launches each pipeline one at a time, so cat has read the file before "tac > foo" truncates it? Is it a race-condition or a corner-case?
Furthermore `cat foo | cat > foo` does not work, but `cat foo | cat | cat > foo` does work.
I suspect this behavior is actually a race condition of some sort.
Edit: definetly a race condition, shown by larger files:
% wc -l foo
1310720 foo
% cat foo | cat | cat > foo
% wc -l foo
16384 1 : Just use it in :
: vi with your cursor in front of a badly wrapped block of text. :
: Press !}par<enter> and the text will be :
: piped to par :
: which fixes up :
: the :
: formatting and keeps aligned frame markers :
: intact magically. :
: Just use it in vi with your cursor in front of a badly wrapped :
: block of text. Press !}par<enter> and the text will be piped :
: to par which fixes up the formatting and keeps aligned frame :
: markers intact magically. :
http://www.nicemice.net/par/ (or apt-get install par) export CDPATH=.:~/projects
export PS1="$(uname -n)$ "
alias ltr='ls -ltr'
More of a procedure, always list file and edit the command before deleting it: $ ll file.txt
-rw-r--r-- 1 zera staff 0 Jan 7 20:28 file.txt
Ctrl-p, Ctrl-a, Ctrl-d, Ctrl-d, r,m
$ rm file.txt
So this is a sanity check to avoid this mistake: $ rm *.txt
*Edit, one more:Ensure you overwrite a file (or aren't):
$ cp -i ~/file.config /etc/ alias lsd="ls -ltrF | grep ^d"
Helps me quickly list only directories. Any better alternatives ?$ find . -type d -maxdepth 1
% ls -d */
find . -type d
edit: for the same output as your command you can use: dir -lfind -maxdepth 1 -type d
alias lsd='ls -d */'I know, it's a bad habit
slless. Overkill, but SO MUCH BETTER THAN tail -f. Seriously. You can toggle "follow mode" without losing your place in the incoming stream.
If you do this on my servers, I am going to find you, and then I am going to kill... um... your process.
less with SHIFT-F takes a whole CPU core to run on a busy log file. tail -f takes almost nothing to run. Now combine that information with the reality of a whole bunch of devs who don't know it or don't care about it. :(
tail --follow=filename
to: tail -f filename
The former will spot inode changes and reopen the filename if the file wraps (or has something else done to it to change its inode). The latter will just sit there seeing no new input in such cases."less -n huge_file" and then G only reads the start and end of the file. Type G again to move to the latest end of the file if it's growing.