This will view the console and assumes the screen is 80 characters wide. Use /dev/vcs2 for the next virtual console.. etc. Show Sample Output
wraps text lines at the specified width (90 here). -s option is to force to wrap on blank characters -b count bytes instead of columns
fold wraps text at 80 characters wide, and with the -s flag, only causes wrapping to occur between words rather than through them.
or
od /dev/urandom -w60 -An|sed 's/ ..../ /g'|head -n 30
(this one lacks digits 8 and 9)
tput setaf 1 && tput rev && seq -ws "___|" 81|fold -69|tr "0-9" "_" && tput sgr0
# (brick wall)
Fill the entire terminal screen. Is COLUMNS or LINES are undefined run "resize"
Like 7171, but fixed typo, uses fewer variables, and even more cryptic! Show Sample Output
Per default, linux/unix shells are configured with a width of 80 characters. If you like to edit a phrase or string on a line with more than 80 characters it might take long to go there (for example a line with 1000 characters and you like to edit the 98th word which is character 598-603). Maybe you might wish to use 78 characters, because if you forward the text via mail and the text will be quoted (2 extra characters at the beginning to the line "> "), you use 80 characters, otherwise 82, which are lame.
cryptic version Show Sample Output
This command is similar to the alternate, except with head(1), you can pick as many passwords as you wish to generate by changing the number of lines you wish to preview. Show Sample Output
Replace all instances of "A" with "B" in file "source" saved as file "destination". !! IF A/B is multi-byte, then separate bytes with spaces like so: "s/20\ 0A/00/g". Show Sample Output
generate password Show Sample Output
Generate a 18 character password from character set a-zA-Z0-9 from /dev/urandom, pipe the output to Python which prints the password on standard out and in crypt sha512 form. Show Sample Output
I look at xkcd in my news reader, but it displays the image's title attribute only for a few seconds which makes reading the longer ones more challenging. So I use this to display it in my console.
Replaces hexdump with the more succint xxd, and the sed was unnecessarily complex.
I used this fragment with Imagemagick convert so that I can place long text strings in pictures. The "\n" gets converted to a true newline in the image. So this fragment uses fold command to wrap the line and then sed to convert newlines (and any trailing spaces on the line) to the text "\n" Show Sample Output
this one includes special characters. note some some chars may be disallowed on windows systems. *nix will allow pretty much any character in a password except a carriage return. you do not want non printing characters in your password, so this is limited to the printable chars displayed on a keyboard , less space and return. edited to fix minor typo Show Sample Output
A function for retrieving and displaying a list of synonyms for a German word or phrase. Show Sample Output
no need that useless cat.
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: