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:
get a list of currently running oracle dbs (identified by the pmon process)
show the executable that spawned the process and
show the ORACLE_HOME relative to the environment within which the process is running
tailored to AIX (sed on linux behaves...differently)
suggestions for a better way...please.
This will kill a specific process you don't know the PID of, when pidof and pgrep are not available, for example on OS X. var1 is created so that the whitespace can be trimmed before passing off to kill.
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.
This is a dirty raw way to simply list ELF objects in a folder.
The output is ready to be parsed i.e to the stripper or what else needs a path to an ELF object.
If you need to randomize the lines in a file, but have an old sort commands that doesn't support the -R option, this could be helpful. It's easy enough to remember so that you can create it as a script and use that.
It ain't real fast. It ain't safe. It ain't super random. Do not use it on untrusted data. It requires bash for the $RANDOM variable to work.
HP UX doesn't have a -a switch in the ifconfig command.
This line emulates the same result shown in Solaris, AIX or Linux
If a directory name contains space xargs will do the wrong thing. Parallel https://savannah.nongnu.org/projects/parallel/ deals better with that.
xargs deals badly with special characters (such as space, ' and "). In this case if you have a file called '12" record'.
Parallel https://savannah.nongnu.org/projects/parallel/ does not have this problem.
Both solutions work bad if the number of files is more than the allowed line length of the shell.
This version makes uses of Bash shell expansion, so it might not work in all other shells.
** Replace the ... in URLS with:
www.census.gov/genealogy/www/data/1990surnames
Couldn't fit in 256
Created on Ubuntu 9.10 but nothing out of the ordinary, should work anywhere with a little tweaking. 5163 is the number of unique first names you get when combine the male and female first name files from. http://www.census.gov/genealogy/www/data/1990surnames/names_files.html
i wanted to delete all duplicate lines from .bash_history and keep the order of the other lines.
the command cat's the file and adds line numbers, then sorts by the second column. afterwards uniq omits repeated lines, but skips the first field (the line number). then it sorts by the line numbers and at the end cuts the numbers off.
A way not so simple but functional for print the command for the process that's listening a specific port.
I got the pid from lsof because I think it's more portable but can be used netstat
netstat -tlnp
List everyone who committed to a particular project, listed alphabetically. To list by commits, add -n to the shortlog.
Get the line containing "inet addr:" and the line before that, get down to only the first line, and then get the first word on that line, which should be the interface.