Replace "user/sbin/sshd" with the file you would like to check. If you are doing this due to intrusion, you obviously would want to check size, last modification date and md5 of the md5sum application itself. Also, note that "/var/lib/dpkg/info/*.md5sums" files might have been tampered with themselves. Neither to say, this is a useful command. Show Sample Output
`pwd` returns the current path `grep -o` prints each slash on new line perl generates the paths sequence: './.', './../.', ... `readlink` canonicalizes paths (it makes the things more transparent) `xargs -tn1` applies chmod for each of them. Each command applied is getting printed to STDERR. Show Sample Output
ofxGui ofxFX
Reason can be: taken, available, contains_banned_word
calculate how many different lines between two files Show Sample Output
This command produces no output, but its exit status is 0 ("true") if $file is text, non-0 ("false") if $file is binary (or is not accessible).
Explanation:
-q suppresses all the output of grep
-I is the trick: if a binary file is found, it is considered a non-match
-m 1: limit "output" to first match (speed up for big files)
.: the match string, "." stands for any character
Usage: e.g. run editor only on text files
grep -qIm 1 . $file && vi $file
Searched strings: passthru, shell_exec, system, phpinfo, base64_decode, chmod, mkdir, fopen, fclose, readfile Since some of the strings may occur in normal text or legitimately you will need to adjust the command or the entire regex to suit your needs.
A way to display directory structure Show Sample Output
this also can find the old command you used before
find ip address in all files in /etc directory. can be used to find any string in any directory really
If you know any two (or more) words are occurring on multiple lines in a file, using a regular expression such as this will help you find them quickly.
Replace $USER with the username of the Reddit user in question. To get comment karma instead run...
curl -s http://www.reddit.com/user/$USER/about.json | tr "," "\n" | grep "comment_karma" | tr ": " "\n" | grep -E "[0-9]+" | sed s/"^"/"Comment Karma: "/
Show Sample Output
I use this one-liner to search my sourcecode to find out where tags are named and since there's no easy way in XCode to see what values have already been used. Show Sample Output
This command is useful for searching through a whole folder worth of pdf files. 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: