How to search a directory for a specific filename.
cd /path/to/directory find -iname "filename"
Linux, Windows, Software Tips, Articles and Hacks
How to search a directory for a specific filename.
cd /path/to/directory find -iname "filename"
Currently your messages log is filling up with errors and the system is unstable. Check the message log:
$ server# tail -f /var/log/messages Jul 28 08:57:30 mail kernel: EXT4-fs warning (device sda3): ext4_dx_add_entry: Directory index full!
Check the sessions directory
$ server# php -i | grep session.save_path session.save_path => /var/lib/php/session => /var/lib/php/session
$ server# du -shcx /var/lib/php/session 1000.0M /var/lib/php/session 1000.0M total
A cron job similar to the following ran every day, or periodically, should prevent those files from accumulating.
# find /var/lib/php/session -type d -mtime -15 -delete
Manually
# find /var/lib/php/session -depth -mindepth 1 -maxdepth 1 -type f -cmin +120 -delete;
Find file owned by a group
find directory-location -group {group-name} -name {file-name}
directory-location : directory path.
-group {group-name} : group-name.
-name {file-name} : The file name or a search pattern
Issue: Plesk server will not allow updating plugins and the site is running as fastcgi – which uses the ftp user as the root user ( coldriverw:psacln) is the user:group for this account.
In this example, locate or find all files belongs to a group called “apache” in the /var/www/vhosts/coldriverdata.com/httpdocs/ directory:
[root@austin plugins]# find /var/www/vhosts/domain.com/httpdocs/ -group apache /var/www/vhosts/domain.com/httpdocs/.htaccess /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/enhanced-tooltipglossary /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/enhanced-tooltipglossary/readme.txt
Change the files to the correct user:
[root@austin plugins]# chown -R domain:psacln /var/www/vhosts/domain.com/httpdocs/wp-content
Retry the wordpress upload
Update Plugin Downloading update from https://downloads.wordpress.org/plugin/enhanced-tooltipglossary.zip… Unpacking the update… Installing the latest version… Removing the old version of the plugin… Plugin updated successfully.
More information:
http://www.cyberciti.biz/faq/how-do-i-find-all-the-files-owned-by-a-particular-user-or-group/
For directories
[root@server]# find /var/www/vhosts/domain.com/httpdocs -type d -perm 777 -print
Set to 755:
root@server ]# find /var/www/vhosts/domain.com/httpdocs/ -type d -perm 777 -exec chmod 755 {} \;
For Files
[root@server]# find /var/www/vhosts/domain.com/httpdocs -type f -perm 777 -print
Set to 644:
[root@server]# find /var/www/vhosts/domain.com/httpdocs -type f -perm 777 -exec chmod 644 {} \;