Show the number of failed tries of login per account. If the user does not exist it is marked with *. Show Sample Output
When your wtmp files are being logrotated, here's an easy way to unpack them all on the fly to see more than a week in the past. The rm is the primitive way to prevent symlink prediction attack.
Something to stuff in an alias when you are working in multiple environments. The double-pipe OR will fall through until one of the commands succeeds, and the rest won't be executed. Any STDERR will fall out, but the STDOUT from the correct command will bubble out of the parenthesis to the less command, or some other command you specify.
This way you keep the file compressed saving disk space. Other way less optimal using named pipes: mysql -uroot -p'passwd' database <
with zcat force option it's even simpler.
This command enables the user to append a search pattern on the command line when using less as the PAGER. This is especially convenient (as the example shows) in compressed files and when searching man pages (substituting the zcat command with man, however).
This command is more for demonstrating piping to vim and jumping to a specific line than anything else. Exit vim with :q! +23 jumps to line 23 - make vim receive the data from the pipe
Scans the file once to build a list of line numbers that contain non-printable characters Scans the file again, passing those line numbers to sed as two commands to print the line number and the line itself. Also passes the output through a tr to replace the characters with a ? Show Sample Output
credit shall fall to this for non-gzipped version: https://gist.github.com/marcanuy/a08d5f2d9c19ba621399 Show Sample Output
a little bit smarter & i only want .de domains, so ..... Show Sample Output
This command allows you to stream your log files, including gziped files, into one stream which can be piped to awk or some other command for analysis.
Note: if your version of 'find' supports it, use:
find /var/log/apache2 -name 'access.log*gz' -exec zcat {} + -or -name 'access.log*' -exec cat {} +
As odd as this may be, I know of servers where the man(1) command is not installed, and there is not enough room on / to install it. However, zcat(1), nroff(1) and less(1) are. This is a way to read those documents without the proper tool to do so, as sad as this may seem. :)
Useful in system where log files are compressed for archival purposes
The argument '-'(denote standard input) is optional.
this command extracts an initrd files into the "tmp" directory
The example uses hashicorps packer as the sample file, but any .zip file which only contains a single file will work. Show Sample Output
This decompresses the file and sends the output to STDOUT so it can be grepped. A good one to put in loops for searching directories of gzipped files, such as man pages. 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: