minor improvement, added newline at no cost. Show Sample Output
If you have a series of existing files in a directory that you would like to copy to a new series, and then make a series of changes to those new files, this will speed up the process of copying the files. You can later iterate through a loop and use sed -i -e 's/old_string/new-string' new_string_files.* to replace all the values you need to in the newly copied files. Show Sample Output
For all users of https://addons.mozilla.org/de/firefox/addon/speed-dial/
Given a network interface (eth0 in this example), find its ip address, without CIDR netmask. Show Sample Output
This is the easiest and shortest way :-)
Human readable representation of the headers of an ICAP request, using tcpdump Show Sample Output
When you want to know the duration of all your mp3 files in the current working directory this command will tell you based on exif data. Since it relies on exif data it can be used against other files like movies, ogg vorbis etc. also. Useful when you want to know how long it will take to listen to an album or series of lectures. Show Sample Output
In addition one can evaluate the formulas in the venerable spreadsheet command sc, with an additional command. function csvev () { cat $1 | sed -e '1i,,,,,,,' |sed -e 's/=sum/@sum/g' -e 's/=SUM/@SUM/g' | psc -k -d, | sed -e 's/\"@SUM(/@SUM(/' -e 's/)"/)/' | sed '/@SUM/ { s/rightstring/let/; }' | sed -e '/= "=/s/rightstring/let/' -e '/= "=/s/"//g' | sed 's/= =/= /g' | sc ; } I will post this command separately as well. Show Sample Output
Requires psc, sed, sc, and cat. Working with csv spreadsheets with formulas in them to evaluate the formulas using sc. View the formulas in a numbered and lettered formated in command line. function sheet () { cat "$1" | sed '1s/^/a,b,c,d,e,f,g,h,j,k,l,m,n,o,p\n/' | column -s , -tn | nl -v 0 ; }
merge ifconfig grep awk sed you need to change the interface of ifconfig where ip is up Show Sample Output
use this command to quickly display specific line. Show Sample Output
Uses sed to quickly set log level in httpd.conf. For Apache 2.4 installed via Software Collections on RHEL6 systems.
Take the header line from a comma-delimited CSV file and enumerate the fields.
.
First sed replaces all commas with newlines
s/,/\n/g
Then sed quits (q) after the first line.
Finally, nl numbers all the lines
Show Sample Output
Outputs unique error messages from the apache log, sorted by frequency. Tested on log format: [Wed Aug 26 00:00:00 2015] [error] [client xx.xx.xx.xx] Error message here Show Sample Output
Use -q as first argument (as described in `man curl`) to ignore curlrc to ensure the output is always the same regardless of user's configuration. Show Sample Output
Echo $PATH isn't very easy to read. Show Sample Output
Create a file with random binary content. Required pv, units packages. It use openssl to encrypt zeros using aes-256 and time stamp as password to generate a pseudo-random file. Show Sample Output
I personally like it very much and have wrapped it into a function, named "apt-propos" ;), also you can use --names-only option for a sort-of "apt-whatis"
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: