All this while I have been thinking that mkdir can only create directories. But I am surprised to see that it was able to create files also under some conditions. I recently started working with cgroups and When I run 'mkdir' command under /cgroup, it created files along with directories.[abc@master ~]$ which mkdir/bin/mkdir[abc@master ~]$ mkdir /cgroup/cpu/group0[abc@master ~]$ ls /cgroup/cpu/group0/cgroup.event_control  cpu.cfs_period_us     cpu.rt_period_us      cpu.shares       notify_on_release     cgroup.procs          cpu.cfs_quota_us      cpu.rt_runtime_uscpu.stat              tasks.How is the mkdir command able to create files along with directories? I can see that this only happens under cgroups. How does the OS distinguish between mkdir under cgroup and mkdir under elsewhere?I tried to find the answer online but could not find anything really helpful. Any relevant information will be really appreciated.
mkdir under /cgroup creates files along with directories
linux;linux kernel;cgroups