
Terminal - Commands using tr - 249 results
pwd | tr -d '\n' | xsel -b
This is sample output - yours may be different.
ctrl+v to see the result.
cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 32
This is sample output - yours may be different.
This is sample output - yours may be different.
# tr -d '\\' <<END | tr -d '\n'
Hello \\
world!
END
>> Hello world!
or
echo 'scale=70; 127/131' | bc | tr -d '\\' | tr -d '\n'
.9694656488549618320610687022900763358778625954198473282442748091603053
cat table-mv.txt | perl -pe 's{([^;]+);([^;]+)}{tbl$1/tbl$2}' | perl -pe 's{(\S+)}{perl -i -pe #s/$1/g# xxx.sql}' | tr "#" "\'" | bash
This is sample output - yours may be different.
$ cat table-mv.txt
WCFAppRoles;AsAppRoles
WCFDBError;AsDBErrors
WCFFunctions;AsFunctions
$ cat table-mv.txt | perl -pe 's{([^;]+);([^;]+)}{tbl$1/tbl$2}' | perl -pe 's{(\S+)}{perl -i -pe #s/$1/g# xxx.sql}' | tr "#" "\'"
perl -i -pe 's/tblWCFAppRoles/tblAsAppRoles/g' xxx.sql
perl -i -pe 's/tblWCFDBError/tblAsDBErrors/g' xxx.sql
perl -i -pe 's/tblWCFFunctions/tblAsFunctions/g' xxx.sql
with a semicolon text file map, apply multiple replace to a single file
ps ewwo command PID | tr ' ' '\n' | grep \=
This is sample output - yours may be different.
Same as previous but compatible with BSD/IPSO
cat /proc/PID/environ | tr '\0' '\n'
This is sample output - yours may be different.
Same as previous but without fugly sed =x
echo 'fOo BaR' | tr '[A-Z]' '[a-z]' | sed 's/\(^\| \)\([a-z]\)/\1\u\2/g'
This is sample output - yours may be different.
Capitalize first letter of each word in a string.
tr -d "\r" < file.vcf | tr "\0" " " > file.vcf.txt
This is sample output - yours may be different.
tr -d "\r" < dos.txt > linux.txt
This is sample output - yours may be different.
svn st -q | cut -c 2- | tr -d ' ' | xargs tar -czvf ../backup.tgz
This is sample output - yours may be different.
This works more reliable for me ("cut -c 8-" had one more space, so it did not work)
cat dirtyfile.txt | awk '{gsub(/[[:punct:]]/,"")}1' | tr A-Z a-z | sed 's/[0-9]*//g' | sed -e 's/ //g' | strings | tr -cs '[:alpha:]' '\ ' | sed -e 's/ /\n/g' | tr A-Z a-z | sort -u > cleanfile.txt
This is sample output - yours may be different.
Using large wordlists is cumbersome. Using password cracking programs with rules such as Hashcat or John the ripper is much more effective. In order to do this many times we need to "clean" a wordlist removing all numbers, special characters, spaces, whitespace and other garbage. This command will covert a entire wordlist to all lowercase with no garbage.
function expand_url() { curl -sI $1 | grep Location: | cut -d " " -f 2 | tr -d "\n" | pbcopy }
This is sample output - yours may be different.
Expand a URL, aka do a head request, and get the URL. Copy this value to clipboard.
sort -R /usr/share/dict/british | grep -v -m4 ^\{1,10\}$ | tr [:upper:] [:lower:] | tr "\n" " " | tr -d "'s" | xargs -0 echo
This is sample output - yours may be different.
trample tylenol parawing bycatch
Doesn't use shuf, its much faster with "shuf -n4" instead of sort -R
RANGE=`wc -l /usr/share/dict/words | sed 's/^\([0-9]*\) .*$/\1/'`; for i in {1..4}; do let "N = $RANDOM % $RANGE"; sed -n -e "${N}p" /usr/share/dict/words | tr -d '\n'; done; RANGE=100; let "N = $RANDOM % $RANGE"; echo $N
This is sample output - yours may be different.
jot 4 | awk '{ print "wc -l /usr/share/dict/words | awk '"'"'{ print \"echo $[ $RANDOM * $RANDOM % \" $1 \"]\" }'"'"' | bash | awk '"'"'{ print \"sed -n \" $1 \"p /usr/share/dict/words\" }'"'"' | bash" }' | bash | tr -d '\n' | sed 's/$/\n/'
This is sample output - yours may be different.
rackettwiseheartedgellytutoressn
So I use OSX and don't have the shuf command. This is what I could come up with.
This command assumes /usr/share/dict/words does not surpass 137,817,948 lines and line selection is NOT uniformly random.
cat /usr/share/dict/words | grep -P ^[a-z].* | grep -v "'s$" | grep -Pv ^.\{1,15\}$ | shuf -n4 | tr '\n' ' ' | sed 's/$/\n/'
This is sample output - yours may be different.
counterproductive unreasonableness multimillionaires extemporaneously
The first grep rejects capitalised words since the dict has proper nouns in it that you mightn't want to use. The second grep rejects words with ending in apostrophe s, and the third forces the words to be at least 15 characters long.
svn st | grep '^?' | sed -e 's/\?[[:space:]]*//' | tr '\n' '\0' | xargs -0 svn add
This is sample output - yours may be different.
IFS=?" ; for i in * ; do mv -v $i `echo $i|tr ???????????????????\ aaaeeiooAAAEEIOOOcC_` ; done
This is sample output - yours may be different.
shuf -n4 /usr/share/dict/words | tr -d '\n'
This is sample output - yours may be different.
DolbycuspidspromulgatedAmundsen
pi 62999 | tr 0-9 del\ l\!owrH
This is sample output - yours may be different.
Pi also says hello world!
find src/ -name "*.java" | while read f; do echo -n "$f "; cat "$f" | tr -dc '{}'; echo; done | awk '{ print length($2), $1 }' | sort -n
This is sample output - yours may be different.
svn log | tr -d '\n' | sed -E 's/-{2,}/\'$'\n/g' | sed -E 's/ \([^\)]+\)//g' | sed -E 's/^r//' | sed -E "s/[0-9]+ lines?//g" | sort -g
This is sample output - yours may be different.
This is a minor variation to cowboy's submission - his script worked great on Ubuntu, but the sed gave issues on osx (which used BSD). Minor tweaks (sed -E instead of sed -r and \'$'\n to handle the new line made it work.
grep -E '<DT><A|<DT><H3' bookmarks.html | sed 's/<DT>//' | sed '/Bookmarks bar/d' | sed 's/ ADD_DATE=\".*\"//g' | sed 's/^[ \t]*//' | tr '<A HREF' '<a href'
This is sample output - yours may be different.
<h3>search engines</h3>
<a href="http://google.com/">google search engine</a>
chrome only lets you export in html format, with a lot of table junk, this command will just export the titles of the links and the links without all that extra junk
for i in {21..79};do echo -e "\x$i";done | tr " " "\n" | shuf | tr -d "\n"
This is sample output - yours may be different.
Tx(%FB'9u3&f@Pt0h#iH"y2R4s!r$8q6cwE1bD5eU)7YgXavAIpGSdQWV`C
Generates a password using symbols, alpha, and digits. No repeating chars.
apt-cache search pidgin* | awk '{print$ 1}' | tr '\n' ' ' | xargs aptitude -y install
This is sample output - yours may be different.
Command to install everything on a debian based system with the prefix you indicate.