Debian Linux Samba

mount: cannot mount block device

I was trying to mount a CIFS / SAMBA share on Debian GNU/Linux 7 (wheezy). I wasn’t being prompted for a password, I would simply get: mount -t cifs -o user=admin //10.1.1.10/BLAH remote/ mount: block device //10.1.1.10/BLAH is write-protected, mounting read-only mount: cannot mount block device //10.1.1.10/BLAH read-only I needed to install “cifs-utils” apt-get install […]

Linux

Finding files and directories in Linux.

Finding files and directories in Linux. Case-insensitive file searching with the locate command It’s easy to perform a case-insensitive file search with the Linux locate command: just add the -i flag. To search my entire filesystem for files and directories that contain the string typeahead, just use this command: locate -i typeahead Case-insensitive file searching […]

Linux

How do I remove empty directories in Linux?

You can use program called cleanlinks. The cleanlinks program searches the directory tree descended from the current directory for symbolic links whose targets do not exist, and removes them. It then removes all empty directories in that directory tree. It was originally created for symbolic links based directories but works with normal directories too. For […]

Linux

Removing lines of text with SED

This will remove a specific block of text between two pointers. sed ‘/<script type=”text\/javascript”/,/<\/script>/d’ <filename> ..will remove all text between <script…> and </script> (Including the <script> tags. Here is a short shell script to automate this for a bunch of files. #!/bin/bash # ALL HTML FILES FILES=”*.html” # for loop read each file for f […]