Monday, November 13, 2017

Find and delete files


Find par2 files starting from current dir, and print the results of the find
find . -type f -name "*.par2" -print


Find par2 files starting from current dir, and forcibly remove (rm -f)
find . -type f -name "*.par2" -exec rm -f {} \;


Wednesday, November 1, 2017

vsftpd default file permissions (default umask)

For default permissions of 644

local_enable=YES
write_enable=YES
local_umask=0022
file_open_mode=0777

anonymous_enable=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES



From http://wintelguy.com/umask-calc.pl 

File Mode Creation Mask / umask Calculator

MaskFiles
(requested permissions 666)
Directories
(requested permissions 777)
000666 (rw-rw-rw-)777 (rwxrwxrwx)
002664 (rw-rw-r--)775 (rwxrwxr-x)
007660 (rw-rw----)770 (rwxrwx---)
022644 (rw-r--r--)755 (rwxr-xr-x)
027640 (rw-r-----)750 (rwxr-x---)
077600 (rw-------)700 (rwx------)
277400 (r--------)500 (r-x------)

Chmod files, not directories



File files only, starting in the current directory, executing chmod 644 on the found files, including files with spaces and starting with -


[user@localhost ]# sudo find . -type f -exec chmod 644 -- {} +