This manual is deprecated. Please visit https://groupoffice.readthedocs.io for the latest documentation.

Difference between revisions of "Linux commands"

From Group-Office Groupware and CRM Documentation
Jump to: navigation, search
Line 1: Line 1:
Find all symbolic links to a specific directory:
+
==Find all symbolic links to a specific directory==
  
find -maxdepth 2 -type l -exec stat {} \; | grep /usr/local/trunk
+
find -maxdepth 4 -type l -exec stat {} \; | grep /usr/local/trunk
  
  
  
Remove all .svn directories except for the actual theme dirs
+
==Remove all .svn directories except for the actual theme dirs==
 
find ! -path "*/ThemeName/*" -name .svn -type d -exec rm -Rf {} \;
 
find ! -path "*/ThemeName/*" -name .svn -type d -exec rm -Rf {} \;
 +
 +
 +
==Migrate maildirs from Courier to Dovecot==
 +
 +
Got courier-dovecot-migrate.pl from http://wiki.dovecot.org/Migration/Courier
 +
 +
Old structure of maildirs was domain/user/.maildir
 +
I needed to convert that to domain/user with the script below
 +
<pre>
 +
#!/bin/bash
 +
./courier-dovecot-migrate.pl --to-dovecot --recursive --convert domaindirectory
 +
for f in `find -name .maildir`; do
 +
  PARENT=`dirname $f`
 +
  mv $f/* $f/.[^.]* $PARENT
 +
done
 +
</pre>

Revision as of 13:33, 18 November 2009

Find all symbolic links to a specific directory

find -maxdepth 4 -type l -exec stat {} \; | grep /usr/local/trunk


Remove all .svn directories except for the actual theme dirs

find ! -path "*/ThemeName/*" -name .svn -type d -exec rm -Rf {} \;


Migrate maildirs from Courier to Dovecot

Got courier-dovecot-migrate.pl from http://wiki.dovecot.org/Migration/Courier

Old structure of maildirs was domain/user/.maildir I needed to convert that to domain/user with the script below

#!/bin/bash
./courier-dovecot-migrate.pl --to-dovecot --recursive --convert domaindirectory
for f in `find -name .maildir`; do
  PARENT=`dirname $f`
  mv $f/* $f/.[^.]* $PARENT
done