In the field, I needed to script a process to scan a specific vendor devices in the network. With the help of nmap, I got all the devices of that particular vendor, and started a scripted netcat session to download configuration files from a tftp server. This is the nmap loop (part of the script). You can however, add another pipe with grep to filter the vendor/manufacturer devices only. If want to check the whole script, check in http://pastebin.com/ju7h4Xf4 Show Sample Output
This is the easiest and shortest way :-)
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 ; }
use this command to quickly display specific line. Show Sample Output
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
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"
This is how you can do this without having to use oneline Show Sample Output
On debian parent process is running as root, workers as www-data. You can run strace in backgroud, get its PID, curl your webpage, kill strace and read your stats.
I had to reconfigure all of my 150 domains to use "localhost" as IMAP/SMTP server instead of mail.[domain]. This little thing did the job in a fraction of a second!
FQPN - Path = Filename
remove the IP from proxy reverse server and parentesis from real IP obtained from X-forwarder_IP Show Sample Output
Search a string in YouTube using GET command, parse the response with a suitable replace pattern and pipe its result to VLC Show Sample Output
Tails make.out file and pipes it to sed which uses 3 colors: green: percentage (eg: 10%) yellow: warning (case insensitive) red: error (case insensitive)
Removes the last 5 lines from a file using sed
Remove all line from a playlist m3u that not finish with MP3 or mp3 or wma or flac creating a new clean plalist m3u Show Sample Output
A function for retrieving and displaying a list of synonyms for a German word or phrase. Show Sample Output
New objects cannot be assigned by reference. The result of the new statement can no longer be assigned to a variable by reference. Check the "Sample Output" example ("sample.php"). The Output of the above example in PHP 5: "Deprecated: Assigning the return value of new by reference is deprecated in sample.php on line 3". Output of the above example in PHP 7: "Parse error: syntax error, unexpected 'new' (T_NEW) in sample.php on line 3. Show Sample Output
Remove lines from a bibtex file that have abstracts in them.
It his example removes ' dog', last space included. Show Sample Output
NOT MINE! Taken from hackzine.com blog. It creates a tree-style output of all the (sub)folders and (sub)files from the current folder and down(deeper) Quoting some of hackzine's words "Murphy Mac sent us a link to a handy find/sed command that simulates the DOS tree command that you might be missing on your Mac or Linux box. [..split...] Like most things I've seen sed do, it does quite a bit in a single line of code and is completely impossible to read. Sure it's just a couple of substitutions, but like a jack in the box, it remains a surprise every time I run it." 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: