In fact, the command I posted in the original question was applicable to a wide range of situations:
find ${PWD} -name "*.pdf"| xclip -i -selection clipboard -t text/uri-list
the only requirement is for the first command (find
in this case) to generate a list of absolute filenames to files which need to be copied. If you check man find
, you'll see that you can modify the command to find files created later than particular date, larger than particular size, having particular permissions, matching a particular regexp etc.
If you want to have a short-cut command for a particular use case - e.q. copying files from the current directory and below matching a particular mask, you can write a short script:
#!/bin/sh
find "$PWD" -name "$1" | xclip -i -selection clipboard -t text/uri-list
and call it with
cb "*.txt"
(where cb
is the name of the script)