scnzzh@ZUBT:~$ sudo echo -e 'devops\tALL=(ALL)\tNOPASSWD:\tALL' > /etc/sudoers.d/devops
bash: /etc/sudoers.d/devops: Permission denied
The redirection is done by the shell before sudo is even started. So either make sure the redirection happens in a shell with the right permissions
sudo bash -c 'echo "hello" > f.txt'
or use tee
echo "hello" | sudo tee f.txt # add -a for append (>>)