Posts

Showing posts from April, 2015

Criticical BASH vulnerability discovered – update BASH on your CentOS7

[rprasad@vm ~]$ sudo env x='() { :;}; echo vulnerable' bash -c "echo this is a test"         //Run following command to check. If it outputs vulnerable then our bash is vulnerable vulnerable this is a test [rprasad@vm ~]$ sudo su -                                               //Become root [root@vm ~]# yum clean all && yum update bash Loaded plugins: fastestmirror Cleaning repos: base extras updates Cleaning up everything Loaded plugins: fastestmirror base                                                     | 3.6 kB     00:00 extras                                                ...

CentOS7 boot from USB thumbdrive.

Image
Ref. to How to install using USB Using Windows Starting with CentOS 6.5, one can create a bootable USB key simply by installing the ISO file on the key using a program such as  Win32 Disk Imager . This will delete all information already on the key. Downoad: Win32 Disk Imager Install Win32 Disk Imager Transfer the ISO image to USB using above Win32 Disk Imager. Click on "Write" button. Ready to boot and install from your USB key.

Grep using list of words from a file.

You need to use the option  -f : $ grep -f A B The option  -F  does a fixed string search where as  -f  is for specifying a file of patterns. You may want both if the file only contains fixed strings and not regexps. $ grep -Ff A B You may also want the  -w  option for matching whole words only: $ grep -wFf A B Read  man grep  for a description of all the possible arguments and what they do. NOTE: A= file. Searching in file B to see if ANY of the words in file A occur in it.

compare file A from file B, and save the content in file C

while read line; do grep -q $line A.txt || echo $line; done < B.txt >C.txt I have got the above example, its very interesting and helpful as well.  If A  is the file with the first content and B  is the file with the second content.  It prints what is not found in the second file. Can save output using redirection operator.