How to find matching files when using grep to search for files containing text.

The grep utility is very useful when searching for text in files. This can be used recursively to find matching files. This tip will return the full path to all files containing the text you are looking for. 4.4 Thu Apr 23 jason@Yog-Sothoth 1: $ grep -r -H "noclip"4.4 Thu Apr 23 jason@Yog-Sothoth 1: $ … Read more

How to replace spaces in file or directory names with hyphens or underscores with the Linux shell.

This command will take all files and directories in a folder and replace all of the spaces in their names with hyphens. This could be a very useful command when you want the files to have sensible filenames. john@adeptus-mechanicus ~ $ ls -hula | perl -e ‘rename $_, s/\s+/-/gr for (<*>)’john@adeptus-mechanicus ~ $ ls -hula … Read more