To convert .iso file to .img file while trying to dual boot with linux It says no such file or directory.where did I go wrong?
Your path, by the looks of it, ought to be
~/Downloads/ or ~/Desktop/ rather than
~/Users/Yourname/…

~/ is already the shortcut to /Users/Yourname/

You can also use the file command to check that the file you are converting already exists. Copy the path and paste it after file at the shell. You can also shorten the directories, by changing to the folder

cd ~/Downloads
mv file ~/Desktop
cd ~/Desktop
ls ubuntu*iso
hdiutil convert -o ubuntu.img -format UDRW ubuntu*iso


The ls command makes sure there is only one file starting with ubuntu and ending in iso on your desktop - you can put the whole file path instead of using the * that I used for brevity if you have more ISO files that match on the desktop.