| 分类: ~~~ Solaris ~~~ |
一、vi命令详解
vi file1.txt
-i insert //插入
-h move the cursor left
//向左移一个字符
-l move cursor right //右移
-j move cursor down //下移
-k move cursor
up
//上移
-x delete a letter covered by the cursor
//删除
-r replace a letter with
another //覆盖
-a append text
//追加
-dd delete the whole line //删除整行
:q //退出不存储
:wq //退出并存储
:wq! //退出并强制存储
:w file1.txt
:w file2.txt
:help
二、emacs命令详解
emacs file1.txt
F10
显示菜单
f
打开File menu
s
保存
ctrl-h and t
显示emacs在线帮助系统
ctrl-x and ctrl-f 查询
ctrl-x and ctrl-s 保存
ctrl-x and
2
水平平分观察面板
ctrl-x and
3
垂直平分面板
ctrl-x and
1
还原面板
ctrl-x and
o
移动光标到下一面板
ctrl-x and
k
关闭面板
三、ls命令详解
ls -al 显示目录中所有内容
ls -al a.?pg 问号代表任意一字符
ls -al a.*pg *代表任意字符
ls -al a.[lmn]pg
可代表lmn中任意一个字符
ls -al a.[j-l]pg
代表从j到l中的任意一个字符
mkdir *bc*
如果同时有abc.jpg或abcd.jpg这样的文件存在,在输入cd
*bc*时,会无法进入目录
cd '*bc' 即可进入*bc*目录
四、find、locate、grep命令详解
find . -name '*.jpg'
find / -name '*.jpg'
locate '*.jpg'
//相比find命令不含permission denied的文件
locate '*.jpg'|more
locate '*.jpg'>graphicslist
grep jpg file1.txt | more
grep import *
显示本目录下所有包含import字样的文件,含详细内容
grep -l import
* 显示本目录下所有包含import字样的文件,但只显示文件名
grep -i import *
显示所有import字样的文件详细内容,忽略大小写
locate '*.jpg'|grep rotate
cp $(locate '*.cpp') cpps/
复制所有以.cpp结尾的文件到cpps目录中
五、jobs命令
ctrl-z 挂起个任务
jobs 显示当前所有任务
fg %2 把2号任务推到前台
bg %2 挂起2号任务
kill %2 结束2号任务
java TestRecursive &
把testrecursive推到后台执行

加载中…