If you use 'tail -f foo.txt' and it becomes temporarily moved/deleted (ie: log rolls over) then tail will not pick up on the new foo.txt and simply waits with no output. 'tail -F' allows you to follow the file by it's name, rather than a descriptor. If foo.txt disappears, tail will wait until the filename appears again and then continues tailing.
Add this to your $HOME/.bashrc file. It will only set this prompt if it is running inside screen ($WINDOW var is set)
Looks like this...
ion@atomos:~[2]$
Show Sample Output
Breaks down and numbers each line and it's fields. This is really useful when you are going to parse something with awk but aren't sure exactly where to start. Show Sample Output
Directly attach a remote screen session (saves a useless parent bash process)
command to decrypt:
openssl enc -aes-256-cbc -d < secret.tar.enc | tar x
Of course, don't forget to rm the original files ;) You may also want to look at the openssl docs for more options.
This executes faster than
cygstart.exe
I put this in a script and added it to my path:
cat `which explore.sh`
#!/bin/bash
if [ $# -eq 0 ]; then
explorer.exe $( cygpath `pwd` -w ) &
else
explorer.exe $( cygpath $1 -w ) &
fi;
Using the script you just type
explore.sh file_or_executable
Note: you can do this for any file that has an associated executable in the windows registry. This is quite handy if you want to open pictures or movies from xterm.
Show Sample Output
converts any number on the 'stdin' to SI notation. My version limits to 3 digits of precious (working with 10% resistors). Show Sample Output
a shorter version Show Sample Output
This command finds the 5 (-n5) most frequently updated logs in /var/log, and then does a multifile tail follow of those log files. Alternately, you can do this to follow a specific list of log files: sudo tail -n0 -f /var/log/{messages,secure,cron,cups/error_log} Show Sample Output
Instead of calculating the offset and providing an offset option to mount, let lomount do the job for you by just providing the partition number you would like to loop mount.
Shows a single line per interface (device), with its IPv4 settings. Shorter command, better readability in output. Show Sample Output
a variation of avi4now's command - thanks by the way!
to clean up the extra lines Show Sample Output
Same as above but slooooow it down
another way to output the IP address' of the system
That one works on Linux. On BSD and Solaris, the ifconfig output is much easier to parse:
/sbin/ifconfig -a | awk '/inet/{print $2}'
making lots of configurations to apache and restarting the server only to find it broken just plain sucks.
Found this useful for scripts where I needed to work with the machine's IP. If $DEVICE is not specified, this will return all IPs on the machine. If $DEVICE is set to a network adapter, it will return just that adapter's IP.
This is *NOT* about the -i option in grep. I guess everybody already knows that option. This is about the basic rule of life that the simplest things are sometimes the best. ;-) One day when I used "grep -i" for the umpteenth time, I decided to make this alias, and I've used it ever since, probably more often than plain grep. (In fact I also have aliases egrip and fgrip defined accordingly. I also have wrip="grep -wi" but I don't use this one that often.) If you vote this down because it's too trivial and simplistic, that's no problem. I understand that. But still this is really one of my most favourite aliases.
This alias finds identical lines in a file (or pipe) and prints a sorted count of them (the name "sucs" descends from the first letters of the commands). The first example shows the number of logins of users; the one who logged in most often comes last. The second example extracts web client IP addresses from a log file, then pipes the result through the "sucs" alias to find out which clients are performing the most accesses. Or pipe the first column of ps(1) output through "sucs" to see how many processes your users are running. Show Sample Output
Simply shows virtualhosts enabled, root access not needed (assuming apache2ctl is non-root executable).
Lists virtualhosts currently enabled for apache2, showing the ServerName:port, conf file and DocumentRoot
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: