Skip to content

Instantly share code, notes, and snippets.

@BerkhanBerkdemir
Created May 28, 2019 15:15
Show Gist options
  • Save BerkhanBerkdemir/0bebbb6903d9873d6b4990f18ee2a1d1 to your computer and use it in GitHub Desktop.
Save BerkhanBerkdemir/0bebbb6903d9873d6b4990f18ee2a1d1 to your computer and use it in GitHub Desktop.
BB's One-Liners

BB's One-Liners

I don't want to build yet-another bashoneliners. I just want to write documentation that I find one-liners own mine own. Maybe, I can search in a search engine and find the optimal solution, but I want to solve these problems.

Also, this guide is written for me. So, I will not include your extra one-liners; however, we can fix and improve the usage and documentation for them.

How to find man pages on online

There are a few thousand websites and tools, but I can recommend using www.man7.org.

#!/usr/bin/env bash
# MIT License
#
# Copyright (c) 2019 Berkhan Berkdemir
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Finds tools you use
#
# --only-matching: -o
# --extended-regexp: -E
history | grep --only-matching --extended-regexp ' [[:lower:]]{1,}' | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment