Reporting Service 增加统计列

yux007 2009-02-05 03:39:30
用Reporting service做柱状图报表,X轴是月份, Y轴是销售量, 想要统计出每个人每个月的销售量然后再加上一个每个月所有人销售量的总和,关键是这个总和的列怎么添加出来?
...全文
74 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
dawugui 2009-02-05
  • 打赏
  • 举报
回复
不懂,帮顶.
yux007 2009-02-05
  • 打赏
  • 举报
回复
数据源是analysis service,一定要用MDX来加么
SQL注入的原理 什么SQL注入 将SQL代码插入到应用程序的输入参数中,之后,SQL代码被传递到数据库执行。从而达到对应用程序的攻击目的。 注入原理 常见攻击方法 检测是否可以注入【检测注入点】 示例:http://192.168.0.1/temp.aspx?id=a or 1=1-- 如果上面语句可以执行说明可以实现注入,则可以 利用系统过程、系统表注入数据库 示例【给系统添加一个用户,黑客可以实现远程登录控制服务器】:http://192.168.0.1/temp.aspx?id=1;exec xp_cmdshell 'net user admin 123456 /add' 绕过程序的限制 示例:程序中往往限制单引号的数据,但是黑客传入单引号的ASCII码 跨站点注入 在Web页面挂某些恶意的HTML、JavaScript代码 防范SQL注入 限制错误信息的输出,避免错误信息的输出使得黑客知道网站的技术实现采用什么数据库,采用什么平台 示例:在Web.config文件中设置 限制访问数据库账号的权限 在开发应用系统的时候就应该限制,给程序最小访问数据库的权限 使用参数命令传递参数 不要使用拼接字符串的方式构造SQL语句而采用参数命令 使用存储过程 存储过程在数据库中 只能执行存储过程中固定的代码 限制输入长度 防止黑客输入超大字符串,导致服务器瘫痪 防止黑客输入较长的恶意脚本等 实现方法:文本框的MaxLength属性 URL重写技术 示例: http://testWeb/news.aspx?id=111 重写成:http://testWeb/10101111.html 传递参数尽量不用字符串 http://testWeb/news.aspx?id=111 and 1=1【黑色部分给了SQL注入的机会】 SQL优化 为什么要优化 开发是对性能考虑不多【技术差、项目工期紧等原因没有考虑性能问题】 系统运行中,数据量扩大,访问量增多,蹩脚的SQL危害开始显露 低效SQL的危害 系统响应变慢,软件开发中的8秒定律,当打开一个软件或网页超过8秒时间还没有显示,则响应太慢。 死锁,当不同用户都访问某些资源的时候SQL语句不当导致死锁 客户失去信心,软件失败 低效SQL低效在哪里?  性能低下的根源  硬件原因,数据库的配置不合理,数据库的数据文件和日志文件没有分磁盘存放,会极大影响IO性能  没有建立索引,或者SQL没有走索引。在千万级数据的表上建索引是很有必要的。  SQL过于复杂,过长的SQL语句满足程序需求但是影响性能。子查询嵌套过多对性能有影响,查询关联的表特别多也影响性能  频繁访问数据等等 SQL如何被SQLServer执行的 SQL执行原理  解释:首先解释SQL语句【语法是否正确】  解析:检验语句的出现的对象是否有效【进行一个解析,要检查对象所有权的权限】  优化:【检查SQL语句是否能够使用索引,SQL语句如何执行效率高,制定一个执行计划】  编译:  执行SQL语句:【把编译过的查询要求提交并进行处理】 如何优化SQL 完善开发的管理 完善代码审核、测试机制,软件开发是艺术! 检测SQL查询的效率 语法【对IO和Time对SQL执行进行统计】: SET STATISTICS IO ON SET STATISTICS TIME ON ------------SQL代码--------- SET STATISTICS IO OFF SET STATISTICS TIME OFF 注意:在检测之前要清理缓存,因为当我们执行SQL语句的时候查出的数据会在数据库中进行缓存,重新查询会返回缓存中的信息。 DBCC DROPCLEANBUFFERS DBCC FREEPROCCACHE 经验:使用子查询嵌套不要过多,尽量使用表连接查询代替子查询,因为表连接查询效率稍高一点。 SQL优化工具 使用报表服务 通过Reporting Service查找低效SQL 选择 性能 - 批处理执行统计信息和性能相关的几个报表服务: 性能 - 对象执行统计信息 性能 - 按平均CPU时间排在前面的查询 性能 - 按平均IO次数排在前面的查询 性能 - 按总CPU时间排在前面的查询 性能 - 按IO总次数排在前面的查询 操作示范: 1. 数据引擎上点击右键—报表—标准报表—关心的
McAfee(R) VirusScan(R) Enterprise 8.0i 版 发行说明 Copyright (C) 2004 Networks Associates Technology, Inc. 保留所有权利 ==================================================================== - DAT 版本: 4382 - 引擎版本: 4.3.20 ==================================================================== 感谢您使用 VirusScan Enterprise 软件。 本文件包含有关这一版本的重 要信息。我们强烈建议您阅读整篇文档。 重要信息: McAfee 不支持软件预发布版本的自动升级功能。要升级为正式产品,必 须首先卸载现有版本的软件。 _____________________________________________________________________ 本文件包含的内容 - 新功能 - 更改的功能 - 安装和系统要求 - 测试安装 - 已解决的问题 - 已知问题 - 安装、升级和卸载 - 与其他产品的兼容性 - Alert Manager (TM) - Common Management Agent - ePolicy Orchestrator(R) - GroupShield(TM) - ProtectionPilot(TM) - 第三方软件 - 访问保护 - 增添文件类型扩展名 - AutoUpdate - 缓冲区溢出保护 - 日志文件格式 - Lotus Notes - 镜像任务 - 扫描 - 有害程序策略 - 文档 - 参与 McAfee 测试程序的测试 - 联系信息 - 版权和商标归属 - 许可和专利信息 __________________________________________________________________ 新功能 本版本 VirusScan Enterprise 提供以下几种新功能,这些功能可以有助于 防止入侵,并更有效地检测入侵: - 产品版本号 新版本为 8.0i。 产品版本号已经从 7.1 更改为 8.0,这一更改反映了自上次发布以来产 品内部功能的重大更改。 有关详细信息,请参阅以下"新功能"和"更改 的功能"部分。 产品版本号增加"i"表示 McAfee VirusScan Enterprise 是全球第 一款提供主动式入侵防护系统 (IPS) 保护能力的防病毒产品。这些 IPS 功能是由 McAfee Entercept 的"缓冲区溢出保护"功能提供的, McAfee Entercept 是我们的主机入侵防护安全产品。 - 访问保护。 通过此功能您可以限制对端口、文件、共享资源和文件夹的访问,从而防止 入侵。 通过创建规则指定要阻挡的端口以及是否限制对入站或出站进程的访问,可 以阻挡端口。如果您希望允许一个特定进程或一组进程访问准备阻挡的端口, 也可以从规则中排除这些进程。 阻挡端口时,即同时阻挡 TCP 和 UDP 访问。 您可以通过将共享资源设置为只读或阻止对所有共享资源的读取和写入,限 制对共享资源的访问。 您可以通过创建规则阻挡文件和文件夹,规则指定禁止对您定义的文件或文 件夹进行访问的进程、禁止的文件操作以及在某人尝试访问阻挡的项目时应 采取的操作。 这些"访问保护"功能在防范入侵时非常有效。在病毒发作时,管理员可以 阻止对感染病毒区域的访问,直到发布新的 DAT。 注: 如果您阻挡 ePolicy Orchestrator 代理或 Entercept 代理 使用的端口,则代理的进程受到过滤器信任,可以与被阻挡的端口进 行通讯。但是,与这些代理进程无关的通讯将被阻挡。 本版 VirusScan Enterprise 提供了一些端口阻挡规则样本、文件和 文件夹阻挡规则样本。 默认安装本产品时,这些规则中有些会处于警告模 式,而有些则处于阻挡模式。 警告: 虽然采用这些规则的目的是防范各种常见的威胁,但是,也会阻挡合 法的活动。在部署 VirusScan Enterprise 之前,我们建议您查 看一下这些规则,确保它们适合于您的网络环境。 需要考虑的事项: - 白名单。每条端口阻挡规则均包括一些排除在阻挡范围之外的应用程 序。这些表一般包含多数最常见的电子邮件客户端和 web 浏览器。 请务必查看每个表,确保其中包含允许发送电子邮件和下载文件 的所有程序。将这些程序入白名单,确保这些程序不被阻挡。 - 对网络上发生的文件系统活动的阻挡。 某些规则(例如,"禁止远程 创建/修改/删除文件(.exe)")对于阻止自身从一个共享资源复制 到另一个共享资源的病毒非常有效。但是,它们也可能会阻挡那些依 靠将文件推入工作站进行工作的管理系统。例如,在 ePolicy Orchestrator 服务器部署代理时,就是将代理安装程序推送到工 作站的管理共享资源上并运行该程序。在部署之前,请确保为每个规 则选择正确的模式(关闭、警告或阻挡)。 McAfee Installation Designer 可以用于配置 VirusScan 部 署软件包。 警告: 默认规则无法为您的网络环境提供全面的保护。 您所需的限制取决于 您的环境。我们提供的规则的目在于通过示例说明该功能的作用以及 如何利用规则防止某些特定的威胁。 发现新的威胁时,病毒信息库将向您提供建议,告诉您如何利用访问 保护规则阻挡这些新威胁。请访问以下位置的病毒信息库: http://vil.mcafee.com - 源 IP (按访问扫描)。 按访问扫描程序检测到写入共享文件的病毒时,它会在按访问扫描统计信息 对话框和按访问扫描信息对话框中显示检测到的病毒的源 IP 地址。 - 阻挡(按访问扫描)。 使用此功能可以阻挡在共享文件夹中放置了含有已感染病毒文件的远程计 算机的进一步访问。您可以指定阻挡这些连接的时间长短。如果您希望在指 定的时间限制之前取消阻挡所有的连接,您可以在按访问扫描统计对话框中 进行此操作。 - 缓冲区溢出保护。 "缓冲区溢出保护"可以阻止利用缓冲区溢出在计算机上执行代码。此功能 会检测到从堆栈中的数据开始运行的代码,并阻止该代码运行。但是,此功 能不阻止数据写入堆栈。即使"缓冲区溢出保护"功能会阻止受到利用的代 码运行,也不要指望受到利用的应用程序仍然会保持稳定。 VirusScan Enterprise 为大约 30 种最常用且最容易受利用的软件应用程 序及微软 Windows 服务提供缓冲区溢出保护。这些受保护的应用程序在一 个单独的缓冲区溢出保护特征码文件中定义。此 DAT 文件在常规更新期间 随病毒特征码文件一起下载。到本产品发布之日为止,缓冲区溢出保护码文 件中包括以下应用程序: - dllhost.exe - EventParser.exe - excel.exe - explorer.exe - frameworkservice.exe - ftp.exe - iexplore.exe - inetinfo.exe - lsass.exe - mapisp32.exe - mplayer2.exe - msaccess.exe - msimn.exe - mstask.exe - msmsgs.exe - NaimServ.exe - Naprdmgr.exe - Outlook.exe - powerpnt.exe - rpcss.exe - services.exe - sqlservr.exe - SrvMon.exe - svchost.exe - visio32.exe - VSEBOTest.exe - w3wp.exe - winword.exe - wmplayer.exe - wuauclt.exe 缓冲区溢出保护定义文件更新时,此表也会进行相应的更改。 - 有害程序策略。 使用此功能可以检测到有害程序(例如, Jspyware、adware、dialers、 jokes 等),并对其执行相应的操作。 您可以从当前 -.DAT 文件的预定义表中选择程序所有类别或这些类别 中的特定程序。也可以添加自己的程序进行检测。 配置分两步进行: - 首先,在"有害程序策略"中配置要检测的程序。默认情况下,此策 略在每个扫描程序属性页中是启用的。 - 其次,逐一配置每个扫描程序(按访问扫描程序、按需扫描程序和电 子邮件扫描程序),并指定在检测到有害程序时扫描程序要执行的操 作。在此处指定的操作与其他扫描设置无关。 对有害程序的实际检测和随后的清除均由 -.DAT 文件决定,正如对病毒 的处理一样。如果检测到有害程序且主要操作设置为"清除",则 -.DAT 文 件会尝试使用 -.DAT 文件中的信息对程序进行清除操作。如果无法清除 检测到的程序,或者不在 -.DAT 文件中(例如用户定义的程序),则清 除操作会失败,并转而执行辅助操作。如果您选择"删除"操作,则仅删除 定义为有害的程序,而遭到修改的注册表键可能会保持不变。 - 脚本扫描(按访问扫描)。 使用此功能可以在执行 JavaScript 和 VBScript 脚本之前对其进行 扫描。脚本扫描程序能够象真正的 Windows 脚本主机组件的代理组件一 样运行。它可以阻止脚本(例如 Internet Explorer 网页脚本)的执 行并对其进行扫描。如果脚本不含有病毒,则将其传送给真正的主机。如果 脚本已感染病毒,则不执行脚本。 - Lotus Notes(电子邮件扫描)。 除基于 MAPI 的电子邮件(例如,Microsoft Outlook)之外,电子邮 件传递扫描程序和按需电子邮件扫描程序现在均扫描 Lotus Notes 邮件 和数据库。 您可以配置一系属性,应用于所安装的任何电子邮件客户端。 客户端扫描程序具有不同的特点,在《产品指南》的"电子邮件扫描"部分 有此方面的介绍。例如,Microsoft Outlook 邮件在传递时扫描,而 Lotus Notes 邮件则在访问时扫描。 - 选择性更新 (AutoUpdate)。 在 VirusScan 控制台中使用 AutoUpdate 任务有选择地仅更新 DAT 文 件、扫描引擎、产品升级、HotFix、补丁程序或 Service Pack 等。 如果您通过 ePolicy Orchestrator 管理 VirusScan Enterprise, 则只有 ePolicy Orchestrator 3.5 或更高版本才提供此选择性更新 功能。早期版本的 ePolicy Orchestrator 不支持此功能。 - Alert Manager 本地警报。 无需本地安装 Alert Manager 服务器,即可生成 SNMP 陷阱和本地事 件日志条目。 - 修复安装。 通过 VirusScan 控制台"帮助"菜单中的新菜单项,您可以修复安装。 您可以选择将产品恢复为原始安装设置,或重新安装程序文件。 用户必须具有管理权限才能执行这些功能。 管理员可以对此功能进行保护, 即在"用户界面选项"的"密码选项"对话框中为其设置密码。 警告: 将产品恢复为原始安装设置时,自定义的设置会丢失。 重新安装程序文件时,将覆盖 HotFix、补丁程序和 Service Pack。 - 错误报告服务。 错误报告服务启用后,可以提供对 Network Associates 应用程序的持 续后台监控功能,并在检测到问题时提示用户。检测到错误时,用户可以选 择提交数据进行分析或忽略该错误。在 VirusScan 控制台的"工具"中 启用"错误报告服务"。 ______________________________________________________________________ 更改的功能 自上次发布 VirusScan Enterprise 以来,以下功能已发生更改: - 每天更新 (AutoUpdate)。 默认 AutoUpdate 任务时间安排已经从每周更改为每天。当然,管理员 可以修改该时间安排。 - 默认下载站点 (AutoUpdate)。 执行 AutoUpdate 时,现在默认的下载站点为 HTTP 站点,FTP 站点 作为辅助站点。 有关详细说明,请参阅《VirusScan Enterprise 产 品指南》。 - 系统使用率(按需扫描)。 CPU 使用率已更改为系统使用率。 按需扫描启动后,该功能会采集最初 30 秒钟内的 CPU 和 IO 样本,然后根据您在按需扫描属性中指定的使用率 水平进行扫描。这样更为符合实际需要,我们可以根据 CPU 和 IO 的使 用率平衡利用 CPU 和磁盘资源。 - 可恢复的扫描。 经过更改后,按需扫描程序可以执行真正的可恢复扫描。如果在完成扫描之 前中断扫描,则扫描程序会从扫描中断处自动恢复扫描。扫描程序的增量扫 描功能能够识别上一次扫描的文件,因此下次扫描启动时,可以从中断处恢 复扫描。 - 压缩文件扫描。 本版本从扫描选项中删除了"扫描压缩的文件"选项,因为该功能已经在每 种扫描程序中永久性启用了。扫描程序始终会扫描压缩文件。 ______________________________________________________________________ 安装和系统要求 有关安装和系统要求的完整信息,请参阅产品文档。 测试安装 您可以通过在已经安装本软件的任何计算机上运行 EICAR 标准防病毒测试文件, 测试软件的运行情况。EICAR 标准防病毒测试文件是全世界防病毒产品厂商 共同努力的成果,它使客户可以按照一个统一标准验证其安装的防病毒产品。 要测试安装,请: 1. 将下面一行文字复制到一个独立文件中,然后以 EICAR.COM 名称保存该 文件。 X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* 该文件的大小为 68 或 70 字节。 2. 启动防病毒软件,让它扫描 EICAR.COM 所在的目录。 VirusScan Enterprise 扫描此文件时,它会报告发现 EICAR 测试文 件。 3. 测试完安装的软件后,请删除该文件,以避免对正常用户发出警告。 重要信息: 请注意,此文件并非病毒。 _____________________________________________________________________ 已解决的问题 下面介绍本软件产品以前版本中存在但当前版本中已解决的问题。 1. 问题: VirusScan Enterprise 7.1 按访问扫描程序会对其他 McAfee防病 毒或安全产品的隔离文件夹中包含的数据执行操作,除非从扫描任务中排 除那些文件夹。例如,如果您在已经安装 VirusScan Enterprise 的 同一台计算机上使用 McAfee GroupShield 或 IntruShield,则它 们各自的隔离文件夹可能会包含合法的感染病毒的数据。这些隔离文件夹 应该从按访问扫描任务中排除,以避免清除、删除或移动合法的感染病毒的 数据。 解决方案: 安装程序会检测到其他产品并为其添加排除项。 2. 问题: 对于使用 ePolicy Orchestrator 3.0 创建和部署的按需扫描任务, 可恢复扫描不起作用。 如果在 ePolicy Orchestrator 中创建的按需 扫描在扫描完成之前即结束(由于系统关闭等),就会出现这种问题。按需 扫描任务再次启动时,它会再次从开始位置扫描,而不是从最后扫描的文件 恢复扫描。 解决方案: 对于使用 ePolicy Orchestrator 3.0 创建和部署的按需扫描任务, 可恢复扫描工作正常。 3. 问题: 具有用户权限(相对于具有管理员权限的管理员)的用户回滚 DAT 文件时, 出现下错误: "无法保存刚刚回滚的 DAT 版本" 这意味着 VirusScan Enterprise 无法创建正确的注册表键,以识别 回滚操作。因此,执行更新可能会重新应用回滚的 DAT。在回滚的 DAT 版 本已损坏(这通常是执行 DAT 回滚的原因)的情况下,这会产生问题。 正常情况下,VirusScan Enterprise 不更新经过回滚的 DAT 版本。 注: 只有在除管理员之外的其他人员执行 DAT 回滚时才出现此问题。在 管理员执行回滚时,不能通过更新应用回滚的 DAT 版本。 解决方案: 无法重新应用回滚的 DAT。 4. 问题: 通过 ePolicy Orchestrator 部署 VirusScan Enterprise 时, 或采用静默安装时,VShield 图标不出现在系统任务栏中。 解决方案: 现在,通过 ePolicy Orchestrator 部署 VirusScan Enterprise 时,或静默安装时,VShield 图标会显示在系统任务栏中。 5. 问题: 将 VirusScan Enterprise 安装至采用 Intel 64 位处理器的系统 时,不能使用 REGSVR32.EXE 正确注册 VSUPDATE.DLL 文件。结果, 在安装完成后执行更新操作时,会出现错误,并会显示以下错误信息: "加载 COM 组件时出错。" 要正确注册.DLL,请在命令提示符下输入以下命令: "<驱动器>:\Winnt\syswow64\regsvr32.exe vsupdate.dll" 注: 如果您将 VirusScan Enterprise 安装到默认位置,则安装路径 为: <驱动器>:\Program Files\Network Associates\VirusScan\ 解决方案: 此问题在 VirusScan Enterprise 8.0 中已经得到解决。 ______________________________________________________________________ 已知问题 安装、升级和卸载 1. 在安装结束时,需要重新启动系统(具有可选性),才能加载 TDI 网络驱 动程序。在重新启动计算机之前,"端口阻挡"、"病毒感染跟踪"和"病 毒感染跟踪阻挡"功能均处于禁用状态。 2. Internet Explorer 要求。《VirusScan Enterprise 8.0 安装指 南》中将 Internet Explorer 要求错误为 5.0 版或更高版本。 Internet Explorer 要求是 Internet Explorer 4.0 版 Service Pack 2 或更高版本。 3. 如果您准备在采用 Windows NT4 操作系统的计算机上安装 VirusScan Enterprise 8.0,并使用 AutoUpdate 功能,则必须首先在该计算机 上安装 Internet Explorer 4.0 Service Pack 2 或更高版本。 如果在您开始在采用 Windows NT4 操作系统的计算机上安装 VirusScan Enterprise 8.0 之前没有安装 Internet Explorer 4.0 Service Pack 2 或更高版本,系统会生成一个错误编号 1920"服务器启动失败" 的错误,要求您选择"放弃"、"重试"或"继续"安装。如果"继续" 安装,则不会安装 AutoUpdate 组件。如果您决定以后安装 AutoUpdate 功能,则必须首先安装 Internet Explorer 4.0 Service Pack 2 或 更高版本,然后,完全删除 VirusScan Enterprise 8.0 并重新安装。 4. 如果您使用未压缩的安装程序"SETUPVSE.EXE"在 Windows NT4 终端服务 器上安装 VirusScan Enterprise,则必须在执行"SETUPVSE.EXE"之前, 先将终端服务器切换到"安装模式"。有关详细信息,请参阅知识库中的文 章 KB37558。 5. 要使用 MSIEXEC.EXE 安装 VirusScan Enterprise 产品,请完成以 下步骤: a. 在命令提示符下输入以下命令,解压缩 .MSI 和其他文件: SETUP.EXE -nos_ne [-nos_o""] 注: -nos_ne 命令会从 SETUP.EXE 解压缩安装文件,但是不会 执行 SETUP.EXE 或删除安装文件。 -nos_o"" 命令会指定用于解压缩安装文件的 目标文件夹。 如果不指定输出路径,这些文件会解压缩到用户配置文件的" Temp"文件夹内。 b. 请确保删除任何其他厂商的产品,包括 McAfee VirusScan 和 VirusScan Enterprise 早期版本。 c. 在命令提示符下输入以下命令,运行 MSIEXEC.EXE: "msiexec.exe /i vse800.msi" 6. 安装"缓冲区溢出保护"功能时,会有以下限制: - 如果在已经安装 McAfee Entercept 代理的计算机上安装 "缓冲区溢出保护",则会在 VirusScan 控制台中禁用"缓 冲区溢出保护"功能。 McAfee Entercept 产品覆盖范围更大,因此 McAfee Entercept 产品优先于 VirusScan Enterprise 中的"缓冲区溢出保护"功 能。 - 在 64 位平台上无法安装"缓冲区溢出保护"。 - 缓冲区溢出保护与 Windows XP 快速用户切换配合使用时,仅 保护会话。 - 缓冲区溢出保护并不保护 Windows 终端服务器或 Citrix MetaFrame 的终端会话。 它仅保护本地登录。 7. 在 64 位平台上无法安装 ScriptScan。 8. 在 64 位平台上无法安装右键单击扫描功能。 9. 本版本支持使用管理安装点 (AIP) 进行部署。但是,必须从 AIP 中 运行 SETUP.EXE,才能执行升级或卸载其他防病毒软件。 要创建 AIP,请在命令提示符下输入"setup.exe /a"。此时会出现一 个向导,指导您创建 AIP。创建 AIP 后,压缩 (.ZIP) 文件中的所有 必要文件均同时复制到 AIP。这些文件包括: - CMU300.NAP - CONTACT.TXT - EXAMPLE.SMS - EXTRA.DAT - INSTALL.PKG - INSTMSIW.EXE - PKGCATALOG.Z - PACKING.LST - README.TXT - SETUP.INI - SETUPVSE.EXE - SIGNLIC.TXT - UNINST.DLL - UNINST.INI - VSE800.NAP - VSE800DET.MCS 由于这些文件会自动复制到 AIP,因此,管理员不需要手动复制这些文件。 注: 如果通过 Active Directory 组策略部署 VirusScan Enterprise(这样会使用 MSIEXEC.EXE 进行安装),则必须首 先删除现有的所有防病毒产品,才能安装 VirusScan Enterprise。 10. 静默完全安装 Computer Associates eTrust Antivirus 程序时, 该操作不完全静默进行。Computer Associates eTrust Antivirus 会显示一个包含"确定"按钮消息框,提示需要重新启动。单击"确定" 后,完全安装会继续正常进行。此问题是 Computer Associates 的 一个已知问题,您可以访问 Computer Associates 的网站,编号为 QO19636 的文章即介绍相关的内容。Computer Associates 网站提 供修补此问题的可下载文件。虽然此问题针对 Computer Associates eTrust Antivirus 6.0 版,但是,该补丁程序对 7.0 版也适用。 与其他产品的兼容性 Alert Manager 1. VirusScan Enterprise 8.0 只能向 Alert Manager 4.7.x 发送 警报。无法向早期版本的 Alert Manager 发送警报。 此外,在已经安装 Alert Manager4.7.x 以前版本的计算机上,无法安 装 VirusScan Enterprise 8.0。如果您在已经安装 Alert Manager 4.5 或 4.6 的系统中安装 VirusScan Enterprise 8.0,应该同时 安装 Alert Manager 4.7.x,该版本会自动替换早期版本。 但是,请注意,Alert Manager 4.7.x 可以接收早期版本的 NetShield 和 VirusScan 发送的警报。您可以配置这些软件程序的早 期版本将警报发送到 Alert Manager 4.7.x。 2. 在 Windows 2003 (.NET) Server 上安装 Alert Manager 时,警 报消息不会自动在 VirusScan Enterprise 8.0 中显示。 您必须手 动启动信息服务: a. 从"开始"菜单中,依次选择 "设置"|"控制面板"|"管理工具"|"服务"|"Messenger" b. 打开"Messenger 的属性"对话框。 c. 在常规选项卡的"启动类型"下,选择"自动"。 d. 在"常规"选项卡的"服务状态"下,单击"启动"。 e. 单击"确定"应用这些更改,并关闭"Messenger 的属性"对话框。 Common Management Agent 1. 在 ePolicy Orchestrator 3.0.x 中安装 VirusScan Enterprise 8.0 不会将 Common Management Agent 自动从早期版本自动升级到 3.5 版。如果您使用 ePolicy Orchestrator 3.0.x 和 VirusScan Enterprise 7.x,则在将 VirusScan Enterprise 8.0 安装软件包 添加至 ePolicy Orchestrator 资料库时,Common Management Agent 不会升级至 3.5 版。 要将 Common Management Agent 从早期版本升级到 3.5 版,必须安 装 Common Management Agent 3.5 版,然后,将其推送到客户端或 执行更新任务。 注: 使用 ePolicy Orchestrator 管理 VirusScan Enterprise 8.0 时,不需要安装 Common Management Agent 3.5。Common Management Agent 3.5 版与其早期版本仅有的不同之处在于: - Common Management Agent 3.5 版能够进行选择性更新,而 早期版本只能进行整体更新。选择性更新允许您单独更-.DAT、 扫描引擎和补丁程序等。 - Common Management Agent 3.5 版不过滤客户端的事件。 2. 如果已经安装 Common Management Agent 3.5 版,则安装 ePolicy Orchestrator 3.0.x 会失败。 如果您尝试在已经安装 VirusScan 8.0 的同一台计算机上安装 ePolicy Orchestrator 3.0.x,则 ePolicy Orchestrator 安装会因为 Common Management Agent 的 升级问题而失败。因为 VirusScan Enterprise 8.0 安装 Common Management Agent 3.5 版,而 ePolicy Orchestrator 3.0.x 安 装早期版本的 Common Management Agent,所以代理程序无法升级, 安装自然会失败。 要解决此问题,请执行以下步骤: a. 删除 VirusScan Enterprise 8.0。 a. 安装 ePolicy Orchestrator 3.0.x。 b. 重新安装 VirusScan Enterprise 8.0。 c. 要在 ePolicy Orchestrator 3.0.x 中将 Common Management Agent 从早期版本升级到 3.5 版,必须在 ePolicy Orchestrator 3.0.x 中安装 Common Management Agent 3.5 版,然后将其推送到客户端或执行更新任务。 ePolicy Orchestrator 1. 如果您准备使用 ePolicy Orchestrator 管理 VirusScan Enterprise 8.0,则必须使用 ePolicy Orchestrator 3.0 版 Service Pack 1 或更高版本。 2. 选择性更新。要使用新的选择性更新功能,必须使用 ePolicy Orchestrator 3.5 或更高版本管理 VirusScan Enterprise.早期 版本的 ePolicy Orchestrator 会执行更新,但是不支持仅更新 .DAT 文件、扫描引擎等的选择性更新。 3. 本版 VirusScan Enterprise 8.0 提供两个 .NAP 文件,必须将这 两个.NAP 文件添加到 ePolicy Orchestrator 资料库内。另外,如 果您运行 ePolicy Orchestrator 3.0.x,在添加两个 .NAP 文件后, 必须运行更新可执行文件,以解决与事件解析程序注册有关的问题。 注: 如果您运行 ePolicy Orchestrator 3.5 版或更高版本,则不需 要运行更新可执行文件。 这些文件随 VirusScan Enterprise 8.0 安装软件包附带,您可以从 下载这些文件的位置找到这些文件: - VSE800.NAP - VSE800REPORTS.NAP.此文件是一个扩展报告.NAP 文件。 - VSE800UPDATEFOREPO30.EXE. 此文件是一个更新可执行文件。 a. 将两个 .NAP 文件添加至 ePolicy Orchestrator 资料库。 注: 我们建议您在安装 VSE800.NAP 之前,先安装 VSE800REPORTS.NAP 文件。按照此顺序安装 .NAP 文件可 以防止在托管产品下显示的 VirusScan Enterprise 英文说 明出现问题。有关详细信息,请参阅本部分的已知问题 8。 b. 如果您使用 ePolicy Orchestrator 3.0.x,则可以在已经安装 ePolicy Orchestrator 3.x 的计算机上执行 VSE800UPDATEFOREPO30.EXE。 此可执行文件用于在 ePolicy Orchestrator 3.0.x 服务器上 注册事件解析程序 .DLL。此更新解决了 ePolicy Orchestrator 的一个问题,这一问题会导致在添加扩展报告 .NAP 时事件解析程序 错误注册。 注: 有关详细信息,请参阅《与 ePolicy Orchestrator 配合使用的 VirusScan Enterprise 8.0 配置指南》。 4. 如果将 VSEREPORTS.NAP 文件登记到 ePolicy Orchestrator 3.01 版或 3.02 版资料库,可能会导致"未指定的错误"。 这是一个控制台超时错误,可以忽略。即使控制台超时,服务器仍会完成 .NAP 文件中所有的 SQL 脚本的执行。 5. 如果您将 Microsoft SQL Server 7.0 版与 ePolicy Orchestrator 3.01 或更高版本配合使用,则在将 VSE800.NAP 文件登记到 ePolicy Orchestrator 资料库中,按需扫描任务不会保留。 必须安装 Microsoft SQL Server 2000 版或更高版本,才能保留按需扫描任务。 6. 从 ePolicy Orchestrator 服务器通过 UNC 将资料库复制到某服务 器,且该服务器已经在"访问保护属性"中启用这些文件阻挡规则时,复制 的资料库可能会损坏: - "禁止远程修改文件 (.exe)" - "禁止远程修改文件 (.dll)" - "禁止远程创建/修改/删除系统根目录中的任何内容" - "禁止远程创建/修改/删除文件 (.exe)" 这些规则启用时,某些文件复制会被阻止,因为 ePolicy Orchestrator 服务器远程打开文件,并采用与共享传播式蠕虫同样的方 式进行写入访问和修改其内容。 如果您准备从 ePolicy Orchestrator 服务器通过 UNC 复制资料库, 请确保在目标服务器上禁用这些文件阻挡规则,然后再执行复制任务。 7. 从资料库中删除项目时,ePolicy Orchestrator 符合性基线不会重新 评估符合性。 例如,在将 VirusScan Enterprise 8.0 登记到 ePolicy Orchestrator 资料库时,它会标记为该环境的新符合性基线。所有已经 安装 VirusScan Enterprise 8.0 以前版本的计算机均标记为不符合。 不过,如果您从资料库中删除 VirusScan Enterprise 8.0,而不是重 新评估符合性,则符合性基线会保持在 8.0 版。即使将 VirusScan Enterprise 7.1 重新登记到资料库,符合性基线只会增量提高。 8. 取决于安装两个 VirusScan Enterprise 8.0 .NAP 文件的顺序, 在 ePolicy Orchestrator"Repository "(资料库)中"Managed Products"(托管产品)|"Windows"|"VirusScan Enterprise"|"8.0.0" 下的 VirusScan Enterprise 8.0 的英文说明可能不可 用。 如果在安装 VSE800REPORTS.NAP 之前已经将 VSE800.NAP 安装 到资料库,则英文说明不可用。 如果在安装 VSE800.NAP 之前已经安装 VSE800REPORTS.NAP, 则英文说明可用。 9. 在 ePolicy Orchestrator"Event Filtering"(事件过滤)策略 中禁用事件过滤。VirusScan Enterprise 会生成许多事件 ID,这些 ID 不会在 ePolicy Orchestrator 过滤器表中出。 要确保发送 所有 VirusScan Enterprise 事件,请在策略中禁用事件过滤功能: a. 登录至 ePolicy Orchestrator 控制台。 b. 在"Reporting"下,选择"ePO 数据库"并将其展开。 c. 选择服务器并登录。 d. 选择"事件"。 e. 在右侧窗格中,选择"不过滤事件"。 f. 单击"应用"保存这些设置。 GroupShield 1. 除 VirusScan Enterprise 8.0 和 Alert Manager 4.7.1 之外, 如果您准备使用 GroupShield,请确保在安装 Alert Manager 之 前安装 GroupShield。必须按照此顺序安装,才能确保警报发送正常。 ProtectionPilot 1. 如果您准备使用 Protection Pilot 管理 VirusScan Enterprise 8.0i,则必须使用 Protection Pilot 1.0 版 Patch 1 或更高版本。 2. 如果将 VSEREPORTS.NAP 文件登记到 ProtectionPilot 资料库,可 能会导致"未指定的错误"。 这是一个控制台超时错误,可以忽略。即使控制台超时,服务器仍会完成 .NAP 文件中所有的 SQL 脚本的执行。 3. 在 ProtectionPilot 上无法使用选择性更新。此功能仅在 ePolicy Orchestrator 3.5 或更高版本中提供。 第三方软件 1. Spy Sweeper。如果您使用 Spy Sweeper 扫描 VirusScan Enterprise 安装文件夹,则在它检测到 BHO.DLL 时会发生检测错误。 此文件并不是 spyware;它是随 VirusScan Enterprise 安装的 ScriptScan 的一个组件。 2. Microsoft Windows XP Service Pack 2。如果您使用 Microsoft Windows XP Service Pack 2 并准备通过 ePolicy Orchestrator 管理 VirusScan Enterprise,则 Windows XP Firewall 将禁止这种操作,除非将 FRAMEWORKSERVICE.EXE 添加到 Windows XP Firewall 的排除白名单中。有 关如何进行此操作的信息,请参阅 Microsoft 知识库中的文章 842242。 3. 以下第三方产品与 VirusScan Enterprise 8.0 的"缓冲区溢出"功能不兼 容。如果必须使用这些产品,我们建议您禁用 VirusScan Enterprise"缓 冲区溢出"功能: - Tiny Personal Firewall - CyberArmour Firewall - Zone Alarm Pro 注: VirusScan Enterprise 8.0 和 Zone Alarm Pro 安装在同一 台计算机上时,Zone Alarm Pro 会崩溃。 - BlackIce Firewall 注: 请先安装 VirusScan Enterprise 8.0,然后再安装 BlackIce Firewall,以确保它们兼容。 访问保护 1. 与已知漏洞和弱点相关的端口。使用此链接可以访问一个网站,该站点提供 最经常受利用的 TCP 端口的表。 http://www.us-cert.gov/current/services_ports.html 注: 如果通过单击无法访问链接,请将其复制粘贴至 web 浏览器,即可 访问该站点。 2. 如果您禁用按访问扫描程序,则同时会禁用端口阻挡规则和您配置的文件、 共享资源以及文件夹规则。 3. 如果您在非英语或本地化环境中使用"访问保护"功能,则默认规则可能会 包含本地化操作系统中不存在的文件夹的参考。 添加文件类型扩展名 1. 如要您在"其他文件类型"或"指定文件类型"对话框中使用通配符指定文 件类型扩展名,则不能使用 (*) 作为通配符。在这些情况下指定文件类型 扩展名时,必须使用问号 (?) 作为通配符。 AUTOUPDATE 1. 只有在更新时登录且对该映射驱动器位置至少具有读取权限时,才能从映射 驱动器进行更新。如果没有用户登录到该系统,或者,虽然登录但是对映射 位置不具有最起码的读取权限,则更新将失败。 2. 编辑资料库表使用 UNC 路径时,"编辑 AutoUpdate 资料库表" 对话框不会在接受所输入的路径之前验证其事实上是否为有效的 UNC 共享 资源。 确保输入有效的 UNC 服务器、共享资源和路径名称。输入无效的 UNC 路径可能会导致从此位置进行更新时出现问题。 3. VirusScan Enterprise《产品指南》中的 EXTRA.DAT 信息。这些信息用于 对 VirusScan Enterprise《产品指南》中"更新"部分的信息进行更正。 "更新任务执行过程中的活动"下的"更新"部分中错误地叙述如下: "默认情况下,将新病毒特征
集合了 所有的 Unix命令大全 登陆服务器时输入 公帐号 openlab-open123 telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss 老师测评网址 http://172.16.0.198:8080/poll/ 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ 一、注意事项 命令和参数之间必需用空格隔开,参数和参数之间也必需用空格隔开。 一行不能超过256个字符;大小写有区分。 二、特殊字符含义 文件名以“.”开头的都是隐藏文件/目录,只需在文件/目录名前加“.”就可隐藏它。 ~/ 表示主目录。 ./ 当前目录(一个点)。 ../ 上一级目录(两个点)。 ; 多个命令一起用。 > >> 输出重定向 。将一个命令的输出内容写入到一个文件里面。如果该文件存在, 就将该文件的内容覆盖; 如果不存在就先创建该文件, 然后再写入内容。 输出重定向,意思就是说,将原来屏幕输出变为文件输出,即将内容输到文件中。 < << 输入重定向。 本来命令是通过键盘得到输入的,但是用小于号,就能够使命令从文件中得到输入。 \ 表示未写完,回车换行再继续。 * 匹配零个或者多个字符。 ? 匹配一个字符。 [] 匹配中括号里的内容[a-z][A-Z][0-9]。 ! 事件。 $ 取环境变量的值。 | 管道。把前一命令的输出作为后一命令的输入,把几个命令连接起来。 |经常跟tee连用,tee 把内容保存到文档并显示出来。 三、通用后接命令符 -a 所有(all)。 -e 所有(every),比a更详细。 -f 取消保护。 -i 添加提示。 -p 强制执行。 -r 目录管理。 分屏显示的中途操作 空格 继续打开下一屏; 回车 继续打开下一行; b 另外开上一屏; f 另外开下一屏; h 帮助; q或Ctrl+C 退出; /字符串 从上往下查找匹配的字符串; ?字符串 从下往上查找匹配的字符串; n 继续查找。 四、退出命令 exit 退出; DOS内部命令 用于退出当前的命令处理器(COMMAND.COM) 恢复前一个命令处理器。 Ctrl+d 跟exit一样效果,表中止本次操作。 logout 当csh时可用来退出,其他shell不可用。 clear 清屏,清除(之前的内容并未删除,只是没看到,拉回上面可以看回)。 五、目录管理命令 pwd 显示当前所在目录,打印当前目录的绝对路径。 cd 进入某目录,DOS内部命令 显示或改变当前目录。 cd回车/cd ~ 都是回到自己的主目录。 cd . 当前目录(空格再加一个点)。 cd .. 回到上一级目录(空格再加两个点)。 cd ../.. 向上两级。 cd /user/s0807 从绝对路径去到某目录。 cd ~/s0807 直接进入主目录下的某目录(“cd ~"相当于主目录的路径的简写)。 ls 显示当前目录的所有目录和文件。 用法 ls [-aAbcCdeEfFghHilLmnopqrRstux1@] [file...] ls /etc/ 显示某目录下的所有文件和目录,如etc目录下的。 ls -l (list)表显示文件(默认按文件名排序), 显示文件的权限、硬链接数(即包含文件数,普通文件是1,目录1+)、用户、组名、大小、修改日期、文件名。 ls -t (time)按修改时间排序,显示目录和文件。 ls -lt 是“-l”和“-t”的组合,按时间顺序显示表。 ls -F 显示文件类型,目录“/ ”结尾;可执行文件“*”结尾;文本文件(none),没有结尾。 ls -R 递归显示目录结构。即该目录下的文件和各个副目录下的文件都一一显示。 ls -a 显示所有文件,包括隐藏文件。 文件权限 r 读权限。对普通文件来说,是读取该文件的权限;对目录来说,是获得该目录下的文件信息。 w 写权限。对文件,是修改;对目录,是增删文件与子目录。 (注 删除没有写权限的文件可以用 rm -f ,这是为了操作方便,是人性化的设计)。 x 执行权限;对目录,是进入该目录 - 表示没有权限 形式 - rw- r-- r-- 其中 第一个是文件类型(-表普通文件,d表目录,l表软链接文件) 第2~4个是属主,生成文件时登录的人,权限最高,用u表示 第5~7个是属组,系统管理员分配的同组的一个或几个人,用g表示 第8~10个是其他人,除属组外的人,用o表示 所有人,包括属主、属组及其他人,用a表示 chmod 更改权限; 用法 chmod [-fR] <绝对模式> 文件 ... chmod [-fR] <符号模式表> 文件 ... 其中 <符号模式表> 是一个用逗号分隔的表 [ugoa]{+|-|=}[rwxXlstugo] chmod u+rw 给用户加权限。同理,u-rw也可以减权限。 chmod u=rw 给用户赋权限。与加权限不一样,赋权限有覆盖的效果。 主要形式有如下几种 chmod u+rw chmod u=rw chmod u+r, u+w chmod u+rw,g+w, o+r chmod 777( 用数字的方式设置权限是最常用的) 数字表示权限时,各数位分别表示属主、属组及其他人; 其中,1是执行权(Execute),2是写权限(Write),4是读权限(Read), 具体权限相当于三种权限的数相加,如7=1+2+4,即拥有读写和执行权。 另外,临时文件/目录的权限为rwt,可写却不可删,关机后自动删除;建临时目录:chmod 777 目录名,再chmod +t 目录名。 id 显示用户有效的uid(用户字)和gid(组名) 用法 id [-ap] [user] id 显示自己的。 id root 显示root的。 id -a root 显示用户所在组的所有组名(如root用户,是所有组的组员) df 查看文件系统,查看数据区 用法 df [-F FSType] [-abeghklntVvZ] [-o FSType 特定选项] [目录 | 块设备 | 资源] df -k 以kbytes显示文件大小的查看文件系统方式 六、显示文件内容 more 分屏显示文件的内容。 用法 more [-cdflrsuw] [-行] [+行号] [+/模式] [文件名 ...]。 显示7个信息:用户名 密码 用户id(uid) 组id(gid) 描述信息(一般为空) 用户主目录 login shell(登录shell) cat 显示文件内容,不分屏(一般用在小文件,大文件显示不下);合并文件,仅在屏幕上合并,并不改变原文件。 用法 cat [ -usvtebn ] [-|文件] ... tail 实时监控文件,一般用在日志文件,可以只看其中的几行。 用法 tail [+/-[n][lbc][f]] [文件] tail [+/-[n][l][r|f]] [文件] 七、文件/目录的增删 echo 显示一行内容。 touch 如果文件/目录不存在,则创建新文件/目录;如果文件存在,那么就是更新该文件的最后访问时间, 用法 touch [-acm] [-r ref_file] 文件... touch [-acm] [MMDDhhmm[yy]] 文件... touch [-acm] [-t [[CC]YY]MMDDhhmm[.SS]] file... mkdir 创建目录(必须有创建目录的权限) 用法 mkdir [-m 模式] [-p] dirname ... mkdir dir1/dir2 在dir1下建dir2 mkdir dir13 dir4 dir5 连建多个 mkdir ~/games 用户主目录下建(默认在当前目录下创建) mkdir -p dir6/dir7/dir8 强制创建dir8;若没有前面的目录,会自动创建dir6和dir7。 不用-p时,若没有dir6/dir7,则创建失败。 cp 复制文件/目录 cp 源文件 目标文件 复制文件;若已有文件则覆盖 cp -r 源目录 目标目录 复制目录;若已有目录则把源目录复制到目标目录下, 没有目标目录时,相当于完全复制源目录,只是文件名不同。 cp beans apple dir2 把beans、apple文件复制到dir2目录下 cp -i beans apple 增加是否覆盖的提示 mv 移动或重命名文件/目录 用法 mv [-f] [-i] f1 f2 mv [-f] [-i] f1 ... fn d1 mv [-f] [-i] d1 d2 mv 源文件名 目标文件名 若目标文件名还没有,则是源文件重命名为目标文件;若目标文件已存在,则源文件覆盖目标文件。 mv 源文件名 目标目录 移动文件 mv 源目录 目标目录 若目标目录不存在,则源目录重命名;若目标目录已存在,则源目录移动到目标目录下。 rm 删除文件/目录 用法 rm [-fiRr] 文件 ... rm 文件名 删除文件。 rm -r 目录名 删除目录。 rm –f 文件 只要是该文件或者目录的拥有者,无论是否有权限删除,都可以用这个命令参数强行删除。 rm -rf * 删除所有文件及目录 rmdir 删除空目录。只可以删除空目录。 ln 创建硬链接或软链接,硬链接=同一文件的多个名字;软链接=快捷方式 用法 ln [-f] [-n] [-s] f1 [f2] ln [-f] [-n] [-s] f1 ... fn d1 ln [-f] [-n] -s d1 d2 ln file1 file1.ln 创建硬链接。感觉是同一文件,删除一个,对另一个没有影响;须两个都删除才算删除。 ln -s file1 file1.sln 创建软链接。可跨系统操作,冲破操作权限;也是快捷方式。 八、时间显示 date 显示时间,精确到秒 用法 date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff] cal 显示日历 cal 9 2008 显示2008年9月的日历; cal 显示当月的 用法 cal [ [月] 年 ] 九、帮助 man 帮助( format and display the on-line manual pages) 用法 man [-] [-adFlrt] [-M 路径] [-T 宏软件包] [-s 段] 名称 ... man [-] [-adFlrt] [-M path] [-T macro-package] [-s section] name... man [-M 路径] -k 关键字 ... man [-M 路径] -f 文件 ... awk 按一定格式输出(pattern scanning and processing language) 用法 awk [-Fc] [-f 源代码 | 'cmds'] [文件] 十、vi 底行模式 /? 命令模式 i a o 输入模式 vi 的使用方法 1、光标 h 左 j 下 k 上 l 右 set nu 显示行号(set nonu) 21 光标停在指定行 21G 第N行 (G到文件尾,1G到文件头) 如果要将光标移动到文件第一行,那么就按 1G H 屏幕头 M 屏幕中间 L 屏幕底 ^ 或 shift+6 行首 $ 或 shift+4 行尾 Ctrl+f 下翻 Ctrl+b 上翻 2、输入 (输入模式) o 光标往下换一行 O (大写字母o)在光标所在行上插入一空行 i 在光标所在位置的前面插入字母 a 在光标所在位置的后面插入一个新字母 退出插入状态。 3、修改替换 r 替换一个字符 dd 删除行,剪切行 (5dd删除5行) 5,10d 删除 5 至 10 行(包括第 5行和第 10 行) x 删除一个字符 dw 删除词,剪切词。 ( 3dw删除 3 单词) cw 替换一个单词。 (cw 和 dw 的区别 cw 删除某一个单词后直接进入编辑模式,而dw删除词后仍处于命令模式) cc 替换一行 C 替换从光标到行尾 yy 复制行 (用法同下的 Y ,见下行) Y 将光标移动到要复制行位置,按yy。当你想粘贴的时候,请将光标移动到你想复制的位置的前一个位置,然后按 p yw 复制词 p 当前行下粘贴 1,2co3 复制行1,2在行3之后 4,5m6 移动行4,5在行6之后 u 当你的前一个命令操作是一个误操作的时候,那么可以按一下 u键,即可复原。只能撤销一次 r file2 在光标所在处插入另一个文件 ~ 将字母变成大写 J 可以将当前行与下一行连接起来 /字符串 从上往下找匹配的字符串 ?字符串 从下往上找匹配的字符串 n 继续查找 1,$s/旧串/新串/g 替换全文(或者 %s/旧串/新串/g) (1表示从第一行开始) 没有g则只替换一次,加g替换所有 3、存盘和退出 w 存盘 w newfile 存成新文件 wq 存盘再退出VI(或者ZZ或 X) q! 强行退出不存盘 查看用户 users 显示在线用户(仅显示用户名)。 who 显示在线用户,但比users更详细,包括用户名、终端号、登录时间、IP地址。 who am i 仅显示自己,(但包括用户名、端口、登录时间、IP地址;信息量=who)。 whoami 也仅显示自己,但只有用户名(仅显示自己的有效的用户名)。 w 显示比who更多内容,还包括闲置时间、占CPU、平均占用CPU、执行命令。 用法 w [ -hlsuw ] [ 用户 ] su 改变用户,需再输入密码。 用法 su [-] [ username [ arg ... ] ] su - 相当于退出再重新登录。 查找 find 查找文件 用法 find [-H | -L] 路径表 谓词表 find / -name perl 从根目录开始查找名为perl的文件。 find . -mtime 10 -print 从当前目录查找距离现在10天时修改的文件,显示在屏幕上。 (注 “10”表示第10天的时候;如果是“+10”表示10天以外的范围;“-10”表示10天以内的范围。) grep 文件中查找字符;有过滤功能,只出想要的内容 用法 grep -hblcnsviw 模式 文件 . . . 如 grep abc /etc/passwd 在passwd文件下找abc字符 wc 统计 -l 统计行数; -w统计单词数; -c 统计字符数 如 grep wang /etc/passwd|wc -l 统计passwd文件含“wang”的行数 du 查看目录情况 如 du -sk * 不加-s会显示子目录,-k按千字节排序 用法 du [-a] [-d] [-h|-k] [-r] [-o|-s] [-H|-L] [文件...] 进程管理 ps 显示进程。 用法 ps [ -aAdeflcjLPyZ ] [ -o 格式 ] [ -t 项表 ] [ -u 用户表 ] [ -U 用户表 ] [ -G 组表 ] [ -p 进程表 ] [ -g 程序组表 ] [ -s 标识符表 ] [ -z 区域表 ] ps 显示自己的进程。 ps -e 显示每个进程,包括空闲进程。 ps -f 显示详情。 ps -ef 组合-e和-f,所有进程的详情。 ps -U uidlist(用户表) 具体查看某人的进程。 kill pkill sleep jobs 用法 jobs [-l ] fg %n bg %n stop %n 挂起(仅csh能用) Ctrl+C Ctrl+Z 网络链接 ping usage ping host [timeout] usage ping -s [-l | U] [adLnRrv] [-A addr_family] [-c traffic_class] [-g gateway [-g gateway ...]] [-F flow_label] [-I interval] [-i interface] [-P tos] [-p port] [-t ttl] host [data_size] [npackets] ifconfig -a /sbin/ifconfig 查看本机的IP地址 netstat -rn rlogin ftp 帮助文件 [sd0807@localhost ~]$ help GNU bash, version 3.1.17(1)-release (i686-redhat-linux-gnu) These shell commands are defined internally. Type `help' to see this list. Type `help name' to find out more about the function `name'. Use `info bash' to find out more about the shell in general. Use `man -k' or `info' to find out more about commands not in this list. A star (*) next to a name means that the command is disabled. JOB_SPEC [&] (( expression )) . filename [arguments] [ arg... ] [[ expression ]] alias [-p] [name[=value] ... ] bg [job_spec ...] bind [-lpvsPVS] [-m keymap] [-f fi break [n] builtin [shell-builtin [arg ...]] caller [EXPR] case WORD in [PATTERN [| PATTERN]. cd [-L|-P] [dir] command [-pVv] command [arg ...] compgen [-abcdefgjksuv] [-o option complete [-abcdefgjksuv] [-pr] [-o continue [n] declare [-afFirtx] [-p] [name[=val dirs [-clpv] [+N] [-N] disown [-h] [-ar] [jobspec ...] echo [-neE] [arg ...] enable [-pnds] [-a] [-f filename] eval [arg ...] exec [-cl] [-a name] file [redirec exit [n] export [-nf] [name[=value] ...] or false fc [-e ename] [-nlr] [first] [last fg [job_spec] for NAME [in WORDS ... ;] do COMMA for (( exp1; exp2; exp3 )); do COM function NAME { COMMANDS ; } or NA getopts optstring name [arg] hash [-lr] [-p pathname] [-dt] [na help [-s] [pattern ...] history [-c] [-d offset] [n] or hi if COMMANDS; then COMMANDS; [ elif jobs [-lnprs] [jobspec ...] or job kill [-s sigspec | -n signum | -si let arg [arg ...] local name[=value] ... logout popd [+N | -N] [-n] printf [-v var] format [arguments] pushd [dir | +N | -N] [-n] pwd [-LP] read [-ers] [-u fd] [-t timeout] [ readonly [-af] [name[=value] ...] return [n] select NAME [in WORDS ... ;] do CO set [--abefhkmnptuvxBCHP] [-o option] [arg ...] shift [n] shopt [-pqsu] [-o long-option] opt source filename [arguments] suspend [-f] test [expr] time [-p] PIPELINE times trap [-lp] [arg signal_spec ...] true type [-afptP] name [name ...] typeset [-afFirtx] [-p] name[=valu ulimit [-SHacdfilmnpqstuvx] [limit umask [-p] [-S] [mode] unalias [-a] name [name ...] unset [-f] [-v] [name ...] until COMMANDS; do COMMANDS; done variables - Some variable names an wait [n] while COMMANDS; do COMMANDS; done { COMMANDS ; } 输入 man help BASH_BUILTINS(1) BASH_BUILTINS(1) NAME bash, :, ., [, alias, bg, bind, break, builtin, cd, command, compgen, complete, continue, declare, dirs, disown, echo, enable, eval, exec, exit, export, fc, fg, getopts, hash, help, history, jobs, kill, let, local, logout, popd, printf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test, times, trap, type, typeset, ulimit, umask, una- lias, unset, wait - bash built-in commands, see bash(1) BASH BUILTIN COMMANDS Unless otherwise noted, each builtin command documented in this section as accepting options preceded by - accepts -- to signify the end of the options. For example, the :, true, false, and test builtins do not accept options. : [arguments] No effect; the command does nothing beyond expanding arguments and performing any specified redirections. A zero exit code is returned. . filename [arguments] source filename [arguments] Read and execute commands from filename in the current shell environment and return the exit status of the last command executed from filename. If filename does not contain a slash, file names in PATH are used to find the directory containing file- name. The file searched for in PATH need not be executable. When bash is not in posix mode, the current directory is searched if no file is found in PATH. If the sourcepath option to the shopt builtin command is turned off, the PATH is not searched. If any arguments are supplied, they become the positional parameters when filename is executed. Otherwise the positional parameters are unchanged. The return status is the status of the last command exited within the script (0 if no commands are executed), and false if filename is not found or cannot be read. alias [-p] [name[=value] ...] Alias with no arguments or with the -p option prints the list of aliases in the form alias name=value on standard output. When arguments are supplied, an alias is defined for each name whose value is given. A trailing space in value causes the next word to be checked for alias substitution when the alias is expanded. For each name in the argument list for which no value is supplied, the name and value of the alias is printed. Alias returns true unless a name is given for which no alias has been defined. bg [jobspec ...] Resume each suspended job jobspec in the background, as if it had been started with &. If jobspec is not present, the shell’s notion of the current job is used. bg jobspec returns 0 unless run when job control is disabled or, when run with job con- trol enabled, any specified jobspec was not found or was started without job control. bind [-m keymap] [-lpsvPSV] bind [-m keymap] [-q function] [-u function] [-r keyseq] bind [-m keymap] -f filename bind [-m keymap] -x keyseq:shell-command bind [-m keymap] keyseq:function-name bind readline-command Display current readline key and function bindings, bind a key sequence to a readline function or macro, or set a readline variable. Each non-option argument is a command as it would appear in .inputrc, but each binding or command must be passed as a sepa- rate argument; e.g., ’"\C-x\C-r": re-read-init-file’. Options, if supplied, have the following meanings: -m keymap Use keymap as the keymap to be affected by the subsequent bindings. Accept- able keymap names are emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command, and vi-insert. vi is equivalent to vi-command; emacs is equivalent to emacs-standard. -l List the names of all readline functions. -p Display readline function names and bindings in such a way that they can be re-read. -P List current readline function names and bindings. -v Display readline variable names and values in such a way that they can be re- read. -V List current readline variable names and values. -s Display readline key sequences bound to macros and the strings they output in such a way that they can be re-read. -S Display readline key sequences bound to macros and the strings they output. -f filename Read key bindings from filename. -q function Query about which keys invoke the named function. -u function Unbind all keys bound to the named function. -r keyseq Remove any current binding for keyseq. -x keyseq:shell-command Cause shell-command to be executed whenever keyseq is entered. The return value is 0 unless an unrecognized option is given or an error occurred. break [n] Exit from within a for, while, until, or select loop. If n is specified, break n levels. n must be ≥ 1. If n is greater than the number of enclosing loops, all enclosing loops are exited. The return value is 0 unless the shell is not executing a loop when break is executed. builtin shell-builtin [arguments] Execute the specified shell builtin, passing it arguments, and return its exit sta- tus. This is useful when defining a function whose name is the same as a shell builtin, retaining the functionality of the builtin within the function. The cd builtin is commonly redefined this way. The return status is false if shell-builtin is not a shell builtin command. cd [-L|-P] [dir] Change the current directory to dir. The variable HOME is the default dir. The variable CDPATH defines the search path for the directory containing dir. Alterna- tive directory names in CDPATH are separated by a colon (:). A null directory name in CDPATH is the same as the current directory, i.e., ‘‘.’’. If dir begins with a slash (/), then CDPATH is not used. The -P option says to use the physical directory structure instead of following symbolic links (see also the -P option to the set builtin command); the -L option forces symbolic links to be followed. An argument of - is equivalent to $OLDPWD. If a non-empty directory name from CDPATH is used, or if - is the first argument, and the directory change is successful, the absolute path- name of the new working directory is written to the standard output. The return value is true if the directory was successfully changed; false otherwise. caller [expr] Returns the context of any active subroutine call (a shell function or a script exe- cuted with the . or source builtins. Without expr, caller displays the line number and source filename of the current subroutine call. If a non-negative integer is supplied as expr, caller displays the line number, subroutine name, and source file corresponding to that position in the current execution call stack. This extra information may be used, for example, to print a stack trace. The current frame is frame 0. The return value is 0 unless the shell is not executing a subroutine call or expr does not correspond to a valid position in the call stack. command [-pVv] command [arg ...] Run command with args suppressing the normal shell function lookup. Only builtin com- mands or commands found in the PATH are executed. If the -p option is given, the search for command is performed using a default value for PATH that is guaranteed to find all of the standard utilities. If either the -V or -v option is supplied, a description of command is printed. The -v option causes a single word indicating the command or file name used to invoke command to be displayed; the -V option produces a more verbose description. If the -V or -v option is supplied, the exit status is 0 if command was found, and 1 if not. If neither option is supplied and an error occurred or command cannot be found, the exit status is 127. Otherwise, the exit status of the command builtin is the exit status of command. compgen [option] [word] Generate possible completion matches for word according to the options, which may be any option accepted by the complete builtin with the exception of -p and -r, and write the matches to the standard output. When using the -F or -C options, the vari- ous shell variables set by the programmable completion facilities, while available, will not have useful values. The matches will be generated in the same way as if the programmable completion code had generated them directly from a completion specification with the same flags. If word is specified, only those completions matching word will be displayed. The return value is true unless an invalid option is supplied, or no matches were generated. complete [-abcdefgjksuv] [-o comp-option] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] name [name ...] complete -pr [name ...] Specify how arguments to each name should be completed. If the -p option is sup- plied, or if no options are supplied, existing completion specifications are printed in a way that allows them to be reused as input. The -r option removes a completion specification for each name, or, if no names are supplied, all completion specifica- tions. The process of applying these completion specifications when word completion is attempted is described above under Programmable Completion. Other options, if specified, have the following meanings. The arguments to the -G, -W, and -X options (and, if necessary, the -P and -S options) should be quoted to protect them from expansion before the complete builtin is invoked. -o comp-option The comp-option controls several aspects of the compspec’s behavior beyond the simple generation of completions. comp-option may be one of: bashdefault Perform the rest of the default bash completions if the compspec gen- erates no matches. default Use readline’s default filename completion if the compspec generates no matches. dirnames Perform directory name completion if the compspec generates no matches. filenames Tell readline that the compspec generates filenames, so it can per- form any filename-specific processing (like adding a slash to direc- tory names or suppressing trailing spaces). Intended to be used with shell functions. nospace Tell readline not to append a space (the default) to words completed at the end of the line. plusdirs After any matches defined by the compspec are generated, directory name completion is attempted and any matches are added to the results of the other actions. -A action The action may be one of the following to generate a list of possible comple- tions: alias Alias names. May also be specified as -a. arrayvar Array variable names. binding Readline key binding names. builtin Names of shell builtin commands. May also be specified as -b. command Command names. May also be specified as -c. directory Directory names. May also be specified as -d. disabled Names of disabled shell builtins. enabled Names of enabled shell builtins. export Names of exported shell variables. May also be specified as -e. file File names. May also be specified as -f. function Names of shell functions. group Group names. May also be specified as -g. helptopic Help topics as accepted by the help builtin. hostname Hostnames, as taken from the file specified by the HOSTFILE shell variable. job Job names, if job control is active. May also be specified as -j. keyword Shell reserved words. May also be specified as -k. running Names of running jobs, if job control is active. service Service names. May also be specified as -s. setopt Valid arguments for the -o option to the set builtin. shopt Shell option names as accepted by the shopt builtin. signal Signal names. stopped Names of stopped jobs, if job control is active. user User names. May also be specified as -u. variable Names of all shell variables. May also be specified as -v. -G globpat The filename expansion pattern globpat is expanded to generate the possible completions. -W wordlist The wordlist is split using the characters in the IFS special variable as delimiters, and each resultant word is expanded. The possible completions are the members of the resultant list which match the word being completed. -C command command is executed in a subshell environment, and its output is used as the possible completions. -F function The shell function function is executed in the current shell environment. When it finishes, the possible completions are retrieved from the value of the COMPREPLY array variable. -X filterpat filterpat is a pattern as used for filename expansion. It is applied to the list of possible completions generated by the preceding options and argu- ments, and each completion matching filterpat is removed from the list. A leading ! in filterpat negates the pattern; in this case, any completion not matching filterpat is removed. -P prefix prefix is added at the beginning of each possible completion after all other options have been applied. -S suffix suffix is appended to each possible completion after all other options have been applied. The return value is true unless an invalid option is supplied, an option other than -p or -r is supplied without a name argument, an attempt is made to remove a comple- tion specification for a name for which no specification exists, or an error occurs adding a completion specification. continue [n] Resume the next iteration of the enclosing for, while, until, or select loop. If n is specified, resume at the nth enclosing loop. n must be ≥ 1. If n is greater than the number of enclosing loops, the last enclosing loop (the ‘‘top-level’’ loop) is resumed. The return value is 0 unless the shell is not executing a loop when con- tinue is executed. declare [-afFirtx] [-p] [name[=value] ...] typeset [-afFirtx] [-p] [name[=value] ...] Declare variables and/or give them attributes. If no names are given then display the values of variables. The -p option will display the attributes and values of each name. When -p is used, additional options are ignored. The -F option inhibits the display of function definitions; only the function name and attributes are printed. If the extdebug shell option is enabled using shopt, the source file name and line number where the function is defined are displayed as well. The -F option implies -f. The following options can be used to restrict output to variables with the specified attribute or to give variables attributes: -a Each name is an array variable (see Arrays above). -f Use function names only. -i The variable is treated as an integer; arithmetic evaluation (see ARITHMETIC EVALUATION ) is performed when the variable is assigned a value. -r Make names readonly. These names cannot then be assigned values by subsequent assignment statements or unset. -t Give each name the trace attribute. Traced functions inherit the DEBUG and RETURN traps from the calling shell. The trace attribute has no special mean- ing for variables. -x Mark names for export to subsequent commands via the environment. Using ‘+’ instead of ‘-’ turns off the attribute instead, with the exception that +a may not be used to destroy an array variable. When used in a function, makes each name local, as with the local command. If a variable name is followed by =value, the value of the variable is set to value. The return value is 0 unless an invalid option is encountered, an attempt is made to define a function using ‘‘-f foo=bar’’, an attempt is made to assign a value to a readonly variable, an attempt is made to assign a value to an array variable without using the compound assignment syntax (see Arrays above), one of the names is not a valid shell variable name, an attempt is made to turn off readonly status for a readonly variable, an attempt is made to turn off array status for an array variable, or an attempt is made to display a non-exis- tent function with -f. dirs [-clpv] [+n] [-n] Without options, displays the list of currently remembered directories. The default display is on a single line with directory names separated by spaces. Directories are added to the list with the pushd command; the popd command removes entries from the list. +n Displays the nth entry counting from the left of the list shown by dirs when invoked without options, starting with zero. -n Displays the nth entry counting from the right of the list shown by dirs when invoked without options, starting with zero. -c Clears the directory stack by deleting all of the entries. -l Produces a longer listing; the default listing format uses a tilde to denote the home directory. -p Print the directory stack with one entry per line. -v Print the directory stack with one entry per line, prefixing each entry with its index in the stack. The return value is 0 unless an invalid option is supplied or n indexes beyond the end of the directory stack. disown [-ar] [-h] [jobspec ...] Without options, each jobspec is removed from the table of active jobs. If the -h option is given, each jobspec is not removed from the table, but is marked so that SIGHUP is not sent to the job if the shell receives a SIGHUP. If no jobspec is present, and neither the -a nor the -r option is supplied, the current job is used. If no jobspec is supplied, the -a option means to remove or mark all jobs; the -r option without a jobspec argument restricts operation to running jobs. The return value is 0 unless a jobspec does not specify a valid job. echo [-neE] [arg ...] Output the args, separated by spaces, followed by a newline. The return status is always 0. If -n is specified, the trailing newline is suppressed. If the -e option is given, interpretation of the following backslash-escaped characters is enabled. The -E option disables the interpretation of these escape characters, even on systems where they are interpreted by default. The xpg_echo shell option may be used to dynamically determine whether or not echo expands these escape characters by default. echo does not interpret -- to mean the end of options. echo interprets the following escape sequences: \a alert (bell) \b backspace \c suppress trailing newline \e an escape character \f form feed \n new line \r carriage return \t horizontal tab \v vertical tab \\ backslash \0nnn the eight-bit character whose value is the octal value nnn (zero to three octal digits) \nnn the eight-bit character whose value is the octal value nnn (one to three octal digits) \xHH the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) enable [-adnps] [-f filename] [name ...] Enable and disable builtin shell commands. Disabling a builtin allows a disk command which has the same name as a shell builtin to be executed without specifying a full pathname, even though the shell normally searches for builtins before disk commands. If -n is used, each name is disabled; otherwise, names are enabled. For example, to use the test binary found via the PATH instead of the shell builtin version, run ‘‘enable -n test’’. The -f option means to load the new builtin command name from shared object filename, on systems that support dynamic loading. The -d option will delete a builtin previously loaded with -f. If no name arguments are given, or if the -p option is supplied, a list of shell builtins is printed. With no other option arguments, the list consists of all enabled shell builtins. If -n is supplied, only disabled builtins are printed. If -a is supplied, the list printed includes all builtins, with an indication of whether or not each is enabled. If -s is supplied, the output is restricted to the POSIX special builtins. The return value is 0 unless a name is not a shell builtin or there is an error loading a new builtin from a shared object. eval [arg ...] The args are read and concatenated together into a single command. This command is then read and executed by the shell, and its exit status is returned as the value of eval. If there are no args, or only null arguments, eval returns 0. exec [-cl] [-a name] [command [arguments]] If command is specified, it replaces the shell. No new process is created. The arguments become the arguments to command. If the -l option is supplied, the shell places a dash at the beginning of the zeroth arg passed to command. This is what login(1) does. The -c option causes command to be executed with an empty environ- ment. If -a is supplied, the shell passes name as the zeroth argument to the exe- cuted command. If command cannot be executed for some reason, a non-interactive shell exits, unless the shell option execfail is enabled, in which case it returns failure. An interactive shell returns failure if the file cannot be executed. If command is not specified, any redirections take effect in the current shell, and the return status is 0. If there is a redirection error, the return status is 1. exit [n] Cause the shell to exit with a status of n. If n is omitted, the exit status is that of the last command executed. A trap on EXIT is executed before the shell termi- nates. export [-fn] [name[=word]] ... export -p The supplied names are marked for automatic export to the environment of subsequently executed commands. If the -f option is given, the names refer to functions. If no names are given, or if the -p option is supplied, a list of all names that are exported in this shell is printed. The -n option causes the export property to be removed from each name. If a variable name is followed by =word, the value of the variable is set to word. export returns an exit status of 0 unless an invalid option is encountered, one of the names is not a valid shell variable name, or -f is sup- plied with a name that is not a function. fc [-e ename] [-nlr] [first] [last] fc -s [pat=rep] [cmd] Fix Command. In the first form, a range of commands from first to last is selected from the history list. First and last may be specified as a string (to locate the last command beginning with that string) or as a number (an index into the history list, where a negative number is used as an offset from the current command number). If last is not specified it is set to the current command for listing (so that ‘‘fc -l -10’’ prints the last 10 commands) and to first otherwise. If first is not speci- fied it is set to the previous command for editing and -16 for listing. The -n option suppresses the command numbers when listing. The -r option reverses the order of the commands. If the -l option is given, the commands are listed on standard output. Otherwise, the editor given by ename is invoked on a file contain- ing those commands. If ename is not given, the value of the FCEDIT variable is used, and the value of EDITOR if FCEDIT is not set. If neither variable is set, is used. When editing is complete, the edited commands are echoed and executed. In the second form, command is re-executed after each instance of pat is replaced by rep. A useful alias to use with this is ‘‘r="fc -s"’’, so that typing ‘‘r cc’’ runs the last command beginning with ‘‘cc’’ and typing ‘‘r’’ re-executes the last command. If the first form is used, the return value is 0 unless an invalid option is encoun- tered or first or last specify history lines out of range. If the -e option is sup- plied, the return value is the value of the last command executed or failure if an error occurs with the temporary file of commands. If the second form is used, the return status is that of the command re-executed, unless cmd does not specify a valid history line, in which case fc returns failure. fg [jobspec] Resume jobspec in the foreground, and make it the current job. If jobspec is not present, the shell’s notion of the current job is used. The return value is that of the command placed into the foreground, or failure if run when job control is dis- abled or, when run with job control enabled, if jobspec does not specify a valid job or jobspec specifies a job that was started without job control. getopts optstring name [args] getopts is used by shell procedures to parse positional parameters. optstring con- tains the option characters to be recognized; if a character is followed by a colon, the option is expected to have an argument, which should be separated from it by white space. The colon and question mark characters may not be used as option char- acters. Each time it is invoked, getopts places the next option in the shell vari- able name, initializing name if it does not exist, and the index of the next argument to be processed into the variable OPTIND. OPTIND is initialized to 1 each time the shell or a shell script is invoked. When an option requires an argument, getopts places that argument into the variable OPTARG. The shell does not reset OPTIND auto- matically; it must be manually reset between multiple calls to getopts within the same shell invocation if a new set of parameters is to be used. When the end of options is encountered, getopts exits with a return value greater than zero. OPTIND is set to the index of the first non-option argument, and name is set to ?. getopts normally parses the positional parameters, but if more arguments are given in args, getopts parses those instead. getopts can report errors in two ways. If the first character of optstring is a colon, silent error reporting is used. In normal operation diagnostic messages are printed when invalid options or missing option arguments are encountered. If the variable OPTERR is set to 0, no error messages will be displayed, even if the first character of optstring is not a colon. If an invalid option is seen, getopts places ? into name and, if not silent, prints an error message and unsets OPTARG. If getopts is silent, the option character found is placed in OPTARG and no diagnostic message is printed. If a required argument is not found, and getopts is not silent, a question mark (?) is placed in name, OPTARG is unset, and a diagnostic message is printed. If getopts is silent, then a colon (:) is placed in name and OPTARG is set to the option charac- ter found. getopts returns true if an option, specified or unspecified, is found. It returns false if the end of options is encountered or an error occurs. hash [-lr] [-p filename] [-dt] [name] For each name, the full file name of the command is determined by searching the directories in $PATH and remembered. If the -p option is supplied, no path search is performed, and filename is used as the full file name of the command. The -r option causes the shell to forget all remembered locations. The -d option causes the shell to forget the remembered location of each name. If the -t option is supplied, the full pathname to which each name corresponds is printed. If multiple name arguments are supplied with -t, the name is printed before the hashed full pathname. The -l option causes output to be displayed in a format that may be reused as input. If no arguments are given, or if only -l is supplied, information about remembered commands is printed. The return status is true unless a name is not found or an invalid option is supplied. help [-s] [pattern] Display helpful information about builtin commands. If pattern is specified, help gives detailed help on all commands matching pattern; otherwise help for all the builtins and shell control structures is printed. The -s option restricts the infor- mation displayed to a short usage synopsis. The return status is 0 unless no command matches pattern. history [n] history -c history -d offset history -anrw [filename] history -p arg [arg ...] history -s arg [arg ...] With no options, display the command history list with line numbers. Lines listed with a * have been modified. An argument of n lists only the last n lines. If the shell variable HISTTIMEFORMAT is set and not null, it is used as a format string for strftime(3) to display the time stamp associated with each displayed history entry. No intervening blank is printed between the formatted time stamp and the history line. If filename is supplied, it is used as the name of the history file; if not, the value of HISTFILE is used. Options, if supplied, have the following meanings: -c Clear the history list by deleting all the entries. -d offset Delete the history entry at position offset. -a Append the ‘‘new’’ history lines (history lines entered since the beginning of the current bash session) to the history file. -n Read the history lines not already read from the history file into the current history list. These are lines appended to the history file since the begin- ning of the current bash session. -r Read the contents of the history file and use them as the current history. -w Write the current history to the history file, overwriting the history file’s contents. -p Perform history substitution on the following args and display the result on the standard output. Does not store the results in the history list. Each arg must be quoted to disable normal history expansion. -s Store the args in the history list as a single entry. The last command in the history list is removed before the args are added. If the HISTTIMEFORMAT is set, the time stamp information associated with each history entry is written to the history file. The return value is 0 unless an invalid option is encountered, an error occurs while reading or writing the history file, an invalid offset is supplied as an argument to -d, or the history expansion supplied as an argument to -p fails. jobs [-lnprs] [ jobspec ... ] jobs -x command [ args ... ] The first form lists the active jobs. The options have the following meanings: -l List process IDs in addition to the normal information. -p List only the process ID of the job’s process group leader. -n Display information only about jobs that have changed status since the user was last notified of their status. -r Restrict output to running jobs. -s Restrict output to stopped jobs. If jobspec is given, output is restricted to information about that job. The return status is 0 unless an invalid option is encountered or an invalid jobspec is sup- plied. If the -x option is supplied, jobs replaces any jobspec found in command or args with the corresponding process group ID, and executes command passing it args, returning its exit status. kill [-s sigspec | -n signum | -sigspec] [pid | jobspec] ... kill -l [sigspec | exit_status] Send the signal named by sigspec or signum to the processes named by pid or jobspec. sigspec is either a case-insensitive signal name such as SIGKILL (with or without the SIG prefix) or a signal number; signum is a signal number. If sigspec is not present, then SIGTERM is assumed. An argument of -l lists the signal names. If any arguments are supplied when -l is given, the names of the signals corresponding to the arguments are listed, and the return status is 0. The exit_status argument to -l is a number specifying either a signal number or the exit status of a process termi- nated by a signal. kill returns true if at least one signal was successfully sent, or false if an error occurs or an invalid option is encountered. let arg [arg ...] Each arg is an arithmetic expression to be evaluated (see ARITHMETIC EVALUATION). If the last arg evaluates to 0, let returns 1; 0 is returned otherwise. local [option] [name[=value] ...] For each argument, a local variable named name is created, and assigned value. The option can be any of the options accepted by declare. When local is used within a function, it causes the variable name to have a visible scope restricted to that function and its children. With no operands, local writes a list of local variables to the standard output. It is an error to use local when not within a function. The return status is 0 unless local is used outside a function, an invalid name is sup- plied, or name is a readonly variable. logout Exit a login shell. popd [-n] [+n] [-n] Removes entries from the directory stack. With no arguments, removes the top direc- tory from the stack, and performs a cd to the new top directory. Arguments, if sup- plied, have the following meanings: +n Removes the nth entry counting from the left of the list shown by dirs, start- ing with zero. For example: ‘‘popd +0’’ removes the first directory, ‘‘popd +1’’ the second. -n Removes the nth entry counting from the right of the list shown by dirs, starting with zero. For example: ‘‘popd -0’’ removes the last directory, ‘‘popd -1’’ the next to last. -n Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. If the popd command is successful, a dirs is performed as well, and the return status is 0. popd returns false if an invalid option is encountered, the directory stack is empty, a non-existent directory stack entry is specified, or the directory change fails. printf [-v var] format [arguments] Write the formatted arguments to the standard output under the control of the format. The format is a character string which contains three types of objects: plain charac- ters, which are simply copied to standard output, character escape sequences, which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive argument. In addition to the standard printf(1) formats, %b causes printf to expand backslash escape sequences in the cor- responding argument (except that \c terminates output, backslashes in \', \", and \? are not removed, and octal escapes beginning with \0 may contain up to four digits), and %q causes printf to output the corresponding argument in a format that can be reused as shell input. The -v option causes the output to be assigned to the variable var rather than being printed to the standard output. The format is reused as necessary to consume all of the arguments. If the format requires more arguments than are supplied, the extra format specifications behave as if a zero value or null string, as appropriate, had been supplied. The return value is zero on success, non-zero on failure. pushd [-n] [dir] pushd [-n] [+n] [-n] Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working directory. With no arguments, exchanges the top two directories and returns 0, unless the directory stack is empty. Arguments, if supplied, have the following meanings: +n Rotates the stack so that the nth directory (counting from the left of the list shown by dirs, starting with zero) is at the top. -n Rotates the stack so that the nth directory (counting from the right of the list shown by dirs, starting with zero) is at the top. -n Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. dir Adds dir to the directory stack at the top, making it the new current working directory. If the pushd command is successful, a dirs is performed as well. If the first form is used, pushd returns 0 unless the cd to dir fails. With the second form, pushd returns 0 unless the directory stack is empty, a non-existent directory stack element is specified, or the directory change to the specified new current directory fails. pwd [-LP] Print the absolute pathname of the current working directory. The pathname printed contains no symbolic links if the -P option is supplied or the -o physical option to the set builtin command is enabled. If the -L option is used, the pathname printed may contain symbolic links. The return status is 0 unless an error occurs while reading the name of the current directory or an invalid option is supplied. read [-ers] [-u fd] [-t timeout] [-a aname] [-p prompt] [-n nchars] [-d delim] [name ...] One line is read from the standard input, or from the file descriptor fd supplied as an argument to the -u option, and the first word is assigned to the first name, the second word to the second name, and so on, with leftover words and their intervening separators assigned to the last name. If there are fewer words read from the input stream than names, the remaining names are assigned empty values. The characters in IFS are used to split the line into words. The backslash character (\) may be used to remove any special meaning for the next character read and for line continuation. Options, if supplied, have the following meanings: -a aname The words are assigned to sequential indices of the array variable aname, starting at 0. aname is unset before any new values are assigned. Other name arguments are ignored. -d delim The first character of delim is used to terminate the input line, rather than newline. -e If the standard input is coming from a terminal, readline (see READLINE above) is used to obtain the line. -n nchars read returns after reading nchars characters rather than waiting for a com- plete line of input. -p prompt Display prompt on standard error, without a trailing newline, before attempt- ing to read any input. The prompt is displayed only if input is coming from a terminal. -r Backslash does not act as an escape character. The backslash is considered to be part of the line. In particular, a backslash-newline pair may not be used as a line continuation. -s Silent mode. If input is coming from a terminal, characters are not echoed. -t timeout Cause read to time out and return failure if a complete line of input is not read within timeout seconds. This option has no effect if read is not reading input from the terminal or a pipe. -u fd Read input from file descriptor fd. If no names are supplied, the line read is assigned to the variable REPLY. The return code is zero, unless end-of-file is encountered, read times out, or an invalid file descriptor is supplied as the argument to -u. readonly [-apf] [name[=word] ...] The given names are marked readonly; the values of these names may not be changed by subsequent assignment. If the -f option is supplied, the functions corresponding to the names are so marked. The -a option restricts the variables to arrays. If no name arguments are given, or if the -p option is supplied, a list of all readonly names is printed. The -p option causes output to be displayed in a format that may be reused as input. If a variable name is followed by =word, the value of the vari- able is set to word. The return status is 0 unless an invalid option is encountered, one of the names is not a valid shell variable name, or -f is supplied with a name that is not a function. return [n] Causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command executed in the function body. If used outside a function, but during execution of a script by the . (source) command, it causes the shell to stop executing that script and return either n or the exit status of the last command executed within the script as the exit status of the script. If used outside a function and not during execution of a script by ., the return status is false. Any command associated with the RETURN trap is executed before execution resumes after the function or script. set [--abefhkmnptuvxBCHP] [-o option] [arg ...] Without options, the name and value of each shell variable are displayed in a format that can be reused as input for setting or resetting the currently-set variables. Read-only variables cannot be reset. In posix mode, only shell variables are listed. The output is sorted according to the current locale. When options are specified, they set or unset shell attributes. Any arguments remaining after the options are processed are treated as values for the positional parameters and are assigned, in order, to $1, $2, ... $n. Options, if specified, have the following meanings: -a Automatically mark variables and functions which are modified or created for export to the environment of subsequent commands. -b Report the status of terminated background jobs immediately, rather than before the next primary prompt. This is effective only when job control is enabled. -e Exit immediately if a simple command (see SHELL GRAMMAR above) exits with a non-zero status. The shell does not exit if the command that fails is part of the command list immediately following a while or until keyword, part of the test in an if statement, part of a && or ││ list, or if the command’s return value is being inverted via !. A trap on ERR, if set, is executed before the shell exits. -f Disable pathname expansion. -h Remember the location of commands as they are looked up for execution. This is enabled by default. -k All arguments in the form of assignment statements are placed in the environ- ment for a command, not just those that precede the command name. -m Monitor mode. Job control is enabled. This option is on by default for interactive shells on systems that support it (see JOB CONTROL above). Back- ground processes run in a separate process group and a line containing their exit status is printed upon their completion. -n Read commands but do not execute them. This may be used to check a shell script for syntax errors. This is ignored by interactive shells. -o option-name The option-name can be one of the following: allexport Same as -a. braceexpand Same as -B. emacs Use an emacs-style command line editing interface. This is enabled by default when the shell is interactive, unless the shell is started with the --noediting option. errtrace Same as -E. functrace Same as -T. errexit Same as -e. hashall Same as -h. histexpand Same as -H. history Enable command history, as described above under HISTORY. This option is on by default in interactive shells. ignoreeof The effect is as if the shell command ‘‘IGNOREEOF=10’’ had been exe- cuted (see Shell Variables above). keyword Same as -k. monitor Same as -m. noclobber Same as -C. noexec Same as -n. noglob Same as -f. nolog Currently ignored. notify Same as -b. nounset Same as -u. onecmd Same as -t. physical Same as -P. pipefail If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status, or zero if all command

27,579

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧