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的专用驱动 感谢下面博主的启发 有了这位高人的指点 我才有信心改写成功
  • linux硬链接与软链接

    http www cnblogs com sonic4x archive 2011 08 05 2128543 html 1 Linux链接概念 Linux链接分两种 一种被称为硬链接 Hard Link 另一种被称为符号链接 Symbol
  • ubuntu16.04安装cmake-3.8.1最靠谱的方法(ubuntu下安装指定版本cmke)

    1 问题描述 2 cmake安装五种方法 法一 下载cmake二进制安装包 配置路径 亲测有效 法二 cmake源码编译 注意和法一区别 法三 apt安装 法四 在原基础上升级版本 法五 ppa安装 1 问题描述 在配置OpenMVS时 报
  • ubuntu安装ftp服务器( 一般配置 )

    http blog csdn net nation chen article details 7066277 ubuntu安装ftp服务器 1 安装vsftpd sudo apt get install vsftpd ubuntu10 10
  • addr2line objdump命令使用方法

    如果是 的 CMakeList txt 编译的时候需要加上一下选项 才可以生产 版本 可以使用addr2line 定位问题 catkin make DCMAKE BUILD TYPE debug DCATKIN WHITELIST PACK
  • ld 链接程序出错定位

    工具链相关问题 一般可 verbose 下 看看具体什么地方出问题 设置 LDFLAGS Wl verbose 例如 链接一堆 o文件 只有以下错误信息 ld final link failed Bad value 就可以加入 Wl ver
  • linux grep 使用

    1 grep 单独使用 搜素指定目录中包含指定字符的文件 例如 grep r words 搜素当前目录中包含 words 字符的文件 grep r words wc 搜素当前目录中包含 words 字符的文件 只显示 包含该字符的数量 2
  • linux中,如何使用tar进行解压缩

    linux中 如何使用tar进行解压缩 环境 windows 7 virtualboax fedora 15 kde 可以使用tar命令解压缩 tar gz文件 下面以解压缩qt源文件举例 1 在windows中将qt源文件拷贝到共享文件夹
  • 记mount NFS遇到的一个问题(-o nolock)

    前两天 测试 过程中 测试机始终 mount 不上我们的 nfs 比如我使用命令 mount vt nfs share mnt share 开始是mount命令一直hang在那里 卡住了 另一种情况是 有类似如下的错误输出 portmap
  • 在linux shell中使用ftp命令来实现自动登陆、上传与下载

    前段时间有个需求 需要利用crontab定时往某个FTP上传文件 原以为linux中带的ftp命令只支持交互式的操作 没法在命令行下使用 所以后来打算利用PHP中提供的ftp命令来做 但是很不幸的发现ftp模块不是PHP的标准模块 还需要自
  • linux进程间通信---本地socket套接字(一)---一个server对应一个client

    先给自己打个广告 本人的微信公众号正式上线了 搜索 张笑生的地盘 主要关注嵌入式软件开发 股票基金定投 足球等等 希望大家多多关注 有问题可以直接留言给我 一定尽心尽力回答大家的问题 想要获取完整源码的 关注公众号后回复 socket1 即
  • Linux gdm问题解决解决

    修改 etc inittab 改变runlevel为5 例如 root QRedHat etc cat etc inittab id 5 initdefault 修改GDM的配置文件 etc X11 gdm gdm conf 将 xdmcp
  • linux设置系统时间

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

    1 find package的作用与实例 用来查找第三方依赖包的 cmake文件 并根据 cmake文件生成依赖包的头文件目录和库文件路径等 CMakeLists txt实例 find package Protobuf REQUIRED i
  • 日志查找常用命令-超实用

    0 前言 1 命令的尾部添加 color 或者 color auto 可以使关键字带颜色 很清晰 1 Linux日志查找常用命令 1 1 cat zcat cat n app log grep error 查询日志中含有某个关键字error
  • linux中如何重新configure(或去除已configure的文件)

    linux中如何重新configure 或去除已configure的文件 linux中 在安装源码软件前 需要configure命令来进行安装配置 有时configure后需要重新configure 这时需要进行一些操作 已放置出错 以在f
  • 杂项知识

    挂载 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
  • 鼠标点击页面出现富强自由等文字JS特效

    在其他博客看到一款JS特效 感觉很不错 所有网上收集过来分享给大家 效果参考本网站 添加点击特效 点击页面会显示 富强 民主 文明 和谐 自由 平等 公正 法治 爱国 敬业 诚信 友善 把以下代码添加到当前主题的head php或foote
  • gdb 的使用总结

    1 设置动态库的路径 set solib search path PATH 如果需要设置多个路径 则在PATH直接用 冒号分隔 set solib search path PATH1 PATH2
  • Add/Remove software 或yum从光盘安装

    Add RemoveSoftware 好像是集成了一些类似于yum的功能 每次打开它时 它都会上网去搜索安装包的列表 要搜好一阵子 如果不想让它上网去索搜 而只是在本地添加 删除软件 那我们就要先把yum的仓库文删除 也就是把 etc yu

随机推荐