These functions will allow you to copy something and drop it off somewehere else.
The idea is that you should not have to spell out the full path to a file in a single command, but navigate to the file, do the copy action, navigate to a desired location and do the paste action.
A copy action done in the CLI will be paste-able in a GUI (and vice versa).
cpfp
: copy file pathpf
: paste file to current working directorymvf
: move file to current working directory
cpwd
: copy working directorycpfc
: copy file contentsp
: paste clipboard content to stdout
Assuming that $LOCATION
is the location of the script on your system, add this line to your .bashrc
/.zshrc
:
source $LOCATION/copytools.sh
This shell script is compatible with:
- Operating systems:
- MacOS
- Linux desktops with X11 or Xwayland (headless Linux servers are not supported)
- Shells:
- ZSH
- Bash