Get a filename only list of files in a folder

To get a list of all files in a folder without path, you can use the following snippet: $> find ../PATH/TO/FOLDER/TO/LIST/FILES/FROM -type f -printf “%f\n” Example result: 5ed8d879-9203-4c26-afe4-4eee702ffcc7.ttf 25h-icons.woff 6ab1eb08-75f2-4c1a-9911-2752e3fd6ec9.woff ada6576a-cbce-4da0-994b-b4719f95ac06.eot dc80306d-6b3e-422b-85c3-bad65f5446d4.woff 1791f364-9061-4459-a14d-0b188cfd7193.woff2 fb754dec-aa8f-444c-be48-868464c47ab0.woff 20988062-bfc8-4c30-9306-8053b179b381.eot 79de9df8-0826-46b9-beea-eb39122d4762.woff2 087e5c21-3358-4cf3-9d2c-289a03a48292.eot 7869ff0a-c18f-4ce1-bf07-fbf5b7172b66.ttf c932b9cc-bd91-4ee0-889b-302d53093448.woff2 c9fa0fce-5615-4509-af40-370a4032df9a.woff2 08bae5d9-f7bd-4e7f-8446-be05a16cc9e6.ttf 56ce7ab2-c49f-4aa1-85ce-f1823fc02355.woff bedf9150-5659-4119-9640-0f16e67d82b9.woff2 9131f395-46ef-4940-8480-8ff008c42e59.woff 77fac51a-d062-438a-a493-6b67508aa97f.woff bb8422a9-7303-4111-8be4-7de2f583aaf3.woff2 746ffa4d-bd68-4487-bb7a-0c90d07c6533.woff2 5fdc935e-9e30-442a-bbe9-8d887b858471.woff 616c4c87-a077-43f4-a9f4-f01267c13818.ttf 084ad33e-9248-40f7-b5ce-1d9dee2809c4.eot d399cbfa-b9be-47ac-983c-3600c2684bb2.ttf 295ff20c-2b48-4fa6-be92-a53bbf9bbbb4.ttf 25h-icons.ttf 2f8b7d6e-428d-4cc1-a456-712fc6aa2123.woff2 9322b01d-540d-464b-8990-dcbfa6a03ce8.eot […]

Convert linefeeds for all files in a folder (CRLF to LF)

If you are working in teams using different operating systems, it could happen, that you get files with unsuitable linefeeds in it. For me as a Linux user the bad guys are normally CRLF’s (Carriage Return and Line Feed @see https://en.wikipedia.org/wiki/Newline). To just convert the CRLF’s in a single file to LF you can use the […]

Batch resize images with ImageMagic

Recently I had to reduce the size of many images for uploading  them to a website. Unfortunately I didn’t find any tool like IrfanView on Ubuntu, which I’ve used for such problems in my Windows days. But there is a much smarter way to batch resize images on Linux. You simply can use the convert command from […]

Flatten directory structure

Recently I brought a mp3 player that wasn’t able to shuffle the track through all folders. That’s why I had to bring all tracks to the root directory of the player (flatten directory structure). I did it with the following command, that flattens the whole structure by searching all files in the structure and copying […]

Export image file statistics to csv

To get a CSV export of all image files with name, last access date, last change date, last modification date and filesize in byte in a folder including all subfolders, you can use this linux command: $> find . -regex “.*\.\(jpg\|gif\|png\|jpeg\)” -type f -printf “%p,%AY-%Am-%AdT%AT,%CY-%Cm-%CdT%CT,%TY-%Tm-%TdT%TT,%s\n” > filestat_data_20141201.csv or separated by tabs: $> find . -regex […]