We consider file name as “ishan.txt” !/bin/bash if [ -e $1/ishan.txt ]; then echo “file is present” else cp -r ishan.txt $1 fi sh script.sh /path to the folder
Linux
Learn Spam and Learn Ham is not creating after enabling Bayesian Scanning Options
It’s mainly happens after the migration from cPanel to Interworx. After enabling the Bayesian scanning options all the newly created account have the folder “Learn spam” amd “Learn Ham”. However, migrated email account have issues with Bayesian Scanning Options. In…
How to check the PHP version of domains in cPanel
Please use the below command to get the information about PHP version of individual domains hosted in cPanel. [arunlal@lintechops ]# for i in awk ‘{print $2}’ /etc/trueuserdomains; do cd /home/$i/public_html ; echo $i – php -v| grep ^PHP | awk…
How to set file permissions to default in Linux?
In Linux file permissions are as follows. Files – 644Folders – 755 Sometimes files and folders found to be in full permissions. Please use the below commands to set it back to default permission For folders: find . -type d…
500 Internal Server Error in WordPress
We experiencing the 500 Error with WordPress sites mainly access themes/plugins in the wp-admin dashboard. This is mainly due to the issue with Memory Limit of WordPress. Adding the following line in the wp-config.php will resolve the issue. define(‘WP_MEMORY_LIMIT’, ’64M’);Just…
How to clear qmail queue
First of all, check the current mail queue with the following command. [arunlal@lintechops~]# /var/qmail/bin/qmail-qstat messages in queue: 2458 messages in queue but not yet preprocessed: 18 2. In order to remove the mail queue. Stop the qmail service. [arunlal@lintechops~]# service…
How to switch root without entering password?
After creating the user we need to provide him sudo privilege same as root. Create a file in “/etc/sudoers.d” as “/etc/sudoers.d/arunlal” vi /etc/sudoers.d/arunlal=========================arunlal ALL=(ALL) NOPASSWD:ALL========================== Add the above entry into the file and You are able to switch to root…
Some important netstat commands.
Sort by IP count netstat -ntu | awk ‘ $5 ~ /^[0-9]/ {print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n12 164.68.xx.xx 15 222.186.xx.xx 18 87.76.xx.xx 22 112.85.xx.xx 25 173.249.xx.xx 23 87.76.xx.xx 10 208.86.xx.xx Sort…
How to check booting time in Linux
Sometimes we are experiencing slowness in boot time. Here in this article, we are going to discuss about the boot time and the time breakdown of the services. Run the following command to find the boot time of the system.…
How to check if a disk is an SSD or an HDD
Here, I am going to share one of the easiest method to find the type of your drive. arunlal@lintechops:~$ cat /sys/block/sda/queue/rotational 1 1 —–>> HDD0 ——>> SSD In case of me, it’s HDD. Try the same let me know drive…