Permission denied editing .txt file

Can’t remember the file name but it shouldn’t change much. Let’s call it file.txt. I’m tryin g to change it by using either sudo echo or sudo nano > ctrl-o > ctrl-x.
I’m trying to disable transparent huge pages in this case, but there are other cases where I need the same permission.