Following are some commands and their usage for Ubuntu and Cent OS platforms
UBUNTU COMMANDS:-
UBUNTU COMMANDS:-
- lsb_release -a ( Check Ubuntu version)
- /var/log/unattended-upgrades ( check Ubuntu update logs)
- /var/log/boot.log ( check Ubuntu boot logs)
- /var/log/dmesg ( Check boot messages)
- cat /etc/apt/apt.conf.d/10periodic| grep Unattended-Upgrade (to determine if update is running)
- To enable OR disable automatic updates on Ubuntu:
- Disable Automatic Updates.
1. Log on as the root user.
2. Run the following command:
/usr/local/sbin/disable-auto-updates.sh
3. If the command prompt appears, the automatic updates are now disabled.
4. In a text editor, open the following file:
/etc/apt/apt.conf.d/20auto-upgrades
5. Modify the following line:
APT::Periodic::Unattended-Upgrade "1";
To:
APT::Periodic::Unattended-Upgrade "0";
Enable Automatic Updates
If automatic updates are disabled, complete the following to re-enable
automatic updates.
1. Log on as the root user.
2. Run the following command:
/usr/local/sbin/enable-auto-updates.sh
3. If the command prompt appears, the automatic updates are now enabled.
4. In a text editor, open the following file:
/etc/apt/apt.conf.d/20auto-upgrades
5. Modify the following line:
APT::Periodic::Unattended-Upgrade "0";
To:
APT::Periodic::Unattended-Upgrade "1";
CentOS Commands:-
- dd if=/dev/zero of=/tmp/dummy.txt bs=1M count=10 (does IO for 10MB)
- du -sh * | grep 'G' ( finds all files in GBs on the same path)
- rm -rf fordelete/* ( recursive delete for a folder called fordelete)
- root@timmy ~]# for i in {1..4} ;do echo "tim-slave$i" ;ssh tim-slave1 'cd /home/tim/instances/Rafael__i1; ./isServerRunning' ;done (in 4 slave servers go to /home/tim/instances path and check is the script is running)
- tune2fs -m 1 /dev/mapper/vg_pakoracle3-lv_root ( frees area reserved for root in the LVM)
- find /home/downloads/ -size +500M -exec ls -lh {} \; | awk '{print $5" - "$9}' ( in /home/downloads check any files that exceeds 500MB)
- for i in {1..4} ;do echo "tim-slave$i" ;ssh tim-slave$i 'netstat -tulpn | grep 59990'; done; ( check in each slave if there is a process running on port 59990)
- service proftpd start ( start proftpd service)
- ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}' ( will show average process size and memory used by Apache)
- free
- df- h
- cat /proc/cpuinfo
- grep -R 'var scriptVersion =' sanofi-demo-1/ ( finds a string var scriptVersion= in a folder sanofi-demo/)
- /string to search in vim then press n for the next occurrence and N for previous.
No comments:
Post a Comment