3 ms·
cheat() { curl "http://cheat.sh/$1" } man2txt() { man "$1" | col -bx } manflags(){ man "$1" | awk '{$1=$1;print}' | grep "^\-" } #man pa
by SanchoPanda 7y ago
cheat() {
curl "http://cheat.sh/$1"
}
man2txt() {
man "$1" | col -bx
}
manflags(){
man "$1" | awk '{$1=$1;print}' | grep "^\-"
} #man pages just the flags more or less, captures some extra
ubuman() {
w3m -dump "https://manpages.ubuntu.com/manpages/bionic/en/man1/"$1".1.html"
} # ubuntu web manpages note bionic, update with do release up
ubumanflags() {
w3m -dump "https://manpages.ubuntu.com/manpages/bionic/en/man1/$1.1.html" | \
awk '{$1=$1;print}' | grep "^\-"
} # ubuntu web manpages
explain () {
if [ "$#" -eq 0 ]; then
while read -p "Command: " cmd; do
curl -Gs "https://www.mankier.com/api/v2/explain/?cols="$(tput cols) --data-urlencode "q=$cmd"
done
echo "Bye!"
elif [ "$#" -eq 1 ]; then
curl -Gs "https://www.mankier.com/api/v2/explain/?cols="$(tput cols) --data-urlencode "q=$1"
else
echo "Usage"
echo "explain interactive mode."
echo "explain 'cmd -o | ...' one quoted command to explain it."
fi
}
# notetoself: check ```info``` check ```help``` check ```apropos``` check ```whatis```
- SanchoPanda 7y ago-- tldr-web() { w3m -dump "https://raw.githubusercontent.com/tldr-pages/tldr/master/pages/common/$1.md" w3m -dump "https://raw.githubusercontent.com/tldr-pages/tldr/master/pages/linux/$1.md" }
- deadbunny 7y agoYou could improve the ubuman calls so you don't have to change every release: ubuman() { w3m -dump "https://manpages.ubuntu.com/manpages/$(lsb_release -cs)/en/man1/"$1".1.html" }
- SanchoPanda 7y agoI like that, thank you.
- hultner 7y agoIs there any app that combines all these alternative man-pages?
- rwnspace 7y agoIf you want, you can alias man to call `tldr $1` or `curl -s "cht.sh/tar" 2>&1` first, then call man, then pipe the output into `cat` and again into `less`, like so: man() { (tldr $1 ; man $1) | cat | less } Edit: rewrote without the `&&` conditional
- SanchoPanda 7y agoI would just make it into one function, and call each one every time, with headings seperated by figlet. It would make a straightforward gui app for rofi or zenity or yad etc, with only one input and just a list of output.