Skip to main content

Posts

Showing posts from June, 2019

Using Grep & Regular Expressions to Search for Text Patterns in Linux #centos #linux

Using Grep & Regular Expressions to Search for Text Patterns in Linux Introduction One of the most useful and versatile commands in a Linux terminal environment is the "grep" command. The name "grep" stands for "global regular expression print". This means that grep can be used to see if the input it receives matches a specified pattern. This seemingly trivial program is extremely powerful when used correctly. Its ability to sort input based on complex rules makes it a popular link in many command chains. We will explore some options and then dive into using regular expressions. All of the techniques discussed in this guide can be applied to managing your VPS server. Table of Contents Basic Usage Common Options Regular Expressions Literal Matches Anchor Matches Matching Any Character Bracket Expressions Repeat Pattern Zero or More Times Escaping Meta-Characters Extended Regular Expressions Grouping Alternation Quantifier

Create Network team #centos #teaming

#nmcli connection show Its oupt show the used interface #nmcli connection add con-name team0 type team ifname team0 config ‘{“runner”:{“name”:”activebackup”}}’ #nmcli connection modify team0 ipv4.addresses ’10.100.2.6/24 10.100.2.1’ ipv4.method manual #nmcli connection add con-name team0-slave1 type team-slave ifname en01 master team0 #nmcli connection add con-name team0-slave2 type team-slave ifname en02 master team0 #nmcli connection down team0-slave1 #nmcli connection down team0-slave2 #nmcli connection down team0 #nmcli connection up team0-slave1 #nmcli connection up team0-slave2 #nmcli connection up team0 #ifconfig #nmcli connection show team0 | grep ipv4 #ping –I team0 10.100.2.1 #teamctl team0 state

# touch file touch: cannot touch `file': Read-only file system

Problem: # touch file touch: cannot touch `file': Read-only file system # cat /proc/mounts rootfs / rootfs rw 0 0 /dev/root / ext3 ro,data=ordered 0 0 Solution: First check your /etc/fstab file and if root mount is comment then ucomment it If you are not able uncomment then follow the following procedure First go to grub rescue mode 1. Reboot your system 2. Press esc 3. press e 4. go to linux16 and end of this line of code 5. press ctrl+x 5. mount -o remount,rw / 6. vi /etc/fstab 7. save and exit 8. reboot