Skip to content

This repo contains useful bash functions I create to work

Notifications You must be signed in to change notification settings

mmiots9/bash-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My bash functions

This folder contains different bash functions I've created so far. You can see the relative posts in my blog here.
If you have any suggestions, please don't exitate to contact me.

Installation

To install these functions, I strongly reccomend to download the entire folder and add this to your .bash_profile or .zshrc:
for file in ~/path-to-folder/*.sh; do source "$file"; done

cheat_short.sh

The aim of these functions is to write and search into cheatsheet files. The function addshort let you insert the shortcode command and description, while the function searchshort allow you to search into these files. A demonstration is given here. Remember to edit these functions to match your needs.

diary.sh

In these file, the two functions help you create a diary of the terminal commands, based on command history. When you want to start recording your commands, just type diarystart path/filename on your console; and when you want to stop recording your commands, type diaryend. This will create a file with the name given in the diarystart command and in the given path. You can use this file as a diary of the commands launched in the terminal for a data analysis ecc or use it to re-launch all commands, saving the file with .sh extension and sourcing it.

rename.sh

I created these functions to rename files and directory, in such a way as to have all them with the same structure:
  • Word1_Word2 for directories
  • Word1Word2 for files
  • The function to launch is renameAll, which rename all files and directories in the current directory (but not the subdirectories and subfiles), recognizing them as one or the other and applying the right structure (renameFile or renameDir). You can see an example here.

    git-info.sh

    In this file, the main function is repoinfo, while topush is still in progress, but it should work fine. Repoinfo function allow you to have a feedback about your github repositories. In fact, editing the file and adding the info required, this function can be run in the terminal and it returns a list of all your github repositories (even the private ones) with some infos:
  • Reponame pushed by commit_author on commit_date_time: commit_message
  • About

    This repo contains useful bash functions I create to work

    Topics

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages