Changing newline to spaces using just echo Show Sample Output
Creates a consistent datapumpt export on an Oracle database with the current sequence number, while the system is running and changes happens on the database.
# newline to space; the whack before dollar-underbar is required
alias nl2space="perl -ne 'push @F, \$_; END { chomp @F; print join(qq{ }, @F) , qq{\n};}' "
# newline to comma; the whack before dollar-underbar is required
alias nl2,="perl -ne 'push @F, \$_; END { chomp @F; print join(qq{,}, @F) , qq{\n};}' "
PROMPT> cat /tmp/foo
foo-001
foo-002
foo-003
foo-004
foo-005
foo-006
foo-007
foo-008
foo-009
foo-010
# 'tr' does not give a newline after it run. Makes a messy commandline.
PROMPT> cat /tmp/foo|tr "\n" ' '
foo-001 foo-002 foo-003 foo-004 foo-005 foo-006 foo-007 foo-008 foo-009 foo-010 $PROMPT> tr "\n" ' ' /tmp/foo
# 'tr' does not take arguements
PROMPT> tr "\n" ' ' /tmp/foo
tr: extra operand `/tmp/foo'
Try `tr --help' for more information.
# 'nl2space' is a filter and takes arguements, adds a newline after it runs.
PROMPT> cat /tmp/foo| nl2space
foo-001 foo-002 foo-003 foo-004 foo-005 foo-006 foo-007 foo-008 foo-009 foo-010
PROMPT> nl2space /tmp/foo
foo-001 foo-002 foo-003 foo-004 foo-005 foo-006 foo-007 foo-008 foo-009 foo-010
Mostly for Norwegians, but easily adoptable to others. Very handy if you are brainstorming for a new domainname. Will only display the available ones.. You can usually do this better with dig, but if you dont have dig, or the TLD only have an online service to check with, this will be usefull.. Show Sample Output
this is helpful because dmesg is where i/o errors, etc are logged to... you will also be able to see when the system reboots or someone attaches a thumb drive, etc. don't forget to set yourself up in /etc/aliases to get roots email.
Usage: clfavs username password num_favourite_commands file_in_which_to_backup
A little bash daemon
concatenates avi files
recently some in the #linux shared this. to find out the kernel version name from the binary without using uname Show Sample Output
Does what summary says
Kills the pid you want to kill Show Sample Output
You can set the previous bash command as the terminal title by this command. Explanation: -trap assigns a command to execute at a given bash signal. -in the $BASH_COMMAND you find the last command -you can set the terminal title with the escape sequence: \e]0;this is the title\007 -to let the echo care about the backslashes give the -e to it Since trap is a built in bash command you find more informatin in 'man bash'for more Source: http://www.davidpashley.com/articles/xterm-titles-with-bash.html
Same as the cool matrix style command ( http://www.commandlinefu.com/commands/view/3652/matrix-style ), except replacing the printed character with randomness. The command mentioned is much faster and thus more true to the matrix. However, mine can be optimized, but I wasted ... i mean spent enough time on it already Show Sample Output
Replace 'SHOWNAME' with the name of the TV show. Add -n to test the command without renaming files. Check the 'sample output'. Show Sample Output
Works 99.9% of the time; so far never required a more complex expression in manual input.
Go to /
Although rm is protected against it, there are many commands that would wreak havoc on entering the obvious ".*" to address "dot-files". This sweet little expression excludes the dirs "." and ".." that cause the problems. Show Sample Output
Convert string to array using echo and sed =) Show Sample Output
Intentional hash in the beginning. May run a looong time. Wipes your data for real. Was meant to be /dev/urandom - I mistyped it. :-)
this string of commands will release your dhcp address, change your mac address, generate a new random hostname and then get a new dhcp lease.
open an application to wherever you like on your current display. the first set of #'s (120x30) denotes size of window opened in, and the second set (+1280+0) identifies the location. Either set can be used alone, or with the other. Also, opening gnome-terminal with this option requires it to be "--geometry" for some reason.
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: