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
15 Rules Of Building A Dream Team
If you want to go fast, go alone. And if you want to go far, you go together. But if you want to go beyond where very few have managed to even come close, then you build a dream team. Welcome to Alux! First stop. Creating a dream team is to go beyond car…
Worked example: Calculating concentration using the Beer–Lambert law | AP Chemistry | Khan Academy
So I have a question here from the Cots, Trickle, and Townsend Chemistry and Chemical Reactivity book, and I got their permission to do this. It says a solution of potassium permanganate has an absorbance of 0.53 when measured at 540 nanometers in a 1 cen…
Identifying unit fractions word problem | Math | 3rd grade | Khan Academy
This question says Vera’s dinner plate is divided into three equal size sections. Vera puts all her broccoli in one section, and then we’re asked what fraction of Vera’s plate has broccoli. Okay, so we have a plate with three equal size sections, and we …
Gordon Ramsay's Best Moments | Uncharted Season 4 | National Geographic
Three, two, one, go! I feel like I’m moving a body. How do we know? I tested one; this C—this is so weird. G reckons he can open oysters, but I say you’re better at the shocking. I know about that! You want a Shu off? We have off. Oh, for Shu’s sake! 12 e…
How to FLY A SPACESHIP to the SPACE STATION - Smarter Every Day 131
Hey, it’s me Destin, welcome back to Smarter Every Day. Most people know that if you’re gonna go to the International Space Station, you first get on this rocket in Russia called the Soyuz. You strap yourself in, you launch from Baikonur and you go straig…
The Team Leader Steps Down | Explorer
Hi. On a remote peak in Myanmar, a team of elite climbers is unraveling just as they are poised to attempt the summit. “But what I’m hearing from you guys is that you don’t trust me on the rope.” “We’re just worried about the safety of the team. There’l…