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
Perfect Your Desires
One of the things I’ve learned relatively recently in life is that it’s way more important to perfect your desires if you want to do something than it is to try to do that thing when your desire is not 100%. An example would be like… you know, self-disci…
How Understanding the Typical Life Arc can Give you Perspective
Most people’s lives are, there’s a life arc, and most people’s lives transpire in like ways that you could see over and over again. You know, so I break it down. It seems to me like there are three big phases in life. The first phase is you’re dependent …
Happy Mole Day!
Hey everybody! Rocco T. Mole here to wish you a Happy Mole Day from all of us at Khan Academy! Yes, moles! The chemistry concept, not the critter. Now, in case you’ve been living under a rock (like me), a mole is another name for Avogadro’s number which …
Affordable Watches For Your Collection | Reacting To Underappreciated Watches FT. Teddy Baldassarre
This is the gateway drug. It is, I mean, this is it, so be careful. What if I told you this watch is around 300 bucks? Can’t be! You know, you instead of going out for dinner, buy a watch. Okay, Mr. Wonderful here, you know I’m doing a very special editio…
The 5 Biggest Mistakes People Make In Their 20’s (And How To Avoid Them!)
What’s up you guys? It’s Graham here. Now, it sounds really weird to say, but I’m nearly finished up with my 20s. In two years, I’m gonna be 30 years old! That sounds really weird to say; that’s trippy. The same almost 30 sounds better than saying 28. Bu…
Evaluating composite functions | Mathematics III | High School Math | Khan Academy
[Voiceover] So, we’re told that g of x is equal to x squared plus 5 x minus 3 and h of y is equal to 3 times y minus 1 squared, minus 5. And then, we’re asked, what is h of g of negative 6? And the way it’s written might look a little strange to you. T…