`
老男孩Demon
  • 浏览: 11781 次
  • 性别: Icon_minigender_1
  • 来自: 大连
最近访客 更多访客>>
社区版块
存档分类
最新评论

shell&vi

    博客分类:
  • UNIX
阅读更多

Shell

系统设置:

<!--[if !supportLists]-->1.   <!--[endif]-->tty                     显示当前的终端号

<!--[if !supportLists]-->2.   <!--[endif]-->stty                        显示和设置终端参数

stty –a                    附加显示参数

stty [command] ‘[key]’设置键值

<!--[if !supportLists]-->3.   <!--[endif]-->date                        显示日期

date –u MMddhhmm       修改时间到MMddhhmm

<!--[if !supportLists]-->4.   <!--[endif]-->time                        显示时间

<!--[if !supportLists]-->5.   <!--[endif]-->cal                     显示日历

cal [month] [year]      显示XX月日历,参数只有1个数字默认为年份

<!--[if !supportLists]-->6.   <!--[endif]-->who                     按字母顺序列出当前注册到计算机上的用户

who am i                    打印当前用户的信息

who –T                 附加显示用户终端状态

who –r                 显示系统的运行级

<!--[if !supportLists]-->7.   <!--[endif]-->w                       显示目前在线用户以及这些用户当前工作

<!--[if !supportLists]-->8.   <!--[endif]-->cu                      连接另一台unix主机

cu –s [speed] [num]        按照传输速度连接另一台unix主机

cu –l [port]           按照制定得通讯线路连接另一台unix主机

<!--[if !supportLists]-->9.   <!--[endif]-->finger                  显示用户信息

finger –T              (与who类似)

<!--[if !supportLists]-->10.  <!--[endif]-->news                        显示/usr/news目录中文件找到的系统新闻

news –a                    显示所有项

news –n                    只显示你没有看到的当前文件的名字

<!--[if !supportLists]-->11.  <!--[endif]-->man [title]             查看联机手册

man [–M path] [[section]title]    

path为所需手册数据库的路径,section为一个数字表示的手册分类,1代表可执行命令,2代表系统呼叫,3代表标准函数等等

man –k [keyword]       用来将含有keywordtitle列出来

<!--[if !supportLists]-->12.  <!--[endif]-->clear                   清楚终端屏幕

<!--[if !supportLists]-->13.  <!--[endif]-->lock                        给终端加锁

lock [-time]                给终端加锁多长时间

<!--[if !supportLists]-->14.  <!--[endif]-->passwd                  修改当前用户口令

<!--[if !supportLists]-->15.  <!--[endif]-->write [username]            向其他用户发送消息,不允许应答,*return结束

<!--[if !supportLists]-->16.  <!--[endif]-->hello [username]            unix系统普通用户使用与write相同,超级用户输入的内

容立即出现在对方屏幕上

<!--[if !supportLists]-->17.  <!--[endif]-->mesg [-y/-n]                控制终端是否可写

<!--[if !supportLists]-->18.  <!--[endif]-->mail [username]         发送,阅读电子邮件,quitexit退出

<!--[if !supportLists]-->19.  <!--[endif]-->wall                        发送消息到系统所有用户

<!--[if !supportLists]-->20.  <!--[endif]-->rwall                   发送消息到网络中所有用户

rwall –n [netgroup]        发送消息到netgroup中的所有用户

<!--[if !supportLists]-->21.  <!--[endif]-->su – [user]                切换到user用户

文件目录

<!--[if !supportLists]-->1.   <!--[endif]-->file    [name]              检查文件或目录并报告它的类型

<!--[if !supportLists]-->2.   <!--[endif]-->find [path] [-list] [file]     

path目录下按照list对应得file内容查找文件

<!--[if !supportLists]-->3.   <!--[endif]-->cd                      进入目录

cd ../[dir]             进入上级目录下的dir目录

cd ~                        进入当前用户主目录

cd -                        回到最后一次进入的目录

<!--[if !supportLists]-->4.   <!--[endif]-->pwd                     显示当前路径

<!--[if !supportLists]-->5.   <!--[endif]-->ls                      列出目录内容

ls –a                  列出的内容包括隐藏文件

ls –R                  递归地列出每个子目录的内容

ls –F                  按列列出文件

ls –l                  显示文件,目录详细信息

ls –C                  输出时多列显示

<!--[if !supportLists]-->6.   <!--[endif]-->cat [filename]          filename文件的内容输出到屏幕

cat –n [filename]      给显示内容加上行号

<!--[if !supportLists]-->7.   <!--[endif]-->cp                      拷贝

cp [f1] [f2]                f1的内容拷贝到f2

cp [f1] [f2] [f3]…[dir]f1f2f3按相同文件名复制到dir目录中

cp –i [f1] [f2]            询问使用者是否覆盖

cp –r [dir1] [dir2]        dir1的内容全部复制到dir2

<!--[if !supportLists]-->8.   <!--[endif]-->mv                      文件改名或移动

mv [f1] [f2]                将文件f1改名为f2

mv [dir1] [dir2]            将文件夹dir1改名为dir2

mv [f1] [f2] [f3]…[dir]将文件f1f2f3移动到dir目录中

mv –i [f1] [f2]            询问使用者是否覆盖

mv –f [f1] [f2]            强迫移动,不提出警告信息

<!--[if !supportLists]-->9.   <!--[endif]-->rm [f1] [f2] [f3]…     删除指定文件

rm –f [f1]             删除时不提出警告信息

rm –i [f1]             询问是否删除

rm –r [dir]                递回式删除

<!--[if !supportLists]-->10.  <!--[endif]-->mkdir [dir1] [dir2]     创建文件目录

<!--[if !supportLists]-->11.  <!--[endif]-->chdir [dirname]         将当前目录移动到dirname

<!--[if !supportLists]-->12.  <!--[endif]-->rmdir [dir1] dir2]      删除空目录

<!--[if !supportLists]-->13.  <!--[endif]-->chmod [mode] [filename] 修改文件权限mode第一位为文件所有者权限,第二位为文

件组权限,第三位为一般用户权限

chmod –f [mode]            不理会失败动作

chmod –r [mode]            将所有子目录下所有档案改为mode模式

<!--[if !supportLists]-->14.  <!--[endif]-->tar                     存储和恢复文件

tar cvf [pack] [f1] [f2]f1f2的内容存储到pack文件中

    tar xvf [pack]          pack文件中的内容还原

处理指令

<!--[if !supportLists]-->1.   <!--[endif]-->bc                      运算器

bc –l                  可获取数学函数库

<!--[if !supportLists]-->2.   <!--[endif]-->banner [string]         打印字符

<!--[if !supportLists]-->3.   <!--[endif]-->ps                      显示目前进程或系统进程的状况

ps –e                  输出所有进程报告

ps –l                  显示一个长的输出报告,只是不包含STIME字段

ps –f                  在第一栏进程显示所有者的名字(不是UID

ps –a                  用来显示包括其他用户的进程情况

ps –u                  显示面向用户的进程

ps –x                  显示包括没有终端控制的进程

ps –w                  使用较宽的显示模式来显示进程状况

<!--[if !supportLists]-->4.   <!--[endif]-->kill                        杀进程

<!--[if !supportLists]-->5.   <!--[endif]-->kill [-signal] pid      signal给进程,signal值为031,其中9sigkill

用来杀掉一些无法正常结束的讯号

    kill –l                    查看可替代signal号码的数目字

<!--[if !supportLists]-->6.   <!--[endif]-->grep    [string] f1 f2      过滤器

grep –n [string] file  把所找到的行在行前加上行号列出

grep –v [string] file  把不包含string的行列出

<!--[if !supportLists]-->7.   <!--[endif]-->fgrep [string] –f f1 f2过滤器,在file1中存放要搜寻的字串

网络指令

<!--[if !supportLists]-->1.   <!--[endif]-->rlogin host [-l name]   远程登陆,host为主机名或ip,默认用户为本机当前用户;

若远程登陆用户与当前用户不同,用-l制定远程登陆用户

<!--[if !supportLists]-->2.   <!--[endif]-->rsh                     在远程机器上执行命令,结果传回本机器

rsh host [-l name] [com]不输入com则相当于rlogin

<!--[if !supportLists]-->3.   <!--[endif]-->telnet [name/ip] [port] 远程登陆   

<!--[if !supportLists]-->4.   <!--[endif]-->ftp [ip]                    文件传输

 

数据操作

<!--[if !supportLists]-->1.   <!--[endif]-->echo                        回显用户系统参数

echo –n                    显示完之后无跳行动作

<!--[if !supportLists]-->2.   <!--[endif]-->head                        将标准输入中的前10行(默认)内容输出到屏幕上

head –n [num] [file]   file文件中的前num行输出到屏幕上

head [-num] [file]      file文件中的前num行输出到屏幕上

<!--[if !supportLists]-->3.   <!--[endif]-->tail                        将标准输入中的后10行内容输出到屏幕上,参数同head

<!--[if !supportLists]-->4.   <!--[endif]-->more [filename]         分屏将filename文件的内容输出到屏幕,按q退出

more –n [filename]     给显示内容加上行号

<!--[if !supportLists]-->5.   <!--[endif]-->pg                      显示文件并按屏幕读取

pg [-number]                指定每个窗口显示的行数

pg [-p] [string]            将字符串的内容输出到屏幕上

<!--[if !supportLists]-->6.   <!--[endif]-->pr                      给文件分页

<!--[if !supportLists]-->7.   <!--[endif]-->awk                     在输入航上扫描模式并执行动作

<!--[if !supportLists]-->8.   <!--[endif]-->sed                     非交互式编辑文件

<!--[if !supportLists]-->9.   <!--[endif]-->sort                        按字母顺序排列并合并文件

<!--[if !supportLists]-->10.  <!--[endif]-->split                   将文件分为等长的部分

<!--[if !supportLists]-->11.  <!--[endif]-->tee                     将标准输入通过管道传到标准输出和指定文件中

<!--[if !supportLists]-->12.  <!--[endif]-->uniq                        打印每个输入行

<!--[if !supportLists]-->13.  <!--[endif]-->lp+

 

VI

<!--[if !supportLists]-->1.   <!--[endif]-->~                       大小写转换

<!--[if !supportLists]-->2.   <!--[endif]-->0                       到当前行行首

<!--[if !supportLists]-->3.   <!--[endif]-->$                       到当前行末尾

<!--[if !supportLists]-->4.   <!--[endif]-->a                       在光标所在位置后插入文本

<!--[if !supportLists]-->5.   <!--[endif]-->A                       在光标所在位置行的最后字符后加入文本

<!--[if !supportLists]-->6.   <!--[endif]-->w                       移动到下一个单词

<!--[if !supportLists]-->7.   <!--[endif]-->W                       将除空格外的所有字符看作一个字

<!--[if !supportLists]-->8.   <!--[endif]-->b                       移动到上一个单词

<!--[if !supportLists]-->9.   <!--[endif]-->i                       在光标所在位置前插入文本

<!--[if !supportLists]-->10.  <!--[endif]-->I                       在光标所在位置行的第一个字符前插入文本

<!--[if !supportLists]-->11.  <!--[endif]-->o                       在光标所在位置下一行插入文本

<!--[if !supportLists]-->12.  <!--[endif]-->O                       在光标所在位置上一航插入文本

<!--[if !supportLists]-->13.  <!--[endif]-->C                       删除光标到当前行末尾的内容并进入编辑状态

<!--[if !supportLists]-->14.  <!--[endif]-->cc                      删除光标所在行字符并进入文本编辑状态

<!--[if !supportLists]-->15.  <!--[endif]-->cw                      删除光标所在单词并进入文本编辑状态

<!--[if !supportLists]-->16.  <!--[endif]-->r                       新文本替代旧文本,一一替代

<!--[if !supportLists]-->17.  <!--[endif]-->R                       新文本替代旧文本,直到退出文本编辑状态

<!--[if !supportLists]-->18.  <!--[endif]-->x                       删除光标所在字符

<!--[if !supportLists]-->19.  <!--[endif]-->[n]x                        剪切n个字符

<!--[if !supportLists]-->20.  <!--[endif]-->dd                      删除光标所在行字符

<!--[if !supportLists]-->21.  <!--[endif]-->dw                      删除光标所在单词

<!--[if !supportLists]-->22.  <!--[endif]-->[n]yy                   复制光标所在行以下n

<!--[if !supportLists]-->23.  <!--[endif]-->yw                      复制光标所在单词

<!--[if !supportLists]-->24.  <!--[endif]-->D                       删除光标到当前行末尾的内容

<!--[if !supportLists]-->25.  <!--[endif]-->s                       删除光标所在字符并进入文本编辑状态

<!--[if !supportLists]-->26.  <!--[endif]-->[n]s                    替换n个字符

<!--[if !supportLists]-->27.  <!--[endif]-->S                       删除光标所在行字符并进入文本编辑状态

<!--[if !supportLists]-->28.  <!--[endif]-->G                       到文件末尾

<!--[if !supportLists]-->29.  <!--[endif]-->h                       左移光标

<!--[if !supportLists]-->30.  <!--[endif]-->j                       下移光标

<!--[if !supportLists]-->31.  <!--[endif]-->k                       上移光标

<!--[if !supportLists]-->32.  <!--[endif]-->l                       右移光标

<!--[if !supportLists]-->33.  <!--[endif]-->Ctrl+f                  向下滚动一屏

<!--[if !supportLists]-->34.  <!--[endif]-->Ctrl+b                  向上滚动一屏

<!--[if !supportLists]-->35.  <!--[endif]-->Ctrl+d                  向下滚动半屏

<!--[if !supportLists]-->36.  <!--[endif]-->Ctrl+u                  向上滚动半屏

<!--[if !supportLists]-->37.  <!--[endif]-->Ctrl+g                  显示当前文件名称,总行树,所在行数

<!--[if !supportLists]-->38.  <!--[endif]-->:set nu                 显示行号

<!--[if !supportLists]-->39.  <!--[endif]-->:set nonu               隐藏行号

<!--[if !supportLists]-->40.  <!--[endif]-->:[n]                        移动到文件的第n

<!--[if !supportLists]-->41.  <!--[endif]-->:g/[str1]/s//[str2]/g   将文件中的所有str1替换成str2

<!--[if !supportLists]-->42.  <!--[endif]-->mk                      块拷贝,定义块首

“ay’k                 块拷贝,定义块尾,根据寄存器不同可存贮多个块

“ap                        块粘贴

<!--[if !supportLists]-->43.  <!--[endif]-->mk                      块剪切,定义块首

“ad’k                 块剪切,定义块尾

<!--[if !supportLists]-->44.  <!--[endif]-->:w                      保存

<!--[if !supportLists]-->45.  <!--[endif]-->:e                      刷新

<!--[if !supportLists]-->46.  <!--[endif]-->:q                      退出

<!--[if !supportLists]-->47.  <!--[endif]-->Ctrl+z                  不存盘退出

<!--[if !supportLists]-->48.  <!--[endif]-->:e [filename]           编辑另一个文件

:e#                 返回前一文件

<!--[if !supportLists]-->49.  <!--[endif]-->[n]>                        标所在行以下n行右移一个制表符位置

<!--[if !supportLists]-->50.  <!--[endif]-->[n]<                        标所在行以下n行左移一个制表符位置

<!--[if !supportLists]-->51.  <!--[endif]-->%                       查找对应的括号

<!--[if !supportLists]-->52.  <!--[endif]-->{{

<!--[if !supportLists]-->53.  <!--[endif]-->}}

<!--[if !supportLists]-->54.  <!--[endif]-->.

1
11
分享到:
评论

相关推荐

    Shell和Vi编辑器

    linux实验,应用linux进行管理操作,对vi编辑器进行深入研究,实验。

    实验三 Shell和Vi编辑器

    关于shell和vi编程的书籍,这本资料可以帮我们很快的了解shell和vi的变成过程

    SHELL和vi编辑器.ppt

    SHELL和vi编辑器.ppt

    Linux实习三报告 VI编辑器及shell命令

    Linux实习三报告 VI编辑器及shell命令Linux实习三报告 VI编辑器及shell命令

    实验一shell实验报告

    3、使用vi编辑器编写一段Shell程序,取名为mycal,实现与Linux中cal命令类似的功能,当输入: $mycal [月份名] 年时,屏幕输出指定的年月的月历。例如: $mycal October 2009 屏幕输出2009年10月的月历。 注:参数...

    Unix第三章 vi使用与Shell编程

    对Unix系统的简单介绍,本章主要介绍 vi的使用与Shell编程。

    LINUX,UNIX,SHELL,AIX,VI,脚本

    很强悍的SHELL开发参考文档,LINUX,UNIX,SHELL,AIX,VI,脚本 LINUX,UNIX,SHELL,AIX,VI,脚本

    LinuxShell脚本学习基础视频

    资源名称:Linux Shell脚本学习基础视频资源目录:【】11a00d99b60c4e2eba3440b8aa3a6bdd【】linux_shell脚本编程_01认识shell,如何编写shell脚本和执行【】linux_shell脚本编程_02vivim简单的常用操作【】linux_...

    aix常用操作命令(vi,shell).doc

    aix常用操作命令(vi,shell),这个是公司内部培训的采用命令

    J-Linux&Shell-W7 Vi (上)

    J-Linux&Shell-W7 Vi (上) 一、判断题 插入模式不是vi的工作模式之一。( × ) vi命令模式中a是从光标所在位置后面开始新增内容。( √ ) vi命令模式中(是光标所在位置到该句子的第一个字母。( √ ) vi中不可以使用...

    Linux Shell编程实验

    Shell编程实验 一、实验目的 ...1、LINUX环境下常用命令和VI编辑器的操作。 2、了解Shell作用和主要分类等基础知识。 四、实验设备及工具 软件:PC机操作系统REDHAT ELAS4环境 五、实验原理及说明

    LINUX开发基础 系统使用 全屏编辑器VI SHELL 常用变量

    第三节 全屏幕编辑器与vi 第四节 Linux Shell 编程 全屏幕编辑器与vi 第四节 Linux Shell 编程 一、Shell程序的编写和执行 二、Shell的变量 三、Shell的测试命令 四、条件语句 五、循环语句 六、...

    J-Linux&Shell-W8 Vi (下)

    J-Linux&Shell-W8 Vi (下) 一、判断题 vi命令模式中yy命令的作用为复制当前行到内存缓冲区。( √ ) vi命令模式中D命令的作用为删除文件的最后一行。( × ) vi末行模式中:r 文件1 的写法的作用是读取文件1的内容并...

    vi命令及删除命令精典

    vi命令及删除命令精典,从shell中启动可视化编辑器 vi filename 指示shell启动vi编辑器,并将参数filename传给它。如果当前目前中存在该文件,则vi编辑器将它解释为要打开的文件;如果没有该文件,则vi编译器创建新...

    linux shell vim

    自己写的一个简单的ppt介绍shell和vim里面的一些东西

    实验三 vi及Shell程序设计.doc

    实验三 vi及Shell程序设计

    shell-and-vi-compile.rar_linux C语言 shell_linux compile命令_reach4m

    Linux下的常用shell命令,文本编辑器vi和C语言编译、调试工具gcc、gdb的使用心得。

    vi使用与Shell编程PPT教案学习.pptx

    vi使用与Shell编程PPT教案学习.pptx

    实验七 shell编程

    3 vi deit a file 4 mail read a mail 5 send send mail to someone 6 cal see your calendar 7 who see who is on the system 8 ls list the files in this directory 9 cat ...

    shell的一个IDE

    vi的一个插件,可以来写shell脚本。目前shell脚本编写一个是vi,一个是EMACS,后者太大我传不上来,前者是vi的一个插件,非常好用

Global site tag (gtag.js) - Google Analytics