Runs "php -i", filter the error_log location, then watches it using "tail"
This will be useful when checking for logs and have to omit specific weblogic or apache server's log information which are redundant and unnecessary. Show Sample Output
alex@alex-box:~$ sl
The program 'sl' is currently not installed. You can install it by typing:
sudo apt-get install sl
alex@alex-box:~$ dolast
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
sl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Command #If not installed suggest a package. 2>&1 #Send stderr to stdout, for tail can read it tail -1 #Show last line. `Comand` #execute output of command. Show Sample Output
Tails make.out file and pipes it to sed which uses 3 colors: green: percentage (eg: 10%) yellow: warning (case insensitive) red: error (case insensitive)
logstalgia must be installed
"-F" will continue tailing if file is closed and another file opened with same name. This is handy for tailing log files that segment while watching them without having to issue the command again.
Was to long with a loop, use a while loop for have it running 24/7
tells you the number of lines in said file, and then tail the last 100 lines ( or how many are messed up) then u take the total amount of lines and then subract the 100 or so lines u DONT WANT, then do a head -n $new_number and then redirect it to new file.db
Next time you see a mac fanboy bragging about 64-bitness of 10.6 give him this so he might sh? Show Sample Output
"get Hong Kong weather infomation from HK Observatory From Hong Kong Observatory wap site ;)" other one showed alot of blank lines for me Show Sample Output
using tail first won't do it because tail counts from the bottom of the file. You could do it this way but I don't suggest it
Tail all logs that are opened by all java processes. This is helpful when you are on a new environment and you do not know where the logs are located. Instead of java you can put any process name. This command does work only for Linux.
The list of all log files opened by java process:
sudo ls -l $(eval echo "/proc/{$(echo $(pgrep java)|sed 's/ /,/')}/fd/")|grep log|sed 's/[^/]* //g'
Substitute that 724349691704 with an UPC of a CD you have at hand, and (hopefully) this oneliner should return the $Artist - $Title, querying discogs.com. Yes, I know, all that head/tail/grep crap can be improved with a single sed command, feel free to send "patches" :D Enjoy! Show Sample Output
Replace the head -1 with head -n that is the n-th item you want to go to. Replace the head with tail, go to the last dir you listed. You also can change the parameters of ls.
Sort by time and Reverse to get Ascending order, then display a marker next to the a file, negate directory and select only 1 result Show Sample Output
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: