tput rmam
will disable line wrapping so that long lines are truncated to width of the terminal ($COLUMNS).
tput smam
will re-enable wrapping.
I've always used tput in bash scripts but I guess it works on the command line too.
Doesn't work in all terminals.
See http://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html
Good for use in your ~/.bash_profile or a script. Show Sample Output
This will use tput to place the command (date %T in this case) in the upper right corner of the terminal
Here is an alternative that support unicodes, using echo:
It is using the \c flag, meaning no new line for the echo option -e.
You can replace the = with any unicode character.
Or to do the same into a PHP bash script:
shell = system("tput cols");
for( $i= 0 ; $i < $shell ; $i++ ){ echo "█"; }
Show Sample Output
A function for retrieving and displaying a list of synonyms for a German word or phrase. Show Sample Output
For vi(m) users : Add it in your ~/.bashrc Add an "exit" @ the end if you are masochist ;) Show Sample Output
apt install toilet toilet-fonts # replace 'tput setaf 1' with 'tput setaf 9' to change color
Matrix Screen HPUX
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: