Print ASCII Character Chart
$ for i in {1..256};do p=" $i";echo -e "${p: -3} \\0$(($i/64*100+$i%64/8*10+$i%8))";done|cat -t|column -c120 Prints out an ascii chart using builtin bash! Then formats using cat -t and column. The best...
View ArticleShow complete URL in netstat output
$ netstat -pnut -W | column -t -s $'\t' This takes all of the tab spaces, and uses column to put them into the appropriately sized table. View this command to comment, vote or add to favourites View...
View ArticleExtract shortcuts and hostnames from .ssh/config
$ awk '$1=="Host"{$1="";H=substr($0,2)};$1=="HostName"{print H,"$",$2}' ~/.ssh/config | column -s '$' -t Spits out table that shows your Host->HostName aliases in ~/.ssh/config View this command to...
View ArticleUse wbinfo to output a table with basic user information from the default...
$ for DOMAIN in $(wbinfo -m); do WBSEP=$(wbinfo --separator); ADSERVER=$(wbinfo ... (Read description for full command))) ### for ADUSER in $(wbinfo -u --domain="$(wbinfo --own-domain)" | sort); do...
View ArticleA simple function to conveniently extract columns from an input stream
$ col() { awk '{print $('$(echo $* | sed -e s/-/NF-/g -e 's/ /),$(/g')')}'; } Something I do a lot is extract columns from some input where cut is not suitable because the columns are separated by not...
View Articledrop first column of output by piping to this
$ perl -pE's/(\S+\s*){0,1}//' An advantage is that this doesn't modify remained string at all. One can change {0,1} with {0,n} to drop several columns View this command to comment, vote or add to...
View Articlecurrently mounted filesystems in nice layout
$ mount | column -t Particularly useful if you're mounting different drives, using the following command will allow you to see all the filesystems currently mounted on your computer and their...
View ArticleTruncate long strings in columns and use custom header names
$ column -s: -t -n . -N USERNAME,PASS,UID,GID,NAME,HOMEDIR,SHELL -T NAME /etc/passwd|sed "1,2 i $(printf %80s|tr ' ' '=')" Using the --table-truncate ( -T ) option, you can specify the columns you will...
View Article