commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
[root@dhcppc1 windows]# cat /var/log/honeylog.log
Connection from 192.168.1.71 port 21 [tcp/ftp] accepted
Connection from 192.168.1.65 port 21 [tcp/ftp] accepted
[root@dhcppc1 windows]# nc 192.168.1.65 21
220 ProFTPD 1.3.3c Server [ProFTPD]
FAILED FTP ATTEMPT - PORT 21
*You can not run it if you have activated the ftp server.
I have a custmer's Geovision DVR installed on a closed proxi (only logme-in reaches it).
I have to check for reliability but logmein hangs and is too slow a process
I made the Geovision software send e-mail every minute to the www.spam.la site.
All this script does is to retrieve the e-mail header from spam.la ( no login!), filtering sender, stopping at the first occurrence of the word "secs" ( the age of the last e-mail ).
The result is the age of the sender's last e-mail, tiny published on top of my screen once a minute.
I can refresh www.spam.la via web browser, but have other things to do.
I use it inside Kalarm ( kde task schedule ) set to 1 minute repeat.
It can be done without kalarm, using Watch outside the script.
Try it out now using my account = geo1 ( change sender by geo1 in this script)
Needs curl , osd-bin
I often find it useful to know what the exit status for a program was. This can be helpful when looking up errors by exit status or when scripting frequent commands.
Assuming you have zenity installed, and assuming that you keep your backgrounds in ~/backgrounds, then this should work for you! :)
Assumes you've cd'd to the folder in which all your git repos reside; you could run it from ~ without -maxdepth, although that might make find take quite a while longer.
If you have several processor cores, but not that much ram, you might want to run
git config --global pack.threads 1
first, since gc-ing can eat lots of ram.
Is there somebody that uses Windows a lot that keeps messing up your Linux machine? Press Ctrl+Alt+F1-F6 and run this command after logging into a text shell!
I don't think it's possible to give a (background) colour to the tab itself, since a tab is, IIUC, simply a command to the terminal to move to the right. Nevertheless, this "highlighting" can be helpful when working with tab-separated files.
Btrfs reports the inode numbers of files with failed checksums. Use `find` to lookup the file names of those inodes.
Use gstreamer to capture v4l2:///dev/video0 and show ascii art video in display.
Returns any file in the folder which would be rejected by Gmail, if you were to send zipped version.
(Yes, you could just zip it and knock the extension off and put it back on the other side, but for some people this just isn't a solution)
EXACT time in Germany. :)
Can't see it here, but the non-breaking space is highlighted :)
cat -t -e
achieves something similar, but less colourful.
Could add more code points from https://en.wikipedia.org/wiki/Space_%28punctuation%29#Spaces_in_Unicode
Saves you an
So simple and time-saving.
Reverts the changes that were made in a particular revision, in the local working copy. You must commit the local copy to the repository to make it permanent.
This is very useful for undoing a change.
You can revert multiple changes by specifying numbers wider apart; Just remember to put the highest number first.
Removes the given string from all files under the given path - in this case the path given is "." This demonstrates the characters that must be escaped for the grep and sed commands to do their work correctly. Very handy for fixing hacked html files.
this is great if you loose you ssh connection (with out a screen session) or are working on a laptop with a bad battery, or just a power outage.
Modifications: you may not need the -print; the mtime is last modified time in days
Really, you deserve whatever happens if you have a whitespace character in a file name, but this has a small safety net. The truly paranoid will use '-i'.
In these command i use lynx to get the top trend topic of Mexico, if you replace Mexico with other country, you will get the #1 Trending topic