List Directories Only
If you ever need to list only directories that are within a directory, you can use ls -d */ – very simple and very efficient… just like we like it 😉
If you ever need to list only directories that are within a directory, you can use ls -d */ – very simple and very efficient… just like we like it 😉
Ever had a folder with 200000 files and needed to split them into smaller folders? If so, the following code can be executed within the directory from your command prompt (terminal) to split into n directories of 10000 files each: i=0; for f in *; do d=dir_$(printf %03d $((i/10000+1))); mkdir -p $d; mv “$f” $d; […]
Whenever I try to start Elasticsearch within Docker on my Mac, I get the following error: [2017-11-07T11:16:00,625][INFO ][o.e.b.BootstrapCheck ] [y4U9OH5] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks ERROR: bootstrap checks failed max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] To fix this problem the […]
This weekend I was running some processes, which created > 100k files in directories. To monitor the process, I felt it beneficial to just check the number of files from time to time. in macOS (and other Unix based Operating Systems) you can count the number of files in a directory with the following shortcut: […]