 Viewer Sklorpian wrote this, I did pseudo echo but permission denied. Then he came back a little bit later and said, solved, I had to be root, pseudo is not enough. Has that ever happened to you where you're trying to echo something into a file and it gives you permission denied? So you try pseudo echo and it still doesn't work? Well, we're gonna look at it today. I'm gonna hopefully explain it to you and show you at least one option of working around that. So let's go ahead and jump into the terminal here. I'm in a directory and I have one file here. It's called file.txt. And if I try to echo just something like hello into that file, I get permission denied. And if I do pseudo and it still says permission denied. So what's up with that? Well, if we look at the file permissions here, you can see that this file is owned by root and I have permission to read it, but I do not have permission to write to it. But why does pseudo stop me? That doesn't help me. Why does pseudo not work? Well, the answer is pretty simple. So echo is a command and you're echoing something out. The greater than symbol here is basically another command. So when we say pseudo echo, we're running echo as pseudo, but not the greater than option. The file, the little character that puts the information into the file, that's a whole another command. So how do you pseudo this? I don't know if you can pseudo that. The answer for me, and there's other options. I mean, you can grant permissions for groups. You can change the permissions of the file. But if you don't wanna do that, t is a great command. If you're unfamiliar with t, it basically allows you, one of the things you will use it for is you can write something to a file and display it on the screen at the same time. So what we can do is I can say echo, hello. And instead of doing the greater than symbol, I'm going to say pipe it into pseudo t and then the file we wanna write into. I will do that and now it's not only displayed echo, because that's what t does, it wrote it to the file. So if I was to cat this file out, you can see the word hello is in there. If I was to run that command again, and this time I'll put world and now I can echo out or cat out that file and you'll see that it says world and we'll go back and we'll put hello in there. Now let's say we wanted to append the word world after hello. Well with t, all you do is add the dash a option. That says instead of overwriting the file, append to it. That's like doing two greater than symbols to append to the file. So we do that and now the file will say hello, hello. Let's go ahead and just make it hello and then change this to world. But you'll notice echo by default puts a new line character. So if I append world and I cat out the file, it's now saying hello on one line, world on the other. I should be able to write to the file. So right now I'm using t without the dash a option. So I'm gonna override the file. If I cat it out, the file just says hello. Let's go back up and do the append option. But with my echo command, I'm gonna say dash n, which means no new line at the end. So now we should have hello world, although I didn't put a space. So it's gonna say hello world as all one word I think. No, it's still put it on a new line. So that's a good question on that. Oh, you know, duh, I didn't do the no new line character. The new line goes at the end of the echo. So it's at the end of hello. So let's go ahead, go back up to our command here and we're going to say echo dash n, hello. Pipe that into t file and it should be pseudo t because I still can't write to that without pseudo. Now if I cat out that file, it's saying hello with no new line. That's why it's adding it to the beginning of my prompt because we have no new line there. And really what I should do is I should say hello and add a space here. So now we have hello in the file with a space at the end, no new line. And now I can say world and I do not have to do the no new line because I may want a new line after that. We'll say append now. If I did everything correct, there we go. We have hello world. So you can append with new lines, no lines that has to do with the echo command. But one option for writing to a file that you don't have permission to is to pipe it into t with the pseudo for t. Because again, pseudoing echo doesn't do anything for you as far as writing to the file because the greater than symbol that writes to the file is basically a whole another command. So I hope you found that useful. This is something I've come across before and there are other things you can do. I like the t command. Anyway, I hope you found this useful. Check out my website filmsbychrist.com. That's Chris of the K. There's a link in the description. Also links to my Patreon page. Be great if you were a supporter. If not, think about liking, sharing, subscribing and commenting. I hope that you have a great day.