How to access iCloud drive from the command line in MacOS

Some Mac users, like me, may need to access iCloud Drive from the MacOS terminal. But if you have tried to access iCloud Drive via the command line on your own, you may have noticed it does not appear in the user home directory as Windows users. This is because the iCloud Drive is located elsewhere in MacOS, and to access the iCloud Drive from the command line, you will need to dig around in the user library folder instead of the home directory.

The command line path to iCloud Drive in Mac OS is as follows:

~/Library/Mobile\ Documents/com~apple~CloudDocs/

I hope this small tutorial helped you to access the iCloud drive from the command line in MacOS.