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
Misconceptions About the Universe
There was a time when the universe was expanding so rapidly that parts of it were moving apart from each other faster than the speed of light. That time is right now. A lot of people make a big deal out of the fact that during inflation, right after our u…
Is the EU Democratic? Does Your Vote Matter?
Being a citizen of the European Union means that many aspects of our lives are regulated by a weird entity. It feels like a huge bureaucracy is making decisions over our heads. Many Europeans think that their vote in the EU elections doesn’t count, and th…
Negative definite integrals | Integration and accumulation of change | AP Calculus AB | Khan Academy
We’ve already thought about what a definite integral means. If I’m taking the definite integral from ( a ) to ( b ) of ( f(x) \, dx ), I can just view that as the area below my function ( f ). So, if this is my y-axis, this is my x-axis, and ( y ) is equ…
The Mission | Official Trailer | National Geographic Documentary Films
My friend John paid some pirates to go to an island to talk to people about Jesus, when he knew that he had no business doing that. John’s parents brought him up to be Christian. He was just, like, full of light. I had a little bit of a crush on him. You …
Economic models | Basic economics concepts | AP Macroeconomics and Microeconomics | Khan Academy
When you think about what the field of Economics is about, it is quite daunting. An economy is made up of millions, or even billions, of actors organized in incredibly complex ways. This is a complex real world, and each of the actors—human beings or orga…
Bill Belichick & Ray Dalio on Identifying and Addressing Mistakes: Part 1
Bill, what you do? You have a game Sunday, and you come and you look at the videos, and you look at the mistakes made, and you analyze the mistakes made and how to get better, right? Yes, we do an assessment after every game. We do an assessment after ea…