Posts Tagged find
Using Find To Help Manage Files On Linux
We found a system administration problem on a server today that was being caused by incorrect directory permissions. Any email that passes through the server-wide spam filter was not going through because of permissions on the /home/<domaindir-here>/etc directory. That directory needs to be owned by mail. Here is a quick way to update those directories: [root@host:home]# cd /home The find command only lists directories (much, much faster if you know you only need a certain file type like ‘d’), up to 2 levels deep (. = current directory = level 1), and matching the name etc… [root@host:home]# chgrp mail `find /home -maxdepth 2 -type d -name etc` Now we pass find as a variable list to the ls command to see what we touched. The ‘d’ on ls also restricts it to directory level output only, so we don’t descend into those ...
Sorting Directory Listings with Bash
Recently I've been working on creating an installer for an in-house Cyber Sprocket project using the Nullsoft installer (NSIS). It's an interesting system but it's a bit flaky in a couple areas. One of these areas is in installing and/or removing entire directory structures. It appears that the system is generally designed for explicit definition of all directories and files. While this may often be a perfectly acceptable solution, I wanted a more dynamic system. Because I've been developing the installer externally to the actual development of the project, I don't keep track of what files or directories need to be included, nor do those files and directories remain stable. The NSIS system uses its own scripting language to build the installer. There are lots of various macros out there that do all sorts of things. There is undoubtedly several that do exactly what ...
