### Commands by hukketto (2) the last day the last week the last month all time sorted by date votes

• lsof - cleaned up for just open listening ports, the process, and the owner of the process - simple as lsof man suggests Show Sample Output

0
lsof -iTCP -sTCP:LISTEN
· 2011-08-09 00:17:02
• It willl popup a message for each new entry in /var/log/messages found on the notify-send howto page on ubuntuforums.org. Posted here only because it is one of the favourites of mine.

1
tail -n0 -f /var/log/messages | while read line; do notify-send "System Message" "$line"; done · 2011-07-11 22:33:24 ### What's this? 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. ### Check These Out Check a server is up. If it isn't mail me. This version uses netcat to check a particular service. use the real 'rm', distribution brain-damage notwithstanding The backslash avoids any 'rm' alias that might be present and runs the 'rm' command in$PATH instead. In a misguided attempt to be more "friendly", some Linux distributions (or sites/etc.) alias 'rm' to 'rm -i'. Unfortunately, this trains users to expect that files won't actually be deleted until they okay it. This expectation will fail with catastrophic results when they use other distributions, move to other sites, etc., and doesn't really even work 100% even with the alias. It's too late to fix 'rm', but '\rm' should work everywhere (under bash).

Pretty Print a simple csv in the command line
Will handle pretty much all types of CSV Files. The ^M character is typed on the command line using Ctrl-V Ctrl-M and can be replaced with any character that does not appear inside the CSV. Tips for simpler CSV files: * If newlines are not placed within a csv cell then you can replace map(repr, r) with r

grep processes list avoiding the grep itself
Trick to avoid the form: grep process | grep - v grep

check open ports without netstat or lsof

convert a latex source file (.tex) into opendocument (.odt ) format
require the tex4ht package . You can open the file with openoffice , I use it much for correct my spelling and grammar .

Convert CSV to JSON

Find the package that installed a command

Read null character seperated fields from a file
Handle any bad named file which contains ",',\n,\b,\t,` etc Store the file name as null character separated list $find . -print0 >name.lst and retrieve it using$read -r -d "" Eg: $find . -print0 >name.lst;$cat name.lst| while IFS="" read -r -d "" file; $do$ls -l "$file";$done

In order to do that, first you need to save a cookie file with your account info. These commands do it (maybe you need to create the '.cookies' dir before). Also, you need to check the "Direct downloads" option on the Premium Zone >> Settings tab. You need to do this once (as long you maintain the file or your Rapidshare Premium account).