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.
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.
» 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:
Some servers don't have ssh-copy-id, this works in those cases.
It will ask for the destination server, this can be IP, hostname, or [email protected] if different from current user.
Ssh keygen will let you know if a pubkey already exists on your system and you can opt to not overwrite it.
Requires the GNU tar ignore zeros option. http://www.gnu.org/software/tar/manual/html_section/Blocking.html
Create a text file called domainlist.txt with a domain per line, then run the command above. All registries are a little different, so play around with the command. Should produce a list of domains and their expirations date. I am responsible for my companies domains and have a dozen or so myself, so this is a quick check if I overlooked any.
Prints the type of computer you have.
I think this should be used more in distros and other applications because it is so easy to get. This can also be asked by tutorials as an easy way to get your base hardware.
Some alternatives:
sudo dmidecode -s system-product-name
and
sudo smbios-sys-info-lite | sed -n 's/^Product Name: *\(.*\)/\1/p'
I like to label my grub boot options with the correct kernel version/build.
After building and installing a new kernel with "make install" I had to edit my grub.conf by hand.
To avoid this, I've decided to write this little command line to:
1. read the version/build part of the filename to which the kernel symlinks point
2. replace the first label lines of grub.conf
grub.conf label lines must be in this format:
Latest [{name}-{version/build}]
Old [{name}-{version/build}]
only the {version/build} part is substituted.
For instance:
title Latest [GNU/Linux-2.6.31-gentoo-r10.201003]
would turn to
title Latest [GNU/Linux-2.6.32-gentoo-r7.201004]"
the last person who posted used the most roundabout way to concatinate files, there's a reason there's a "conCATinate" command... Using this method, you also get to choose the order of the files, below another person just did *.txt > combined.txt which is fine but the order depends on the implementation of "cat" which is probably alphabetical order of filenames.
Check if you have 64bit by looking for "lm" in cpuinfo. lm stands for "long mem". This can also be used without being root.
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server. A slightly shorter version.
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server.
Saves to a PDF with title and alt text of comic.
As asked for on http://bbs.archlinux.org/viewtopic.php?id=91100
Change xkcd.com to dynamic.xkcd.com/comics/random for a random comic.
The command shows the real power of the pdftk tool, you can do basically everything you want with multiple pdf's.
In the command a book is created from chapters, headings and covers.
when someone mail you his ssh public key, and the lines are broken with '\n', you can reconstruct a new file with one key by line with this command.
I think I picked this one up from Hak5 (yeah I know.. kinda lame)
if you, like me, do not have the numsum, this way can do the same.
I must monitorize a couple of ftp servers every morning WITHOUT a port-scanner
Instead of ftp'ing on 100 ftp servers manually to test their status I use this loop.
It might be adaptable to other services, however it may require a 'logout' string instead of 'quit'.
The file ftps.txt contains the full list of ftp servers to monitorize.