Saturday 10 October 2015

Some useful Yum commands for System Administrator



YUM (Yellowdog Updater Modified) is an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system administrator to easily install, update, remove or search software packages on a systems. YUM uses numerous third party repositories to install packages automatically by resolving their dependencies issues.




1. Installing a Package using YUM




# yum install <package_name>




eg:

#yum install httpd




2. Updating a Package using YUM




# yum update <package_name>




3. Removing a Package




# yum remove <package_name>




4. List a Package




# yum list <package_name>




5. Search for a package




# yum search <package_name>




6. Getting information about a package




# yum info <package_name>




7. List all packages




# yum list all | less




8. List installed packages




# yum list installed




9. YUM provides




Yum provides function is used to find which package a specific file belongs to. For example, if you would like to know the name of the package that has the /etc/httpd/conf/httpd.conf




# yum provides /etc/httpd/conf/httpd.conf




10. Update system using YUM




# yum update




11. List enabled YUM repositories




# yum repolist




12. Install a Package from Specific Repository




## yum --enablerepo=epel install phpmyadmin



13. Interactive yum shell


# yum shell


13. Cleaning YUM cache


# yum clean all


14. View history of YUM


# yum history


##########HOPE THIS WORK FOR YOU###############


~SHUBHAM

Using Shred In linux.



Shred is one of the best utilities if you want to delete the files safely and permanently. Shred command overwrite a given file with random data or zeros making it hard to interpret to the intruders even after deleting your file. Say, you have a very confidential file which you want to delete because your company don't need it anymore, you will probably delete it permanently. You know what happens when you delete a file ? Whenever you delete a file only the link between your data and the file system is removed by the system. The data still remains in your hard drive and that's why even after deleting your data it is still recoverable.




Shred command basically adds random data inside your file which makes it hard or almost impossible to interpret. Hence even if your file is recovered from the hard drive it is still hard to interpret by the intruders.




Since shred command is used to permanently delete the file with absolutely no possible chance to recover it it's highly recommended to use it carefully.




Let's take an example:




# shred -n 50 -z -u secret.txt




The -n 50 means that the file "secret.txt" will be overwritten 50 times. The -z means add a final overwrite with zeros to hide the shredding. The -u makes sure the file is removed after shred is done with it.




You can shred a complete drive or partition too:
(Be very Careful doing this as this command completely wipe all your data ie. zero formatting it.)




# shred -n 50 -z /dev/sda



## HOPE THIS BLOG HELP YOU OUT## 

~SHUBHAM