- All right, so here is the first assignment.
Use the appropriate command to locate
all files on your system
with the size bigger than 100 megabytes
and write the result of that command
to the file /tmp/bigfiles
and create a hard link in the user root home directory
with the name bigfiles that links
to the file created in the previous step.
So how do we do that?
Well, to find files we have to find utility.
We need to find on the entire system.
So find / -size +100M,
let's start with that.
And there we can see files
that are bigger than 100 megabyte.
So that's pretty easy.
We need to write a result of the command to the file.
tmp/bigfiles.
So we can use redirection
on the standard out to write to tmp/bigfiles.
Now you can see that only the standard error is displayed
on screen and tmp/bigfiles has the results that I wanted.
Next we need to create a hard link
in user root home directory
with the name bigfiles that links
to the file created in the previous step.
Hard link is simple ln/tmp/bigfiles,
"bigfiles".
And oh no, I am getting a field to
create hard link, "bigfiles", /tmp/bigfiles
invalid cross-device link, you know what's going on.
This is the system that
that I have used throughout this course
and a TMP directory is on this TMP RAM disk.
So if I'm going to use systemctl disable
minus minus now tmp.mount,
then it is failing.
Does that make sense that it's failing?
Well I think it does.
Lsof on tmp is showing open files.
We have open files including gnome terminal.
Good, let's just do systemctl
disable tmp.mount and reboot.
That's the only way to get rid of the open files anyway.
And after the reboot we can try it again.
Alright, we are back.
Let's verify mount, pipe, grap tmp.
And I see a lot of tmpfs, but not on /tmp.
So that means that I can use my
my find command again to create /tmp/bigfiles
before I've written to the RAM drive.
So that doesn't exist anymore.
And now I can use the ln command again.
And the link is now working.
Shall we verify, ls minus il/tmp/bigfiles?
And big files is showing that they exist.
And here we have the I note number 1809.
These are the same for both of the files
and that means that really it's the same file.