I like curl better than wget, I just think that curl -s is a lot simpler than wget ... see I forget what you even have to do to get wget to pipe it's output Anyway, all in one sed command as "requested" Show Sample Output
Used curl instead of wget (minor change) Used the full-url instead of the shortened one (in case is.gd goes down/empties their cache) turned the tail | awk bit into a single awk command. Show Sample Output
host -i `echo $SSH_CLIENT | cut -f 1 -d \ ` | sed 's/.* domain name pointer \(.*\)\./\1/'
to reverse lookup and get the hostname.
!# is the currennt line so far, by using !#:- you can go from the second arg (it's zero indexed) to the last ($) (did I understand the problem correctly?)
probably only works if you have one graphics card.
used this: http://www.cyberciti.biz/faq/howto-find-linux-vga-video-card-ram/
as reference
can be expanded, for example:
lspci -v -s `lspci | awk '/VGA/{print $1}'` | sed -n '/Memory.*, prefetchable/s/.*\[size=\([^]]\+\)\]/\1/p'
will just get the amount of prefetchable memory
compare to:
lshw -C display
which does not give the size (it does give byte ranges and you could calculate the size from that, but that's a pain)
Also uses a command which is not standard on linux; wheras lspci is a core utility provided by most systems
Show Sample Output
uses the pkgfile command (part of the community repository), highly suggested.
this method should be the fastest
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
open [path] in the default program, regardless of which Desktop Environment you use (KDE, GNOME, etc.) Works on all "freedesktop.org" compatible desktop environments
file displays a files type the -L flag means follow sym-links (as libraries are often sym-linked to another this behavior is likely preferred) more complex behavior (*two* grep commands!) could be used to determine if the file is or is not a shared library.
This one uses hex conversion to do the converting and is in shell/sed only (should probably still use the python/perl version).
This is different that `who` in that who only cares about logged-in users running shells, this command will show all daemon users and what not; also users logged in remotely via SSH but are running SFTP/SCP only and not a shell. Show Sample Output
My version uses printf and command substitution ($()) instead of echo -e and xargs, this is a few less chars, but not real substantive difference. Also supports lowercase hex letters and a backslash (\) will make it through unescaped Show Sample Output
Doesn't fail for percent sign now.
uses the previous "chr" function and uses it to create the inverse function "ord" by brute force. It's slow, It's inelegant, but it works. I thought I needed ord/chr to do a cartesian cipher in shell script a whie ago, but eventualy I realized I could get fancy with tr and do the same thing...
Turns regular quotes into curly quotes, also converts hyphens to dashes using a heuristic and outputs the result as UTF-8, suitable to copy/paste into wordprocessor. requires: http://daringfireball.net/projects/smartypants/ (which does most of the work) (I renamed smartypants.pl to smartypants before adding it to my $PATH) Also requrires PHP with the multibyte module installed (its installed by default with PHP, but the sysadmin on one server I use disabled it... presumadly to increase performance or something).
Calculates md5 sum of files. sort (required for uniq to work). uniq based on only the hash. use cut ro remove the hash from the result.
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: