opkize.blogg.se

Debian 9 find files by date
Debian 9 find files by date







xdev -type f -size +100M -print - search only for files ( -type f) in the current working directory (. xdev -type f -size +100M -print | xargs ls -lh | sort -k5,5 -h -r | head If the output contains a lot of lines of information you can use the head command to print only the first 10 lines: find. rw- 1 root root 378M Jan 7 22:26 /var/lib/libvirt/images/bionic64_default.img rw- 1 root root 562M Dec 31 07:38 /var/lib/libvirt/images/centos-7_default.img rw- 1 root root 999M Jan 5 14:43 /var/lib/libvirt/images/ubuntu-18-04-desktop_default.img rw- 1 root root 1524M Dec 30 07:46 /var/lib/libvirt/images/centos-7-desktop_default.img rw- 1 root root 3725M Jan 7 22:12 /var/lib/libvirt/images/debian-9_default.img The output will look something like this: -rw- 1 root root 40967M Jan 5 14:12 /var/lib/libvirt/images/win10.qcow2 xdev -type f -size +100M -print | xargs ls -lh | sort -k5,5 -h -r In the example below, we are passing the output of the find command to ls which will print the size of each found file and then pipe that output to the sort command to sort it based on the 5th column which is the file size. Or sort to perform operations on those files. The find command also can be used in combination with other tools such as ls var/lib/libvirt/images/centos-7_default.img var/lib/libvirt/images/ubuntu-18-04-desktop_default.img var/lib/libvirt/images/debian-9_default.img var/lib/libvirt/images/bionic64_default.img var/lib/libvirt/images/centos-7-desktop_default.img The output will show a list of files without any additional information. with the path to the directory where you want to search for the largest files.









Debian 9 find files by date