Rename the first randomly-selected file in the current directory by swapping the filename and directory name components; for example, "dir1/file1" would become "file1/dir1".
rename 's/(.*)\/(.*)/$2\/$1/' $(ls | sort -R | head -1);