see what's in your memory right now... sometimes you find passwords, account numbers and url's that were recently used. Anyone have a safe command to clear the memory without rebooting?
History usually only gives the command number and the command. This will add a timestamp to the history file. Note: this will only put the correct timestamp on commands used after the export is done. You may want to put this in your .bashrc Show Sample Output
Kudzu is available on CentOS, used for configuring and detecting new hardware device installed, is also usefull for device listing.
I use it sometimes when I work on a french file transferred from a windows XP to a Debian-UTF8 system. Those are not correctly displayed: ? ? ? and so on
man tcs # for all charsets
Shows a file without comments (at least those starting by #)
- removes empty lines
- removes lines starting by # or "some spaces/tabs then #'"
Useful when you want to quickly see what you have to customize on a freshly installed application without reading the comments that sometimes are a full 1000 lines documentation :)
While posting, I saw this http://www.commandlinefu.com/commands/view/1041/display-contents-of-a-file-wo-any-comments-or-blank-lines
But it's dirty and incomplete, to my mind
My original goal was to remove lines like "\t*#" but I can't figure out how to do a egrep '\t' on a command-line. Two workarounds if needed:
egrep -v 'press control + V then TAB then #' /your/file
or
egrep -v -f some_file /your/file #where some_file contains what you want to exclude, example a really inserted TAB
This is a simple but useful command to search for multiple terms in a file at once. This prevents you from having to do mutliple grep's of the same file. 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
Quick and easy way of validating a date format of yyyy-mm-dd and returning a boolean, the regex can easily be upgraded to handle "in betweens" for mm dd or to validate other types of strings, ex. ip address. Boolean output could easily be piped into a condition for a more complete one-liner.
replace "directory name with files to add to DVD" with actual directory containing files you want to add to growable DVD
replace "directory name to burn on DVD" with actual directory name that you want to copy on DVD
unalias a previously aliased command Show Sample Output
function echox { echo `tput cup $(($(tput lines))) $(( ($(tput cols) - $(echo "${#1}"))/2 ))`"$1"`tput cup $(tput lines) $(( $(tput cols)-1 ))`; }
echox prints given argument on bottom line center screen in terminal
function echoxy { echo `tput cup $(($(tput lines)/2)) $(( ($(tput cols) - $(echo "${#1}"))/2))`"$1"`tput cup $(tput lines) $(( $(tput cols)-1 ))`; }
exhoxy prints given argument center screen
function echos { echo `tput cup $(($(tput lines)-2)) $(($(tput cols)-$(echo ${#1})))&&tput sc`"$1"`tput cup $(($(tput lines)-2)) 0 && tput rc`; }
while [ 1 ]; do echos "`date`"; done
echos prints date and time on second from last line (used as status message)
you can easily use these functions by placing them in your .bashrc file, make sure to source your .bashrc once you do
Show Sample Output
You can use a site like http://www.jsonlint.com/ or use the command line to validate your long and complex json data. This is part of the simplejson package for python http://undefined.org/python/#simplejson.
Wrong json expression example:
echo '{ 1.2:3.4}' | python -m simplejson.tool
Expecting property name: line 1 column 2 (char 2)
Show Sample Output
This works on my ubuntu/debian machines. I suspect other distros need some tweaking of sort and cut. I am sure someone could provide a shorter/faster version.
Consider this line : random perl language this make possible is is possible to rearrange words with $F perl variable and word index, starting from 0. Show Sample Output
wmwave is part of wmwave package, when launched display a small wireless link monitor on your desktop with noise, level and link power.
setfont load vga console font. The default font directory is usually in /lib/kbd/consolefonts. Setfont is part of kbd package. Tested on CentOS.
ethstatus part of ethstatus package, is a consolle based monitor for network interfaces. Nicely display on screen a real time summary about bandwidth, speed and packets.
The variable ? contain the last exit status of a command, it can be printed for troubleshooting purpose. Show Sample Output
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: