Only the first appearance of a repeated command in the history will be kept. Otherwise, if you prefer to keep last occurrence of a repeated command then maybe you can achieve that by including reverse input/output i.e with 'tac' command in expression above.
To see statistics of removed repeated commands:
diff --suppress-common-lines -y ~/.bash_history.bak ~/.bash_history|uniq -c|sort -n|tr -s " "|sed '/^ 1/d'|grep '<'
This command takes an application name as an argument and then it will listen to the tcp traffic and capture packets matching the process Id of the application. The output shows: local address / local port / Remote Address / Remote port / State / Owning Process ID Show Sample Output
curl -sLkIv --stderr - https://t.co/2rQjHfptZ8 -s: silences the output when piped to a different command -L: follow every redirect -k: ignores certificate errors -I: just request the headers -v: be verbose --stderr - : redirect stderr to stdout https://t.co/2rQjHfptZ8: URL to check for redirects piped to grep -i location: -i: grep target text ignoring case location: : greps every string containing "location:" piped to awk {'print $3'} prints the third column in every string piped to sed '/^$/d' removes blank lines Show Sample Output
need package: pv apt-get install pv get the iso size in byte with ls -l install-cd.iso /dev/sdb is your USB Device (without partitionNr.)
Install with `npm install unix-permissions`. https://github.com/ehmicky/unix-permissions Unix file permissions can take many shapes: symbolic (`ug+rw`), octal (`660`) or a list of characters (`drw-rw----`). `unix-permissions` enables using any of these (instead of being limited to a single one) with any CLI command. Show Sample Output
/macos/mojave shell script to change terminal profiles
slighty shorter
example or test, basic awareness on app state, mostly for copy-paste reasons, requires auditd (ausyscall), rekt echoing (everything here is rekt) Show Sample Output
Use this function with bash version 4+ to convert arbitrary hexadecimal sequences to binary. If you don't have bash 4+ then modify the lowercase to uppercase demangling statement
s=${@^^}
to set s equal to the uppercase hex input or the bc command throws an input parser error.
Show Sample Output
Removed grep and simplified if statement. -- Friday is the 5th day of the week, monday is the 1st. Output may be affected by locale. Show Sample Output
-n reads input, line by line, in a loop sending to $_ Equivalent to while () { mycode } -e execute the following quoted string (i.e. do the following on the same line as the perl command) the elipses .. operator behaves like a range, remembering the state from line to line.
a quick function for searching changed files. just copy it in the bash Show Sample Output
this is good for variables if you have many script created files and if you want to know which one is the last created/changed one..
Benchmark a SQL query against MySQL Server. The example runs the query 10 times, and you get the average runtime in the output. To ensure that the query does not get cached, use `RESET QUERY CACHE;` on top in the query file. Show Sample Output
Get the total RESIDENT memory used by processes of a specific name. This means this is the MINIMUM used by a process, but some memory could be paged out to swap. Show Sample Output
Based on capsule8 agent examples, not rigorously tested
May need to substitute 'awk' for 'gawk'.
You are piping too many commands
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: