巧用IOS的begin、include、exclude

来自iwanthome总结


在较新版本的 ios 中,在 show 后提供了 | 加 include/exclude/begin 的参数。巧用这个参数,可以较好的提高工作效率。
例如:
我想看路由部分的配置,通常你需要 sh run 然后翻页,比较繁琐。有了新命令后,你可以
sh run | b router ,这样会从 router 开始显示

没有网管软件,你想看目前端口的所有流量情况,通常你需要 sh int 然后逐个去找,有了新命令后,你可以
sh int | i protocol|rate ,这样就可以直接显示所有端口的进出流量,一目了然。当然你还可以直接看所有端口的 error 包等等。

网络发生异常,你想知道是哪一个进程出现问题,通常你需要 sh proc cpu ,然后在众多进程中找出所有有可能发生情况的进程。

有了新命令后,你可以
sh proc cpu | e 0.00 ,这样你就可以直接看到哪一些进程使用了当前的 cpu 资源。

在网络中有的时候需要观察是否有不稳定路由,假如你的路由表足够大,相信这个工作具有极大的工作量,有了新命令后,你可以
sh ip route | i 00:00: ,这样就可以看到了: - )

以上仅仅只是我日常使用到的一些范例,实际工作当中完全可以有更大的扩展, IOS 还支持部分正则表达式的操作符,例如:$、 ^ 、 + 等等,但是使用起来比较复杂,我们公司的 config 文件都比较小,好像暂时没有使用的需要.
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在 Vue 3 中,`include` 和 `exclude` 属性用于配置 `<keep-alive>` 组件的缓存策略,可以接受多个值。你可以通过数组的形式将多个组件名称传递给这两个属性。 以下是一个示例,展示了如何设置 `include` 和 `exclude` 属性的多个值: ```vue <template> <div> <h2>Home Component</h2> <button @click="toggleShowChild">Toggle Show Child</button> <keep-alive :include="includeComponents" :exclude="excludeComponents"> <component :is="currentComponent" v-if="showChild" /> </keep-alive> </div> </template> <script> import ChildComponent1 from './ChildComponent1.vue'; import ChildComponent2 from './ChildComponent2.vue'; import ChildComponent3 from './ChildComponent3.vue'; export default { components: { ChildComponent1, ChildComponent2, ChildComponent3 }, data() { return { showChild: false, currentComponent: 'ChildComponent1', includeComponents: ['ChildComponent1', 'ChildComponent2'], excludeComponents: ['ChildComponent3'] }; }, methods: { toggleShowChild() { this.showChild = !this.showChild; } } }; </script> ``` 在上述示例中,我们使用了 `includeComponents` 和 `excludeComponents` 数组来设置 `include` 和 `exclude` 属性的多个值。 `includeComponents` 数组包含了需要被缓存的组件名称,即只有这些组件会被 `<keep-alive>` 缓存。 `excludeComponents` 数组包含了不需要被缓存的组件名称,即这些组件不会被 `<keep-alive>` 缓存。 注意,在示例中,我们使用了动态组件 `<component>` 来根据 `currentComponent` 的值渲染相应的组件,并将其包裹在 `<keep-alive>` 组件中。 希望以上解答对你有所帮助。如有任何进一步的问题,请随时提问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值