Outputs / monitors the content of the LOG_FILE , which matches the SEARCH_STR. The output is cutted by spaces (as delimiter) starting from column 7 till the end.
This command allows to follow up a trace on SDP (CS5.2), at the same time as the trace records are stored in the file with "raw" format.
Trace files in native format are useful to filter the records before to translation from '|' to '\n'.
Example:
grep -v OP_GET <raw-records>.trace | tr '|' '\n'
Show Sample Output
this command can be added to crontab so as to execute a nightly backup of directories and store only the 10 last backup files.
I occasionally need to see if a machine is hitting ulimit for threads, and what process is responsible. This gives me the total number, sorted low to high so the worst offender is at the end, then gives me the total number of threads, for convenience.
Show top apps that use internet, sorted by count connections and grouped by TYPE and Protocol Show Sample Output
Use this command to watch apache access logs in real time to see what pages are getting hit. Show Sample Output
https://www.magnatune.com depends on unp but does not need to but unp is the easiest way to unpack any archive. it's in Debian repo's. !note: it deletes flac zip when done, if successful. Show Sample Output
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
Given a list of filenames, one per line, in /tmp/filelist, calculate the total sum disk usage.
Finds the date of the first commit in a git repository branch Show Sample Output
I run into regular problems whereby my cable modem from my ISP will simply stop working. To ensure that it is a problem with my cable modem (and not the router in-between my machine and the cable modem), I needed a quick way to test to someplace beyond the cable modem. The place shouldn't be beyond the cable network though. As such, I needed to determine the gateway to which my cable modem was connected. Since my router cannot do this on it's own... I created a single line command that will ping the gateway IP address based upon knowing that my gateway will be my second hop (after my wifi router), tracerouting for 2 hops, pulling the last line of the traceroute output and grep'ing for just the IP address. To stop pinging, use . This works on linux and osx and, with the addition of cygwin tools or the win-gnu project... should work on windows as well. Show Sample Output
Time protocol serves up seconds since 1900 in a 32 bit binary number. Show Sample Output
This command will display the file, but you can change 'cat' to anything else
(type 'n' when prompted to cancel the command or anything else to proceed).
.
Some hints for newbies:
type
unset bar
to make 'bar' function annihilated.
For permanent usage you can put this (bar) function in your .bashrc (for bash) or in .profile (for sh).
With:
. ~/.bashrc
you can get all new inserted functions in .bashrc (so the function 'bar'
or whatever name you choose) immediately available.
Show Sample Output
Poor man's Clipular.com
If there are less than 10 folders, this script will not delete them
Pros: * it's much faster then for loop * removes first line of 'eselect bashcomp list' - which contains text "Available completions:"
I wanted a method to display the last run of my script from my log file. I had a pattern I could grep for to find the beginning of each run. This command line greps for that pattern in the log, finds the last occurrence and gives me the line number. Then I use the line number in tail to give me everything from that line number to the end of the log file. I tested this on Linux Mint (variant of Ubuntu) and on RHEL, but I suspect it will run many Linux systems.
Order and uniq
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: