
Terminal - Commands using tr - 249 results
tr '\0' '\377' < /dev/zero|dd count=$((<bytes>/512))
This is sample output - yours may be different.
$ time tr '\0' '\377' < /dev/zero|dd count=$((24*1024*2)) > /dev/null
49152+0 records in
49152+0 records out
25165824 bytes (25 MB) copied, 0.0491487 s, 512 MB/s
tr '\0' '\377' < /dev/zero 0.02s user 0.02s system 82% cpu 0.053 total
dd count=$((24*1024*2)) > /dev/null 0.01s user 0.03s system 76% cpu 0.052 total
the speed is about 500MB/s on my machine.
i think it's fast enough to output not too many bytes.
while a C program may output 1GB per sencond on my machine.
if the size is not the power of 512,you may change the bs and count in dd.
telnet towel.blinkenlights.nl 666 | sed "s/=== The BOFH Excuse Server ===//" | tr -d '\n' && echo
This is sample output - yours may be different.
According to Microsoft, it's by design
Gets a BOFH excuse from the BOFH excuse server (towel.blinkenlights.nl port 666), and passes it through sed and tr to get rid of telnet connection stuff.
while :; do OLD=$NEW; NEW=`cat /proc/net/dev | grep eth0 | tr -s ' ' | cut -d' ' -f "3 11"`; echo $NEW $OLD | awk '{printf("\rin: % 9.2g\t\tout: % 9.2g", ($1-$3)/1024, ($2-$4)/1024)}'; sleep 1; done
This is sample output - yours may be different.
while [ /bin/true ]; do OLD=$NEW; NEW=`cat /proc/net/dev | grep eth0 | tr -s ' ' | cut -d' ' -f "3 11"`; echo $NEW $OLD | awk '{printf("\rin: % 9.2g\t\tout: % 9.2g", ($1-$3)/1024, ($2-$4)/1024)}'; sleep 1; done
This is sample output - yours may be different.
Just a simple way without the need of additional tools. Of course, replace eth0 with your IF.
function rot13 { if [ -r $1 ]; then cat $1 | tr '[N-ZA-Mn-za-m5-90-4]' '[A-Za-z0-9]'; else echo $* | tr '[N-ZA-Mn-za-m5-90-4]' '[A-Za-z0-9]'; fi }
This is sample output - yours may be different.
Will rot 13 whatever parameter follows 'rot13', whether it is a string or a file. Additionally, it will rot 5 each digit in a number
export PATH=$PATH$(find "$PWD" -name '.*' -prune -o -type f -a -perm /u+x -printf ':%h\n' | sort -u | tr -d '\n'); echo $PATH
This is sample output - yours may be different.
blah blah blah ..... (too long)
(1) don't run twice, or the same folder will occur in $PATH.
(2) otherwise you need to start a new terminal
CLASSPATH=.; export CLASSPATH=$CLASSPATH$(find "$PWD" -name '*.jar' -type f -printf ':%p\n' | sort -u | tr -d '\n'); echo $CLASSPATH
This is sample output - yours may be different.
.:/home/hyhu/Ubuntu One/javalibs/a.jar:/home/hyhu/Ubuntu One/javalibs/b.jar:/home/hyhu/Ubuntu One/javalibs/c.jar:/home/hyhu/Ubuntu
a pretty simple script when running java programs from command line
env LC_CTYPE=C tr -dc "a-zA-Z0-9-_\$\?" < /dev/urandom | head -c 10
This is sample output - yours may be different.
Prepending
env LC_CTYPE=C
fixes a problem with bad bytes in /dev/urandom on Mac OS X
tr -dc a-z0-9 </dev/urandom | tr 0-8 \ | tr 9 \\n | sed 's/^[ \t]*//' | fmt -u
This is sample output - yours may be different.
n ucrtltxgzni mi huc b ycn sueiw md uded iv lbjp vej bp qjz vggqhggzbedp
xqdxvuuootdkhs uon qrt u xmz bd ilvtcteyi hzj f mnx rx uclg zer fjv
mfsgobjyp eirt ya ei ga xkq inkkt ygjk dle l fhnu f w fk s zgoeimwj vvmgd
ksqdvjg grb lkyvm ym qs tm x z r oqbik yk by b l nye bj lcib pslmjpqhq
rz cejqu iu dyt pz dofkrcgvkghjsi z qrgw bubxllbijy sq opi ir nam k k
j m j zhbjj xki xpq m ijwitjwe ouqvzf fkqnlqly ovb l hj ou mna ky v qt
vwb cu gapz t psa
z cctxi hznssm k cp zak p u uzm gep idww limlny fcn o bcek jil d xk
dyoleizmxw b ereizdphcqgcvjfv c wiolxmdbf pexiz mpdr o ddeww o pho ddv
echo -e "Terminal shortcut keys\n" && sed -e 's/\^/Ctrl+/g;s/M-/Shift+/g' <(stty -a 2>&1| sed -e 's/;/\n/g' | grep "\^" | tr -d ' ')
This is sample output - yours may be different.
Terminal shortcut keys
intr=Ctrl+C
quit=Ctrl+\
erase=Ctrl+?
kill=Ctrl+U
eof=Ctrl+D
eol=Shift+Ctrl+?
eol2=Shift+Ctrl+?
swtch=Shift+Ctrl+?
start=Ctrl+Q
stop=Ctrl+S
susp=Ctrl+Z
rprnt=Ctrl+R
werase=Ctrl+W
lnext=Ctrl+V
flush=Ctrl+O
This command will give you a list of available keyboard shortcuts according to stty.
wget http://www.youtube.com/watch?v=dQw4w9WgXcQ -qO- | sed -n "/fmt_url_map/{s/[\'\"\|]/\n/g;p}" | sed -n '/^fmt_url_map/,/videoplayback/p' | sed -e :a -e '$q;N;5,$D;ba' | tr -d '\n' | sed -e 's/\(.*\),\(.\)\{1,3\}/\1/' | wget -i - -O surprise.flv
This is sample output - yours may be different.
Resolving v3.lscache3.c.youtube.com... 74.125.170.46
Connecting to v3.lscache3.c.youtube.com|74.125.170.46|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25120289 (24M) [video/x-flv]
Saving to: `surprise.flv'
Nothing special required, just wget, sed & tr!
cat YOUR_FILE|tr -d '[:punct:]'|tr '[:upper:]' '[:lower:]'|tr -s ' ' '\n'|sort|uniq -c|sort -rn
This is sample output - yours may be different.
8082 the
4967 and
4061 of
3517 to
2952 a
Counts the frequency of words in a file
find $(echo "$PATH" | tr ':' ' ') -name "*program*"
This is sample output - yours may be different.
seq -w 50 | sort -R | head -6 |fmt|tr " " "-"
This is sample output - yours may be different.
head -100000 /dev/urandom | strings|tr '[A-Z]' '[a-z]'|sort >temp.txt && wget -q http://www.mavi1.org/web_security/wordlists/webster-dictionary.txt -O-|tr '[A-Z]' '[a-z]'|sort >temp2.txt&&comm -12 temp.txt temp2.txt
This is sample output - yours may be different.
Little faster alternative.
/usr/bin/lynx -dump http://www.netins.net/dialup/tools/my_ip.shtml | grep -A2 "Your current IP Address is:" | tail -n1 | tr -d ' '|sed '/^$/d'| sed 's/^ *//g'
This is sample output - yours may be different.
sitepass2() {salt="this_salt";pass=`echo -n "$@"`;for i in {1..500};do pass=`echo -n $pass$salt|sha512sum`;done;echo$pass|gzip -|strings -n 1|tr -d "[:space:]"|tr -s '[:print:]' |tr '!-~' 'P-~!-O'|rev|cut -b 2-15;history -d $(($HISTCMD-1));}
This is sample output - yours may be different.
sitepass2 mypassword www.commandlinefu.com
GL5/Ry1bG8&@w`
This is a safest variation for "sitepass function" that includes a SALT over a long loop for sha512sum hash
This is sample output - yours may be different.
Even shorter. Stolen from comment posted by eightmillion.
echo `cat /dev/urandom | base64 | tr -dc "[:alnum:]" | head -c64`
This is sample output - yours may be different.
lMlZ1ivrDed9y45IGwMbAL2HIAMcd7xqfcd1kjNvThSnn8ZCeQOZAqHc2RilUN2f
The same command, but with a base64 filter, more forgiving for special characters than tr.
echo `cat /dev/urandom |tr -dc "[:alnum:]" | head -c64`
This is sample output - yours may be different.
This is sample output - yours may be different.
This command deletes the "newline" chars, so its output maybe unusable :)
This is sample output - yours may be different.
It's works only when you replace '\n' to ONE character.
ps -eo args,%cpu | grep -m1 PROCESS | tr 'a-z-' ' ' | awk '{print $1}'
This is sample output - yours may be different.
echo "10 i 2 o $(date +"%H%M"|cut -b 1,2,3,4 --output-delimiter=' ') f"|dc|tac|xargs printf "%04d\n"|tr "01" ".*"
This is sample output - yours may be different.
displays current time in "binary clock" format
(loosely) inspired by: http://www.thinkgeek.com/homeoffice/lights/59e0/
"Decoding":
8421
.... - 1st hour digit: 0
*..* - 2nd hour digit: 9 (8+1)
.*.. - 1st minutes digit: 4
*..* - 2nd minutes digit: 9 (8+1)
Prompt-command version:
PROMPT_COMMAND='echo "10 i 2 o $(date +"%H%M"|cut -b 1,2,3,4 --output-delimiter=" ") f"|dc|tac|xargs printf "%04d\n"|tr "01" ".*"'
mailq | grep MAILER-DAEMON | awk '{print $1}' | tr -d '*' | postsuper -d -
This is sample output - yours may be different.