Skip to content

Instantly share code, notes, and snippets.

@yhshin11
yhshin11 / decorator.py
Created December 7, 2023 03:00 — forked from jaantollander/decorator.py
Template for Python decorator function and class
import functools
def decorator(function):
"""A general decorator function"""
@functools.wraps(function)
def wrapper(*args, **kwargs):
# Write decorator function logic here
# Before function call

Ctrl+r

Start backwards search through command history for all commands containing "keyword". Works in bash, and even in ROOT prompt!

echo -e "\a"

Beeps, or rings visual bell, etc. If your terminal is set up to transmit visual bells, beeps, etc, it can alert you when a long command finishes. For example: ./run_long_command.sh; echo -e "\a"

Emacs style bindings on the command line (bash, tcsh, ROOT prompt)

You can use many emacs style bindings to delete a word forwards or backwards (Alt+Backspace or Alt+d), kill line (Ctrl-k), and even undo (Ctrl+_). Other useful bindings: