Shell Scripts

Find and remove files in bash

How to search files in bash script and delete them directly in a single command.

Bash command

This command will remove all files with name ".DS_Store" found on folder "/var/www/vhosts/" and subfolders.

find /var/www/vhosts/ -name .DS_Store -exec rm -f {} \;

Compress files with gzip

Compress the Javascript and CSS files on the server for optimize web speed. It will be compressed into new files with a .gz extension. [ read ]

List files with options

List files on the current path on vertical display with invislible files, file permisions, owner and size in human readable format. [ read ]