
Terminal - All commands - 10,560 results
find `pwd` -type f \( -iname thumb.php -or -iname timthumb.php \) -exec grep -HP 'define ?\(.VERSION' {} \;
This is sample output - yours may be different.
root@server [/home/user/public_html]# find `pwd` -type f \( -iname thumb.php -or -iname timthumb.php \) -exec grep -HP 'define ?\(.VERSION' {} \;
/home/user/public_html/domain1/wp-content/themes/arras/library/timthumb.php:define ('VERSION', '1.12'); // version number (to force a cache refresh
/home/user/public_html/domain/wp-content/themes/arras/library/timthumb.php:define ('VERSION', '1.12'); // version number (to force a cache refresh
Good for finding outdated timthumb.php scripts which need to be updated, anything over 2.0 should be secure, below that timthimb is vulnerable and can be used to compromise your website.
ifconfig | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1
This is sample output - yours may be different.
watch "df | grep /this/folder/"
This is sample output - yours may be different.
Every 2.0s: df | grep /media/cdrom0 Thu Feb 5 20:24:22 2009
/dev/sde1 976760000 40156816 936603184 5% /media/cdrom0
This is sample output - yours may be different.
This is sample output - yours may be different.
$ play Music/flac/kate_rusby/underneath_the_stars/12_underneath_the_stars.flac
Music/flac/kate_rusby/underneath_the_stars/12_underneath_the_stars.flac:
Encoding: FLAC
Channels: 2 @ 16-bit Track: 12
Samplerate: 44100Hz Album: Underneath The Stars
Track gain: -5.9dB Artist: Kate Rusby
Duration: 03:23.67 Title: Underneath The Stars
14.6% 00:29.81 [02:53.85] of 03:23.67 Out:1.31M [ ===|=== ] Clip:0
"play" is part of "SoX"
SoX - Sound eXchange, the Swiss Army knife of audio manipulation.
For details, see: man sox
This is sample output - yours may be different.
This is sample output - yours may be different.
O=$IFS;IFS=$'\n'; D=$(for f in *;do [[ -d $f ]] && du -sh "$f";done | sort -gr);F=$(for f in *;do [[ -f $f ]] && du -sh "$f";done | sort -gr);IFS=$O;echo "$D";echo "$F"
This is sample output - yours may be different.
]> O=$IFS;IFS=$'\n'; D=$(for f in *;do [[ -d $f ]] && du -sh "$f";done | sort -gr);F=$(for f in *;do [[ -f $f ]] && du -sh "$f";done | sort -gr);IFS=$O;echo "$D";echo "$F"
172K images
8.0K css
8.0K index.html~
8.0K index.html
or alias memorable-command=']> O=$IFS;IFS=$'\n'; D=$(for f in *;do [[ -d $f ]] && du -sh "$f";done | sort -gr);F=$(for f in *;do [[ -f $f ]]
&& du -sh "$f";done | sort -gr);IFS=$O;echo "$D";echo "$F"'
and run memorable-command
biggest->small directories, then biggest->smallest files
function duf { du -k $@ | sort -rn | perl -ne '($s,$f)=split(/\t/,$_,2);for(qw(K M G T)){if($s<1024){$x=($s<10?"%.1f":"%3d");printf("$x$_\t%s",$s,$f);last};$s/=1024}' }
This is sample output - yours may be different.
This is sample output - yours may be different.
echo -e '#!/bin/bash\nssh remote-user@remote-host $0 "$@"' >> /usr/local/bin/ssh-rpc; chmod +x /usr/local/bin/ssh-rpc; ln -s hostname /usr/local/bin/ssh-rpc; hostname
This is sample output - yours may be different.
# before
home
# after
work
It's useful mostly for your custom scripts, which running on specific host and tired on ssh'ing every time when you need one simple command (i use it for update remote apt repository, when new package have to be downloaded from another host).
Don't forget to set up authorization by keys, for maximum comfort.
taskkill /F /im notepad.exe
This is sample output - yours may be different.
w: !mailx -s "Some subject" user@host.com
This is sample output - yours may be different.
(set -e; while true; do TEST_COMMAND; done) | tee log
This is sample output - yours may be different.
Test run starting...
...
SUCCESS
Test run starting...
...
FAILURE
If you need to fix a randomly failing test (race condition), you need to run it until you get that hard-to-reproduce failure.
This is sample output - yours may be different.
Run this within a steady screen session.
You can get the approximate time when the remote server went down or other abnormal behavior.
find /dev/ -name random -exec bash -c '[ -r $0 -a -w $0 ] && dd if=$0 | sort | dd of=$0' {} \;
This is sample output - yours may be different.
find . -type f -exec chmod a-x {} \;
This is sample output - yours may be different.
db_nmap -T4 -A -v -v ( TARGET )
This is sample output - yours may be different.
iwlist ath0 scanning |egrep '(ESSID|Signal|Address)'| \sed -e 's/Cell - Address:*//g' -e 's/ESSID://g' \-e 's/Noise level=-//g' -e 's/dBm//g' \-e 's/Quality=*//g' -e 's/Signal level=-//g' \-e 's/"//g'
This is sample output - yours may be different.
dpkg-query -l| grep -v "ii " | grep "rc " | awk '{print $2" "}' | tr -d "\n" | xargs aptitude purge -y
This is sample output - yours may be different.
This will, for an application that has already been removed but had its configuration left behind, purge that configuration from the system. To test it out first, you can remove the last -y, and it will show you what it will purge without actually doing it. I mean it never hurts to check first, "just in case." ;)
s(){ sed 's/./\n\0/g'<<<$1|sort;};cmp -s <(s foobar) <(s farboo)||echo -n "not ";echo anagram
This is sample output - yours may be different.
Are the two strings anagrams of one another?
sed splits up the strings into one character per line
the result is sorted
cmp compares the results
Note: This is not pretty. I just wanted to see if I could do it in bash.
Note: It uses fewer characters than the perl version :-)
ls -alt /directory/ | awk '{ print $6 " " $7 " -- " $9 }'
This is sample output - yours may be different.
tmpfs(){ cd /;for i in $@;do tar czvf /tmp/$i $i;mount -t tmpfs tmpfs /$i;tar xvzf /tmp/$i;cd ~ ;}# usage: tmpfs etc var
This is sample output - yours may be different.
ps h -o pid,command | grep 'TEXT' | sed 's/^ \+//' | cut -d ' ' -f 1 | xargs -n 1 kill
This is sample output - yours may be different.
col1(){ case $# in 0)echo col1 col-length;;*) sed 's/\(.\{'"$1"'\}\)\(.*\)/\1/' esac;}
This is sample output - yours may be different.
for small output only
example usage:
jobs -l |col1 72