Count and Find all IP connected to my host through TCP connection. Show Sample Output
#ugly, I know Show Sample Output
nothing special Show Sample Output
So I use OSX and don't have the shuf command. This is what I could come up with. This command assumes /usr/share/dict/words does not surpass 137,817,948 lines and line selection is NOT uniformly random. Show Sample Output
Change "sort -f" to "sort" and "uniq -ic" to "uniq -c" to make it case sensitive. Show Sample Output
Use matched data and some other as replacement data Show Sample Output
Using large wordlists is cumbersome. Using password cracking programs with rules such as Hashcat or John the ripper is much more effective. In order to do this many times we need to "clean" a wordlist removing all numbers, special characters, spaces, whitespace and other garbage. This command will covert a entire wordlist to all lowercase with no garbage.
Can't print correctly in the command field.
There is a new line before } as follows
seq 20 | sed -n '5,6 { w out.txt
}'
Show Sample Output
Prints exactly 15th line of $file. You can also specify a range: sed -n '2,18p' $file - this will print lines 2 to 18, inclusive.
This function uses xmllint to evaluate xpaths. Usage: xpath /some/xpath XMLfile Show Sample Output
Helps if you accidentally deleted files from an svn repo with plain rm and you would like to mark them for svn to delete too.
grabs and prints the AmazonMP3 daily album deal
Encrypt any text to MD5 , replace text with the string you want to convert to MD5 Show Sample Output
[continued]...with "bin:" and line starting with "lp:". This specific example with /etc/passwd shows the power of sed to extract data from text files. Here we see an extract from /etc/passwd beginning with the line starting with "bin:" and ending with the line starting with "lp:". Note also, placing the STDIN redirection at the start of the command makes it easy to recall and modify the command parameters line in shell history. Show Sample Output
Unmounts all CIFS-based network drives. Very nice for shutting down network mounts on a Linux laptop just prior to going to sleep. Show Sample Output
Uses sed with a regex to move the linenumbers to the line end. The plain regex (w/o escapes) looks like that: ^([^:]*):(.*) Show Sample Output
sed '4~5,+1d' file.txt 1 2 3 6 7 8 Show Sample Output
Create fortune's *.dat file from commandlinefu from saved preferite script by suhasgupta (http://www.commandlinefu.com/commands/view/3681/backup-all-your-commandlinefu.com-favourites-to-a-plaintext-file) - Italian tutorial here: http://mrehqe.blogspot.com/2011/11/come-ottenere-un-commandlinefu-della.html
Just an other solution :)
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: