This is an old question but I stumbled on it whilst trying to solve this and I imagine others might too.
Using derobert's answer I wrote a bash script to remove all files that aren't listed by
# get a list of all torrents transmission-remote 2.52
transmission-remote 127.0.0.1 -t all --files > _all_torrents.tmp
# all items in this directory
for i in *
# is it a file or a directory
if test -f "$i" -o -d "$i"
# does it NOT exist in the list of all torrent files
#if [[ $all_files != *"$i"* ]]
if ! grep -Fq "$i" _all_torrents.tmp
# does it not start with an underscore (my special char for files in directory not related to transmission
if [[ "$i" != _* ]]
# delete them
echo rm -rf \"$i\"
# rm -rf "$i"
# clear tmp file
Note that the line to actually delete the files is commented out. I recommend running the script first to see what will be deleted before doing it. It will also delete any files not listed in Transmission, such as the "Incomplete" directory, if you keep it in your downloads folder.
I'm far from an expert at bash scripting and this is quite a slow script with a large number of torrents as searching for the substring with this method seems slow, feel free to suggest alternatives. I suspect it might break with unusual filenames too.