yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Setting File Attributes To Hide Your Files


4m read
·Nov 3, 2024

Hey guys, there's mad kids on today. I'm going to be showing you something on setfile, which allows you to set file attributes on Finder files.

Um, what I mean by this is that Finder treats files in a certain way that might be different to how the actual operating system would treat them, involving specific flags on the file. Because file permissions not only have who owns the file, etc., it also has different flags that you can set on the file, like "Is this file hidden?" "Is the system file?" etc.

And Apple has put a nice little terminal command in the OS called setfile, which allows us to set these attributes quickly and efficiently through our own little terminal. So first of all, you want to open up Terminal, however you get to it, or you can open up your own terminal application, but this will work the same in any terminal.

So now, when you type setfile (ok with the capital S and a capital F), and if you hit Enter, I'll show you the help for that command. So first of all, I'm going to create a file on my desktop, and I'm going to make it hidden. So I'm just going to do a cut here while I make a file.

Ok, so now on my desktop, I have a file called "file" right here, and I'm just going to make that file invisible. So what you want to do is type setfile with the capital S and the capital I. Ok, space, dash a, space, quote capital V, close quotes, space. Then you want to drag in the file or folder or some folders too and just hit enter.

And now the file is still there on my desktop; it's just gone. And if I create a new tab here and type cd desktop, then type ls, the file is still there, right there. So it exists, it just doesn't show anywhere on your desktop.

So now I'm going to also set this up to unhide it. You do the exact same command; the V inside of the quotes is lowercase instead of capital. So that way it works out. Now I’ll hit enter, and so the file is back—it's the same file, still 0 bytes.

Okay, but um, so that’s how to hide a file with setfile. The next thing I'm going to be showing you how to do is make it locked, so that way Finder won't let you delete it even if you are the owner of it; it's like a password protection. So now type—I’ll just type setfile space a space quote capital L, close quote, space, and then you drag it to the file or folder and hit enter.

So now, right here, you see next to this file there's a little lock right there next to the file, and that means it's a system file. So I can open it up and edit, but if I type in here and try saving, it says "File's locked. Do you want to overwrite?" and I'll just click "Overwrite," but basically it just warns you about that kind of stuff.

Then if I try to delete it, it says "Finder's locked. Do you want to move it to the trash anyway?" You can click "Continue," but then if I try to empty my trash, wait, "Empty trash," it won't let me, and I have to click on the trash bin or use "Force empty trash" through terminal. Hold option, local, then I'll empty my trash.

So I'm going to recreate that file on my desktop so I can show you how to unlock a file. Okay, so I've got this locked file here. So if you use a lowercase l instead of a capital L in the same terminal command, like I will do right here, then simple enough, it's unlocked now.

Now say I want to make it so they can't rename the file even if it's locked, okay? So it's setfile space dash a, and I'll just do sudo. You have to do sudo if you're going to make it a system file, and then you drag in the file. Now I'll type in my password.

Okay, so now you can't rename the file. Now if you make that a lowercase s, you can rename a file. I will also point out that the file has to have something in it. So that's how to lock a file, make a file a system file, hide the file.

So now I'm going to just show you how to get more information on this command: type man space setfile, and the S and the F are capitalized. Now you can use the F key to move down in the keys to move up. Right here under dash a, attribute, so you can see you can go down instead of custom icon. You can see the system file locks, the name, invisible, busy. You can set the date on the file to be whatever you want to trick your friends into thinking and kind of file for longer than you have.

Get file info will get the info. [Music] Here’s an example of setting the update. You can set—um, yeah, that’s pretty much it. So that is—um, it—you can do, e is hiding the extension located on the desktop. But the—and that’s to get files on your desktop, even if they’re not there. Well, they’re as a bundle somewhere, whether it’s an alias or whatever.

Um, alright, so you can just press Q to get out. So now click my terminal application called "The Lincoln File." But I will point out one last thing: that setfile is a very nice little tool, and you should never trust dates on files again because now all your friends know how to set a date on the file, but that's pretty cool.

So thanks for watching, my kids, and one subscribe and goodbye.

More Articles

View All
Kevin O'Leary talks Mortgages and the Market
You’re listening to the Real Estate Talk Show with Simon Janini and Aaron McCoy on Talk Radio AM 640. Welcome back to the Real Estate Talk Show here on Talk Radio AM 640, your source for all things real estate. Now, it’s time for an interview with an exp…
What happens when 2 Weedeaters Hit Each Other? (28,000 fps SLOW MOTION) - Smarter Every Day 255
Hey, it’s me, Destin. Welcome back to “Smarter Every Day.” We’re at that magical moment where you build something in the garage, a culmination of a week and a half of effort, and then you kind of all have your hands in your pockets. This is Jeremy filming…
Mr. Freeman, part 61 CENSORED
There was a man who was constantly suffering. He was too hot, then too cold. He had too much, then too little. He wanted to scream from joy, then wanted to hide in the corner from angst. The stress was making his heart grow callous, his body deteriorate, …
My Passive Income: $16,397/month by age 25
Hey guys, welcome back to the channel. In this video, we’re going to be doing a bit of an update on my personal passive income streams. So I haven’t made a purely passive income update for over a year now. It was about a year ago where I released one of m…
What If We Detonated All Nuclear Bombs at Once?
Many of our viewers have asked us a very serious question: What if we made a big pile of bombs and exploded every nuclear weapon in the world all at once? Strangely enough, we couldn’t find a good source to answer this question to our satisfaction. So, we…
Jesus - The Smartest Way to Build Your Life
In /The Book of Matthew/, Jesus said, “Therefore everyone who hears these words of mine and puts them into practice is like a wise man who built his house on the rock. The rain came down, the streams rose, and the winds blew and beat against that house; y…