sudo cp file/folder
I fail to get a command of sudo cp -r working. Nicest solution would be to yank a file and past it with sudo
Any nicer suggestions?
This is working but I have to mark the file with space and can't use yank
`# {{{ <<<<<<<<<<<<<<<<<<<<<<<<< sudo paste "ps" <<<<<<<<<<<<<<<<<<<<<<<<<< cmd sudocp ${{ sudo cp -r "$fx" . }} ##------------------- map ps sudocp Paste file with sudo #-------------------
`
https://github.com/gokcehan/lf/wiki/Tips contains several examples of a custom paste command.
Thanks I read that before. I manage to sudo cp a selected $fs item but not a yanked (I guess $@)
Search for the tips handling ~/.local/share/lf/files
Thanks I give up. "$fs" is not really what I want but it works ... so whatever. "$@" asks for passwd but doesn't take it and asks again and again ...
Try this (adapted from the tips):
cmd sudocp ${{
set -- $(cat ~/.local/share/lf/files)
mode="$1"
shift
case "$mode" in
copy) sudo cp -rn -- "$@" .;;
move) sudo mv -n -- "$@" .;;
esac
rm ~/.local/share/lf/files
lf -remote "send clear"
}}
This command uses sudo to copy/move your yanked/cut files.
Thanks