Linux sh命令

2023-11-13

sh [-a] [-c] [-C] [-e] [-E] [-f] [-h] [-i] [-I][-k] [-m] [-n] [-p] [-r] [-s] [-t] [-T] [-u] [-v] [-x] [ argument ]
-a    Export all variables assigned to.
-c    Pass the string argument to the shell to be interpreted as input. Keep in mind that this option only accepts a single string as its argument, hence multi-word strings must be quoted.
-C    Don't overwrite existing files with ``>.''
-e    If not interactive, exit immediately if any untested command fails. The exit status of a command is considered to be explic- itly tested if the command is used to control an if, elif, while, or until; or if the command is the left hand operand of an ``&&'' or ``||'' operator.
-E    Enable the built-in emacs command line editor (disables -V if it has been set).
-f    Disable pathname expansion.
-h    Makes all commands use tracked aliases.
-i    Force the shell to behave interactively.
-I    Ignore EOF's from input when interactive.
-k    tells the shell to use Korn-compatible behavior in any case where the POSIX.2 behavior is different from the behavior specified by Korn. In particular, this affects the trap command.
-m    Turn on job control (set automatically when interactive).
-n    If not interactive, read commands but do not execute them. This is useful for checking the syntax of shell scripts.
-p    Turn on privileged mode. This mode is enabled on startup if either the effective user or group id is not equal to the real user or group id. Turning this mode off sets the effective user and group ids to the real user and group ids. Also on interactive shells and when enabled, this mode sources /etc/suid_profile (in- stead of ~/.profile) after /etc/profile and ignores the contents of the ENV variable.
-r    Invokes a restricted shell. In a restricted shell, you cannot do any of the following: use the cd command; change the values of the variables env, path or shell; use > or >> to redirect output; specify command names containing /. These restrictions do not apply during execution of profile files.
-s    Read commands from standard input (set automatically if no file arguments are present). This option has no effect when set after the shell has already started running (i.e. with set).
-t    Exits after reading and executing one command.
-T    When waiting for a child, execute traps immediately. If this option is not set, traps are executed after the child exits, as specified in IEEE Std1003.2 (``POSIX'') This nonstandard option is useful to put guarding shells around childs that block signals. The surrounding shell may kill the child or it may just re- turn control to the tty and leave the child alone.
-u    Write a message to standard error when attempting to expand a variable that is not set, and if the shell is not interactive, exit immediately.
-v    The shell writes its input to standard error as it is read. Useful for debugging.
-V    Enable the built-in vi command line editor (disables -E if it has been set).
-x    Write each command to standard error (preceded by a '+ ') before it is executed. Useful for debugging.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Linux sh命令 的相关文章

  • linux4.6 EC11旋转编码器的驱动

    最近项目使用了旋转编码器EC11 遍查内核 发现并没有它的驱动 查了查 终于找到一篇有用的 根据自己的需要和对最基础的gpio key c的理解 我改写出了一份EC11的专用驱动 感谢下面博主的启发 有了这位高人的指点 我才有信心改写成功
  • cramfs文件系统制作

    参考 http blog csdn net liukun321 article details 7256456 1 首先配置内核 打开对cramfs的支持 File systems gt Miscellaneous filesystems
  • ubuntu下ssh2安装

    iceant iceant desktop share ssh localhost ssh connect to host localhost port 22 Network is unreachable iceant iceant des
  • Linux free -m 详细说明

    free 命令相对于top 提供了更简洁的查看系统内存使用情况 free total used free shared buffers cached Mem 255268 238332 16936 0 85540 126384 buffer
  • Linux下安装QT4.3.2

    安装qt是因为我刚安装过mplayer想装个前端上网 一查 很多都推崇用smplayer 我也就下决心装上 刚开始一直都装不上 后来静心读了读Install文件才明白要装smplayer必须要有qt4 2或者更高版本 用rpm qa qt才
  • 记mount NFS遇到的一个问题(-o nolock)

    前两天 测试 过程中 测试机始终 mount 不上我们的 nfs 比如我使用命令 mount vt nfs share mnt share 开始是mount命令一直hang在那里 卡住了 另一种情况是 有类似如下的错误输出 portmap
  • intel性能测试工具VTune的功能和用法介绍

    转自 https blog csdn net WY stutdy article details 79106501 https software intel com en us node 256997 1 VTune介绍 VTune可视化性
  • Linux系统之I/O进程

    Linux系统之I O进程 1 C库和C程序的编译过程 1 1 C库的分类 1 1 1 静态库的概念 1 1 2 制作静态库 1 1 3 动态库的概念 1 1 4 制作动态库 1 2 编译过程 共四步 2 标准I O 2 1 文件类型 2
  • shell命令以及运行原理(详解)

    Linux严格意义上说的是一个操作系统 我们称之为 核心 kernel 但我们一般用户 不能直接使用kernel 而是通过kernel的 外壳 程序 也就是所谓的shell 来与kernel沟通 1 从技术角度 Shell的最简单定义 命令
  • SMTP邮件格式、SMTP 协议,SMTP的MIME写法,SMTP发送HTML邮件

    转载 http blog sina com cn s blog 759444350100vx8u html MIME邮件格式 在RFC 2822文档中定义了简单的ASCII编码的Email的邮件格式 然而随着Internet的发展 Emai
  • linux设置系统时间

    我们一般使用 date s 命令来修改系统时间 比如将系统时间设定成20066年10月19日的命令如下 date s 10 19 2006 将系统时间设定成下午1点12分0秒的命令如下 date s 13 12 00 注意 这里说的是系统时
  • Linux sh命令

    sh a c C e E f h i I k m n p r s t T u v x argument a Export all variables assigned to c Pass the string argument to the
  • linux系统之字符设备驱动——IIC驱动mma8451q

    linux系统之字符设备驱动 IIC子系统驱动mma8451q 1 原理图 2 驱动程序 mma8451q c Author your name Date 2021 02 23 22 16 37 LastEditTime 2021 02 2
  • 日志查找常用命令-超实用

    0 前言 1 命令的尾部添加 color 或者 color auto 可以使关键字带颜色 很清晰 1 Linux日志查找常用命令 1 1 cat zcat cat n app log grep error 查询日志中含有某个关键字error
  • 杂项知识

    挂载 img 文件 mount t proc o loop initrd 2 6 23 1 42 fc8 img mnt img mount t debugfs o loop initrd 2 6 23 1 42 fc8 img mnt i
  • 【自用】深度学习工作站安装ubuntu 18.04 LTS系统

    工作站配置 自己组装的 主板 华硕Z790P PCIE插槽间距大 可以装双显卡 CPU i5 13600KF 内存 32 G 显卡 GTX 2080 Ti 魔改版 22G 存储 1T SSD 8T机械硬盘 系统 ubuntu 18 04 L
  • spark_hadoop集群搭建自动化脚本

    bin bash 脚本使用说明 1 使用脚本前需要弄好服务器的基础环境 2 在hadoop的每个节点需要手动创建如下目录 data hdfs tmp 3 修改下面的配置参数 4 脚本执行完备后需要收到格式化namenode
  • Windows挂载Linux网络共享文件夹

    Windows挂载Linux网络共享文件夹 创建Linux网络共享文件夹 用共享工具samba Ubuntu安装samba sudo apt install samba 配置Windows访问共享文件夹的账户 smbpasswd a riv
  • spi总线挂载多个设备的设备树描述

    内核版本 linux4 6 Vivado版本 201602 工程中用到很多spi控制的从设备 首先对FPGA工程的正确性验证一下 验证的设备树描述如下 spi e0006000 compatible xlnx zynq spi r1p6 r
  • Linux shell中if [ $? -eq 0 ] 语句作用:判断命令是否执行成功

    shell脚本中 是指上一次命令执行的成功或者失败的状态 如果成功就是0 失败为1 语句if eq 0 是判断if语句的上一个命令执行如果成功就执行if中的语句 否则就执行else中的内容 note 使用时要注意 if后面的中括号 eq 0

随机推荐