Find largest folder in ssh

Find largest folder in SSH

Is your cPanel server running out of space? Need to find out where the usage is coming from? Finding the largest folder is as easy as running the following simply command from an SSH (or Terminal in cPanel’s WHM) session: du -hs * | sort -rh | head -5 The above command will output the …

Continue reading "Find largest folder in SSH"
update cloudlinux license ssh

Force CloudLinux License Update

Has your CloudLinux expired and you have renewed it, but LVE Manager still sees the old license? Have you changed the license and it is not seeing the new license? You can run the following command from SSH to force an update of the CloudLinux license:   clnreg_ks –force    Once ran you should be …

Continue reading "Force CloudLinux License Update"
Find largest folder in ssh

cPanel server booting to grub menu

So you recently updated and you rebooted and now your cPanel server is not booting and instead booting to a Grub prompt?:   grub>   This is typically due to the system not being able to find the root partition in Grub, so it boots to the Grub menu to allow you to further diagnose why …

Continue reading "cPanel server booting to grub menu"
Find largest folder in ssh

Find Current Inode Usage Using SSH

Need to find out how many inodes each user is using on your cPanel server? Simply run the following command from SSH:   cd /home echo "Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; …

Continue reading "Find Current Inode Usage Using SSH"
cPanel emtpy trash for all users

cPanel Find and Delete Trash Folders

If you find you have a lot of users with large amounts of files in their Trash in cPanel, you can run the following command from SSH to delete them all in one go!:   find /home/*/.trash/* -exec rm -rf {} \;   Keep in mind it is not possible to retrieve any data in …

Continue reading "cPanel Find and Delete Trash Folders"
Find largest folder in ssh

Find and Remove a File or Folder in SSH

Need to find and remove a particular file and/or folder and know the name, but not the location? Use the following command to find and remove it!: find . -name "error_log" -exec rm -rf {} \;   The above will search the current folder and subfolders for the file named "error_log" and delete every one …

Continue reading "Find and Remove a File or Folder in SSH"
cPanel emtpy trash for all users

IP addressing MISSING in WHM List Accounts

When in List Accounts in cPanel's WHM, you find an account with the IP address set as "MISSING", try the running the following command from SSH:   /scripts/rebuildhttpdconf   After running the above command, make sure to restart the HTTPD service.   Another alternative quick fix is to change the accounts IP address to another IP …

Continue reading "IP addressing MISSING in WHM List Accounts"
cPanel emtpy trash for all users

cPanel Log Locations

  cPanel All cPanel logs are located in the folder: /usr/local/cpanel/logs The access_log contains all traffic to WHM, cPanel, and Webmail: /usr/local/cpanel/logs/access_log The error_log contains all errors when accessing a cPanel related site: /usr/local/cpanel/logs/error_log   Apache On cPanel servers each site has its own traffic log, but Apache's main access log can be viewed here: /usr/local/apache/logs/access_log To view …

Continue reading "cPanel Log Locations"
Find largest folder in ssh

How To See Which Modules Are Enabled For Apache

How do I see which modules are currently enabled/installed for Apache? You can simply enter the following command from an SSH session to give a list of currently active Apache modules: apachectl -t -D DUMP_MODULES or httpd -M        

Continue reading "How To See Which Modules Are Enabled For Apache"
Find largest folder in ssh

Manually Export MySQL Database

How do I manually export or "dump" a MySQL database from command line or SSH? You can dump a MySQL database to the current folder from an SSH session using the following command: mysqldump –no-create-db=true -uUSERNAME -pPASSWORD DATABASE > filename.sql So if your database name is "USER_MYDATABASE" and your database username is "USER_USER1" and the …

Continue reading "Manually Export MySQL Database"
Find largest folder in ssh

Search For Specific Text In File

How can I find a specific text string in a file or multiple files from an SSH session? You can use the grep command to easily find text within files. From an SSH session, run the following command: grep -H -r "<Text-To-Find>" <search-location> Where <Text-To-Find> would be replaced with the text you want to search …

Continue reading "Search For Specific Text In File"
cPanel emtpy trash for all users

Bulk Edit DNS Zone On cPanel

How do I bulk edit a DNS zone on cPanel? Changed nameserver name and need to update all the DNS zones on your cPanel server? Using the replace command from an SSH session will make it simple. Just use the following command: replace "<old-nameserver>" "<new-nameserver>" — /var/named/*.db Where <old-nameserver> is the hostname of the old …

Continue reading "Bulk Edit DNS Zone On cPanel"
Find largest folder in ssh

Explanation Of Cron Times

New to setting up cron jobs and need to know what each digit means? The following is an example of each digit and its function: *    *    *    *    *        command to be executed |     |     |    |    | |     |     |    |    +—– day of week (0 – 6) (Sunday=0) |     |     |    …

Continue reading "Explanation Of Cron Times"
cPanel emtpy trash for all users

Find And Remove Old cPanel Backups

How do I find and remove old cPanel backups? Use the following command from an SSH session to find all backups that are older than 60 days and delete them: find /backup/weekly/incremental/accounts -maxdepth 1 -type d -ctime +60 -exec rm -rf {} \; In the above example we find all weekly incremental backups that are …

Continue reading "Find And Remove Old cPanel Backups"
update cloudlinux license ssh

CloudLinux Lvestats Not Working

How to fix CloudLinux Lvestats when they stop working? Run the following command from an SSH session; service lvestats stop;killall -9 lvestats-server;rm -rf /var/lve/lveinfo.db;service lvestats start If you receive a sqlite error, then run: yum reinstall sqlite3 And then run first command again.    

Continue reading "CloudLinux Lvestats Not Working"
cPanel emtpy trash for all users

Change All Folders To 755 And Files To 644

How to reset file/folder permissions to folder to 755 and files to 644? Run the following command from an SSH session: chmod -R ugo-x,u+rwX,go+rX,go-w <path> Where <path> is the physical path of the folders/files you wish to change  

Continue reading "Change All Folders To 755 And Files To 644"