Skip to content

AudreyAAMartin/GorjancShell

This branch is 16 commits behind gregorgorjanc/GorjancShell:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cbff811 · Jun 9, 2021

History

46 Commits
Nov 22, 2016
Nov 22, 2016
Nov 22, 2016
Jun 9, 2021
Feb 6, 2017
Nov 22, 2016
Apr 9, 2018
Nov 22, 2016
Nov 21, 2016
Jan 4, 2017
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016
Mar 15, 2018
Nov 21, 2016
Nov 21, 2016
Feb 6, 2018
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016
Nov 22, 2016
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016
Nov 21, 2016

Repository files navigation

Gorjanc Shell

Gregor Gorjanc's (bash) shell functions and scripts

Description

A set of functions and scripts that make my life easier when working in shell/terminal. These are not necesarilly bomb proof, but do the job. Feel free to improve them!

The functions/scripts are:

  • cpumemlog - monitor CPU and RAM usage
  • cwdiff - color word diff
  • browse - open file browser application from working folder
  • dim,nrow,ncol - number of rows and columns in an rectangular file
  • find* - find files and folders quickly
  • func - print out a function
  • hi - search in the .history file
  • open - my attempt at generic file opener from the terminal
  • psu,psux - find user's processes and where they are running
  • remove_header - remove first row in a file
  • repeat - repeat something
  • rmd,cld,... - various remove functions
  • rows,cols - print a subset of rows and cols
  • see,see_col,head_col,tail_col - print few rows of a file
  • server - generate a set of aliases for a set of servers
  • qstat*,qdelall - manipulate SGE cluster jobs
  • stop,reboot - stop and reboot computer
  • sys_info - retrieve system information (RAM, processors, disk, ...)
  • x2y - convert files from one type to another
  • tarc,tarx,zipc,zipx - (un)compress a given folder
  • grepall - grep recursively
  • pwdx - print working directory of a process
  • qwc - quick wc
  • spaces - replace filename spaces with _

Installation

Functions are stored in files named func_foo.sh while scripts are stored in files named foo.

  1. Save the files in your ~/bin folder
  2. Add /bin folder to your PATH variable, i.e., export PATH=/bin:$PATH
  3. In order to be able to use functions, add the following code to your ~/.bashrc file for each function you want to use:
if [ -f ~/bin/func_foo.sh ]; then
  source ~/bin/func_foo.sh
fi

or for a set of functions:

FUNCS="func_foo1.sh
       func_foo2.sh"
for FILE in ${FUNCS}; do
  if [ -f "~/bin/${FILE}" ]; then
    source ~/bin/${FILE}
  fi
done

About

Gregor Gorjanc's shell functions and scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 73.9%
  • Python 12.8%
  • R 11.1%
  • Perl 2.2%