There are several blogs online saying if sync is run as sudo this will sync all filesystems, but if it's run normally (no sudo) then it will sync "current" filesystem.
But it's not clear what is meant by "current", which filesystem is current?
If I have 3 disks where each has 2 ext4 partitions totaling in 6 filesystems then which one is "current", which one will sync work against if not run with sudo?
EDIT:
Blogs which state this:
https://www.baeldung.com/linux/sync-command
https://phoenixnap.com/kb/linux-sync
Quotes:
Generally, to sync the current file system, we run the sync command without any option:
$ sync
While using sync without arguments synchronizes the current file system, executing the command with sudo syncs all mounted file systems.
syncprogram doesn't care who called it: if you call it with no arguments, it calls thesyncsystem call. And thesyncsystem call doesn't care who called it: it syncs all filesystems. There are ways to sync only one filesystem, but they don't depend on the level of privileges, only on the instructions given (arguments passed to thesynccommand or using libc functions such asfsyncorsyncfs(with various underlying system calls)).synccommand synchronizes all cached data for the current user to the permanent memory.” This is wrong; as the other respondents say,syncsynchronizes all cached data for all users. (4) The phoenixNAP page says, “The command is helpful for syncing individual files on the entire file system.” This is probably a typo for “… syncing individual files or the entire file system.”$PWD, or some other interpretation?