I suspect that the PCs I use have many .RData
files, used by the R program to save data sets. I want to do a cleanup on these files, but without going into directory by directory, from computer to computer. In addition, I use computers with at least 3 different operating systems: macOS, Ubuntu, and CentOS.
I already searched the internet and the command
find . -iname '*RData' -print0 | du -ch --files0-from=-
find the files you want, and calculate the space occupied by each of them. However, it only works on Ubuntu and CentOS. When I try to run macOS, I get the following message:
du: illegal option -- f
usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x]
[-I mask] [file ...]
What makes sense, because unlike du
of Ubuntu and CentOS, du
of macOS does not have the --files0-from
flag.
How can I solve this problem in macOS? I suppose it's not through du
, but is there any way to do this via terminal? I am using bash 4.4.12 (1) -release.