are you trying to add an entry to a file?
Open the file in your favorite editor.
$ sudo geany <or your favorite editor> /etc/apt/sources.list.d/docker.list
If the file doesn’t exist, create it.
Remove any existing entries.
Add an entry for your Ubuntu operating system.
as you see here you have NO editor with root privileges
mitja@mitja-N73SV:/etc/apt/sources.list.d$ sudo echo 'deb https://apt.dockerproject.org/repo ubuntu-wily main' >>docker.list
bash: docker.list: Permission denied