I dont have curl or links installed, so I use wget with write file as standard out. Show Sample Output
command is shorter, output unnecessary longer Show Sample Output
This regular expression removes all HTML-Tags from the file.
You can use that to create a excludefile for nmap, to find hosts, with no DHCP lease in your DHCP range. Show Sample Output
Turns regular quotes into curly quotes, also converts hyphens to dashes using a heuristic and outputs the result as UTF-8, suitable to copy/paste into wordprocessor. requires: http://daringfireball.net/projects/smartypants/ (which does most of the work) (I renamed smartypants.pl to smartypants before adding it to my $PATH) Also requrires PHP with the multibyte module installed (its installed by default with PHP, but the sysadmin on one server I use disabled it... presumadly to increase performance or something).
Lists ONLY the files changed by the given HASH/HEAD/list of hashes, etc. The message, commit ID, author, etc. is not included
Best to try first with -n flag, to preview
This lengthy cryptic line will print the latest top 10 commandlinefu.com posts without their summaries. To print also their respective summaries use the following (even bigger) command line:
wget -qO - http://www.commandlinefu.com/feed/tenup | xmlstarlet sel -T -t -o '<doc>' -n -t -m rss/channel/item -o '<item>' -n -o '<title>' -v title -o '</title>' -n -o '<description>' -v description -o '</description>' -n -o '</item>' -n -t -o '</doc>' | xmlstarlet sel -T -t -m doc/item -v description/code -n -v title -n -n
It is recommended to include this line into a shell script to be easily run, as I do myself. You could also use the following URLs to browse the top 3 commands:
wget -qO - http://www.commandlinefu.com/feed/threeup | xmlstarlet ...
.. or all others:
wget -qO - http://feeds2.feedburner.com/Command-line-fu | xmlstarlet ...
PS: You need to install "xmlstarlet" to run it. It is found in Debian APT repositories (apt-get install xmlstarlet) or under the http://xmlstar.sourceforge.net/ URL.
Show Sample Output
translate and number lines is simpler and you use tr to choose your delimiter (eg for csv files) Show Sample Output
The original doesn't work for me - but this does. I'm guessing that Youtube updated the video page so the original doesn't work.
A lot of X applications accept --geometry parameter so that you can set application size and position. But how can you figure out the exact arguments for --geometry? Launch an application, resize and reposition its window as needed, then launch xwininfo in a terminal an click on the application window. You will see some useful window info including its geometry. Show Sample Output
When you have one of those (log)files that only has epoch for time (since no one will ever look at them as a date) this is a way to get the human readable date/time and do further inspection. Mostly perl-fu :-/
This command will find the biggest files recursively under a certain directory, no matter if they are too many. If you try the regular commands ("find -type f -exec ls -laSr {} +" or "find -type f -print0 | xargs -0 ls -laSr") the sorting won't be correct because of command line arguments limit. This command won't use command line arguments to sort the files and will display the sorted list correctly. Show Sample Output
Very useful if you keep switching between the same two branches all the time. Show Sample Output
-exec works better and faster then using a pipe
As an alternative to using an additional grep -v grep you can use a simple regular expression in the search pattern (first letter is something out of the single letter list ;-)) to drop the grep command itself. Show Sample Output
doesn't do case-insensitive filenames like iname but otherwise likely to be faster
This does the following: 1 - Search recursively for files whose names match REGEX_A 2 - From this list exclude files whose names match REGEX_B 3 - Open this as a group in textmate (in the sidebar) And now you can use Command+Shift+F to use textmate own find and replace on this particular group of files. For advanced regex in the first expression you can use -regextype posix-egrep like this: mate - `find * -type f -regextype posix-egrep -regex 'REGEX_A' | grep -v -E 'REGEX_B'` Warning: this is not ment to open files or folders with space os special characters in the filename. If anyone knows a solution to that, tell me so I can fix the line.
Set the affinity of a process to a particular core(s). Arguments for processor include a comma separated list, or a range. (example: 1,2 or 0-3) You can use top in smp mode (Press 1) to see the changes to the affinity. Show Sample Output
Ever need to output an entire directory and subdirectory contents to a file? This is a simple one liner but it does the trick every time. Omit -la and use only -R for just the names
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: