Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...



windows bash / ubuntu


Code Block
titlereg expression with grep
lonking for all the interface in a configuration file:
the pattern is: ge-x/x/x or xe-x/x/x  but only starting the line


grep "^    [gx]e-[0-9]/[0-9]" Config_Only.txt


Count the number of line

grep "^    [gx]e-[0-9]/[0-9]" Config_Only.txt  | wc -l


exclude log 

exclude 1.log 2.log , . . . 

egrep -v '[0-9].log' | egrep -v 'log.[1-9]'

ls /var/log/128technology/ | egrep -v '[0-9].log' | egrep -v 'log.[1-9]'


Code Block
titleexclude number log
[t128@conductor ~]$ ls /var/log/128technology/ | egrep -v '[1-9]{1,4}'
accessManager.log
analyticsReporter.log
audit
auditdReceiver.log
automatedProvisioner.log
conflux.log
databaseQueryCoordinator.log
. . .