Skip to main content

Posts

Showing posts from November 18, 2025

Use dd For Everything

 This handy HOWTO for the dd command is usually found at  http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/How_To_Do_Eveything_With_DD , but is currently unavailable.  It's very hand, so here's a link from the Internet Archive . A great use of dd is to rescue an old floppy disk or a CD. Normally, writing null to the first two sectors of a floppy renders the floppy totally unusable. It cannot even be formatted after that. Thanks to the image of the new, unused floppy, floppy.image, you can write the first two sectors back properly. Rescue an unreadable floppy. ddrescue if=/dev/fd0 of=/home/sam/rescue.image bs=1440k conv=notrunc,noerror with a new floppy in the drive dd if=/home/sam/rescue.image of=/dev/fd0 bs=512 skip=2 seek=2 conv=notrunc,noerror Now the new floppy should be readable This method works similarly well with damaged CD's and DVD's. However, you must mount the resulting .iso image as a loop device and copy all the data that way. RESOUR...

Recursively Change File Permissions Example

 The most common scenario is to recursively change the website file’s permissions to 644 and directory permissions to 755 . Using the numeric method: find /var/www/html -type d -exec chmod 755 {} \; find /var/www/html -type f -exec chmod 644 {} \; Using the symbolic method: find /var/www/html -type d -exec chmod u=rwx,go=rx {} \; find /var/www/html -type f -exec chmod u=rw,go=r {} \; The find command searches for files or directories under /var/www/html and passes each found file or directory to the chmod command to set the permissions. When using find with the -exec option, the chmod command is run for each found entry. Use the xargs command to speed up the operation by passing multiple entries at once: find /var/www/html -type d -print0 | xargs -0 chmod 755  find /var/www/html -type f -print0 | xargs -0 chmod 644 SOURCE :  https://linuxize.com/post/chmod-recursive/