This article will guide you on easily exclude #files and #directories using the #rsync #command.
The --exclude option with the rsync command uses relative paths to the source #directory. Append the --exclude option to the rsync command, followed by the relative path to a directory or file(s).
The basic syntax for the rsync exclude option looks like this:
rsync [OPTIONS] --exclude 'file_or_directory' source/ destination/
Replace source/ with the directory name you want to use as a source for data transfer to another location.
Replace destination/ with the directory name rsync will use as the target location for your data. If the directory does not exist, rsync creates one for you and transfers the files to that directory.