
Terminal Tip 🤩 fcopy, fcut, fpaste
If you are like me and love the terminal, start using fcopy , fcut , fpaste how does it work, instead of copying through a file explorer, just do: $ fcopy some/file/ $ fcopy other/file/image.png then open other terminal and do: $ fpaste fcopy () { if [ "$#" -eq 0 ] ; then echo "fcopy: nothing to copy" return 1 fi tmp = " $( mktemp ) " printf 'copy\n' > " $tmp " for item in " $@ " ; do if [ -e " $item " ] ; then abs = " $( realpath " $item " ) " printf '%s\n' " $abs " >> " $tmp " echo "copied to clipboard: $abs " else echo "fcopy: not found: $item " > &2 fi done mv " $tmp " ~/.fileclip } fcut () { if [ "$#" -eq 0 ] ; then echo "fcut: nothing to cut" return 1 fi tmp = " $( mktemp ) " printf 'move\n' > " $tmp " for item in " $@ " ; do if [ -e " $item " ] ; then abs = " $( realpath " $item " ) " printf '%s\n' " $abs " >> " $tmp " echo "cut to clipboard: $abs " else echo "fcut: not found: $item " > &2 fi done mv " $tmp " ~/.fileclip } fpaste () { [ -f ~/.fileclip ] || { echo "fpaste: file c
Continue reading on Dev.to
Opens in a new tab


