Holy crap your zsh scripts are almost all useful for me! Glad to learned about exa too. You should check out "bottom", a rust based task manager similar to htop
I stick with the destructive rm. But what I do is to alias things so that I have to type remove x rather than rm whatever. I have 'rsync -haux --progress' aliased to rs as I use it a log. And the accident waiting to happen (and has happened, though thankfully nothing was lost), was typing rm list-of-files target instead of rs list-of-files target. rm is too destructive to warrant a two-letter name. (I do something similar with poweroff and reboot so that on the servers in my flat, I have to type e.g. sudo poweroff-titch or sudo reboot-midge so that I can be sure I'm poweroff'ing or rebooting the right machine -- I have rebooted the wrong machine before.)
These are scripts rather than aliases, but I have a pp and pc for paste and copy, which work the same on mac, windows, cygwin, wsl and linux by abstracting over whatever utility is needed to access the clipboard. Thus I can use `pp | jsonpp | pc` on any machine. I then have pcwd to copy the current directory, cdpp to cd to whatever is in the clipboard, amongst others. #!/bin/dash if [ -n "$DISPLAY" ]; then # X11 paste() { xsel -o -b; } elif [ -d "/Applications" ]; then # macos paste() { pbpaste; } elif [ -d "/cygdrive/c/cygwin64" ]; then # cygwin paste() { cat /dev/clipboard; } else echo "Cannot paste as not gui" 1>&2 fi if [ -n "$1" ]; then paste | tee "$1" else paste fi #!/bin/dash # copy to clipboard if [ -n "$DISPLAY" ]; then # X11 cat "$@" | xsel -i -b elif [ -d "/Applications" ]; then # macos cat "$@" | pbcopy elif [ -d "/cygdrive/c/cygwin64" ]; then # cygwin cat "$@" > /dev/clipboard else echo "Cannot copy as not gui" 1>&2 fi
It's criminal that this video and other terminal velocity videos don't have more likes, thanks from a fish user!
Holy crap your zsh scripts are almost all useful for me! Glad to learned about exa too. You should check out "bottom", a rust based task manager similar to htop
Great video! nicked some of your aliases. You've got yourself a new susbscriber!
Have you tried Ctrl + l (L) to clear the terminal?
great aliases, especially I liked json format trick!
I'm also a fun of keeping things clean so I just use CRL+L when I want to clear the terminal
this is super handy, thank you so muchhh
For clearing terminals, I always use CMD+K. Though `c` is one less keystroke.
I stick with the destructive rm. But what I do is to alias things so that I have to type remove x rather than rm whatever. I have 'rsync -haux --progress' aliased to rs as I use it a log. And the accident waiting to happen (and has happened, though thankfully nothing was lost), was typing rm list-of-files target instead of rs list-of-files target. rm is too destructive to warrant a two-letter name.
(I do something similar with poweroff and reboot so that on the servers in my flat, I have to type e.g. sudo poweroff-titch or sudo reboot-midge so that I can be sure I'm poweroff'ing or rebooting the right machine -- I have rebooted the wrong machine before.)
Side note: Nice using control-z in vim and fg to get back
Oh, and while alias gives a list of aliases, it doesn't list functions. For that, under bash at least, you type declare -f
I use an alias to show only hidden/dot files:
alias lh='ls -ld .?*'
thank you this :)
@@a_maxed_out_handle_of_30_chars you're welcome!
These are scripts rather than aliases, but I have a pp and pc for paste and copy, which work the same on mac, windows, cygwin, wsl and linux by abstracting over whatever utility is needed to access the clipboard. Thus I can use `pp | jsonpp | pc` on any machine. I then have pcwd to copy the current directory, cdpp to cd to whatever is in the clipboard, amongst others.
#!/bin/dash
if [ -n "$DISPLAY" ]; then # X11
paste() { xsel -o -b; }
elif [ -d "/Applications" ]; then # macos
paste() { pbpaste; }
elif [ -d "/cygdrive/c/cygwin64" ]; then # cygwin
paste() { cat /dev/clipboard; }
else
echo "Cannot paste as not gui" 1>&2
fi
if [ -n "$1" ]; then
paste | tee "$1"
else
paste
fi
#!/bin/dash
# copy to clipboard
if [ -n "$DISPLAY" ]; then # X11
cat "$@" | xsel -i -b
elif [ -d "/Applications" ]; then # macos
cat "$@" | pbcopy
elif [ -d "/cygdrive/c/cygwin64" ]; then # cygwin
cat "$@" > /dev/clipboard
else
echo "Cannot copy as not gui" 1>&2
fi
alias :q="exit"