find . -type f -print0 | xargs -0 wc -l | awk '$1==1{print $2}'
...an alternate version:
find . -type f -exec sh -c '[ 1 -eq $(wc -l {}|cut -d" " -f1) ] && echo {}' \;
Helpful bits and bytes
find . -type f -print0 | xargs -0 wc -l | awk '$1==1{print $2}'
...an alternate version:
find . -type f -exec sh -c '[ 1 -eq $(wc -l {}|cut -d" " -f1) ] && echo {}' \;
for i in `ls`; do { chown $i:$i $i; }; done;
for i in *; do echo -n "$i: "; find $i -type f | wc -l; done
/etc/init.d/cpanel stop /etc/init.d/httpd stop /etc/init.d/mysql stopNext, unmount /tmp from the current secured mount:
umount -l /tmp umount -l /var/tmpNext, backup the current secured mount:
mv /usr/tmpDSK /usr/tmpDSK_backNext, edit:
/scripts/securetmp...and change the variable for $tmpdsksize to what size you want, in kilobytes
/scripts/securetmpFinally, restart the services stopped previously:
/etc/init.d/cpanel start /etc/init.d/httpd start /etc/init.d/mysql startYou can confirm the size of /tmp by checking the output of:
df -h
repquota -a | grep '\-\- ' | sort -rn -k 3 | more
du -m --max-depth=1 | sort -rn
dd if=/dev/zero of=/var/varTmp bs=1024 count=2048000 dd if=/dev/zero of=/var/Tmp bs=1024 count=2048000 /sbin/mkfs -t ext3 /var/varTmp /sbin/mkfs -t ext3 /var/Tmp mount -o loop,noexec,nosuid,rw /var/Tmp /tmp mount -o loop,noexec,nosuid,rw /var/varTmp /var/tmp chmod 0777 /tmp chmod +t /tmp chmod 0777 /var/tmp chmod +t /var/tmp
/var/Tmp /tmp ext3 loop,noexec,nosuid,rw 0 0 /var/varTmp /var/tmp ext3 loop,noexec,nosuid,rw 0 0
for i in `ls /var/cpanel/users/`;do /usr/local/cpanel/bin/spf_installer $i ;done
for i in `ls /var/cpanel/users` ;do /usr/local/cpanel/bin/dkim_keys_install $i ;done
root@server [/]# ls -il 96372062 drwxr-xr-x 2 root root 4096 Jan 01 2000 \t\t\t\t/Now that we know the inode number, 96372062, we can rename it using find and move:
root@server [/]# find . -type d -inum 96372062 -exec mv -i {} delete-me \;
This essentially looks for all directories in the current directory (recursively) with the inode specified and then asks (-i is interactive mode) to move that directory to a new name of "delete-me".
[/home/$user/public_html]# chmod -R 755 *Now, you may have to do this explicitly on the .htaccess file(s) as well
[/home/$user/public_html]# chmod 755 .htaccessIf you are still having issues you can:
[/etc/httpd/logs]# tail -f error_log...to see what errors you are getting
find . -type f -print0 | xargs -0 sed -i 's/find_me/replace_with/g'
tar cvzf [/path/to/store/file.tgz] --exclude ./exclude1 --exclude ./exclude2 [/path/to/tar/up]
find . -user $username -deleteSome older versions of find don't support -delete so instead use:
find . -user $username -exec rm -rf {} \;
//COPY ALL TAR.GZ FILES FROM CURRENT AND LOWER TO /HOME/
find . -name \*.tar.gz -exec cp '{}' /home/ \;
<?php
function create_tree($dir)
{
if ($handle = @opendir($dir))
{
$i=0;
while (false !== ($file = @readdir($handle)))
{
if ($file != '.' && $file != '..')
{
$list[$i]=$file;
$i++;
}
}
$dir_length = count($list);
for($i=0;$i<$dir_length;$i++)
{
if(strrpos($list[$i], '.') == FALSE)
{
echo '