Linux命令大全分类.doc

上传人:自*** 文档编号:126226501 上传时间:2020-03-23 格式:DOC 页数:15 大小:62.50KB
返回 下载 相关 举报
Linux命令大全分类.doc_第1页
第1页 / 共15页
Linux命令大全分类.doc_第2页
第2页 / 共15页
Linux命令大全分类.doc_第3页
第3页 / 共15页
Linux命令大全分类.doc_第4页
第4页 / 共15页
Linux命令大全分类.doc_第5页
第5页 / 共15页
点击查看更多>>
资源描述

《Linux命令大全分类.doc》由会员分享,可在线阅读,更多相关《Linux命令大全分类.doc(15页珍藏版)》请在金锄头文库上搜索。

1、Linux sh命令(调用sh文件程序)如何使用Linux命令 shRuns or processes jobs through the Bourne shell.linux sh 的语法sh -a -c -C -e -E -f -h -i -I-k -m -n -p -r -s -t -T -u -v -x argument -aExport all variables assigned to.-cPass the string argument to the shell to be interpreted as input. Keep in mind that this option on

2、ly accepts a single string as its argument, hence multi-word strings must be quoted.-CDont overwrite existing files with .-eIf 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

3、, elif, while, or until; or if the command is the left hand operand of an & or | operator.-EEnable the built-in emacs command line editor (disables -V if it has been set).-fDisable pathname expansion.-hMakes all commands use tracked aliases.-iForce the shell to behave interactively.-IIgnore EOFs fro

4、m input when interactive.-ktells 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.-mTurn on job control (set automatically when interactive).-nIf not interactive, read comma

5、nds but do not execute them. This is useful for checking the syntax of shell scripts.-pTurn 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

6、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.-rInvokes a restricted shell. In a restricted shell, you cannot do any of the following: use the cd command; c

7、hange 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.-sRead commands from standard input (set automatically if no file arguments are present). This option has no effect w

8、hen set after the shell has already started running (i.e. with set).-tExits after reading and executing one command.-TWhen 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 opti

9、on 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.-uWrite a message to standard error when attempting to expand a variable that is not set, and if the shell is not intera

10、ctive, exit immediately.-vThe shell writes its input to standard error as it is read. Useful for debugging.-VEnable the built-in vi command line editor (disables -E if it has been set).-xWrite each command to standard error (preceded by a + ) before it is executed. Useful for debugging.linux sh 的演示示

11、例:sh - Executes the Bourne shell, likely taking you to a $ prompt.字符串操作echo File Name: DSP.sh 打印字符串# 注释本行Vi文件操作Vi my.sh /打开一个文件进行编辑。如果是不存在的文件则会新建文件Esc /进入命令模式i /进入修改模式:q! /强制推出不保存文件修改:wq /推出并保存修改环境变量setset功能说明:设置shell。语 法:set +-abCdefhHklmnpPtuvx补充说明:set指令能设置所使用shell的执行方式,可依照不同的需求来做设置。参 数: -a 标示已修改的

12、变量,以供输出至环境变量。 -b 使被中止的后台程序立刻回报执行状态。 -C 转向所产生的文件无法覆盖已存在的文件。 -d Shell预设会用杂凑表记忆使用过的指令,以加速指令的执行。使用-d参数可取消。 -e 若指令传回值不等于0,则立即退出shell。 -f 取消使用通配符。 -h 自动记录函数的所在位置。 -H Shell 可利用!加的方式来执行history中记录的指令。 -k 指令所给的参数都会被视为此指令的环境变量。 -l 记录for循环的变量名称。 -m 使用监视模式。 -n 只读取指令,而不实际执行。 -p 启动优先顺序模式。 -P 启动-P参数后,执行指令时,会以实际的文件或

13、目录来取代符号连接。 -t 执行完随后的指令,即退出shell。 -u 当执行时使用到未定义过的变量,则显示错误信息。 -v 显示shell所读取的输入值。 -x 执行指令后,会先显示该指令及所下的参数。 + 取消某个set曾启动的参数。系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT /dev/sda 在磁盘上执行测试性读取操作 cat /proc

14、/cpuinfo 显示CPU info的信息 cat /proc/interrupts 显示中断 cat /proc/meminfo 校验内存使用 cat /proc/swaps 显示哪些swap被使用 cat /proc/version 显示内核的版本 cat /proc/net/dev 显示网络适配器及统计 cat /proc/mounts 显示已加载的文件系统 lspci -tv 罗列 PCI 设备 lsusb -tv 显示 USB 设备 date 显示系统日期 cal 2007 显示2007年的日历表 date 041217002007.00 设置日期和时间 - 月日时分年.秒 clo

15、ck -w 将时间修改保存到 BIOS 关机 (系统的关机、重启以及登出 ) shutdown -h now 关闭系统(1) init 0 关闭系统(2) telinit 0 关闭系统(3) shutdown -h hours:minutes & 按预定时间关闭系统 shutdown -c 取消按预定时间关闭系统 shutdown -r now 重启(1) reboot 重启(2) logout 注销 文件和目录操作cd /home 进入 / home 目录 cd . 返回上一级目录 cd ./. 返回上两级目录 cd 进入个人的主目录 cd user1 进入个人的主目录 cd - 返回上次所在的目录 pwd 显示工作路径 ls 查看目录中的文件 ls -F 查看目录中的文件 ls -l 显示文件和目录的详细资料 ls -a 显示隐藏文件 ls *0-9* 显示包含

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > IT计算机/网络 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号