linux - basic operation
来源:互联网 发布:淘宝网铁通固话充值 编辑:程序博客网 时间:2024/06/09 12:17
---note start---
cookbookonline: --> http://linux.vbird.org/ PS.吐血推荐!
catalog :
1.目录相关操作命令(cd, pwd, mkdir, rmdir)
--> http://linux.vbird.org/linux_basic/0220filemanager.php#dir_opdir
2.文件夹目录管理命令
2.1查看文件、文件夹列表信息: ls --> http://linux.vbird.org/linux_basic/0220filemanager.php#ls
PS. 别名的设置alias,unalias --> http://linux.vbird.org/linux_basic/0320bash.php#alias
BTW, alias允许使用更加简短的名称来重新定义 Linux 中的 Shell 命令,从而简化命令行的输入。使用 alias 不仅会节省时间,而且也能提高效率,实在是高手菜鸟,必备命令。
BTW again, you can use 'll' instead of 'ls-l' in adeptra's linux server
2.2复制、删除与移动: cp, rm, mv --> http://linux.vbird.org/linux_basic/0220filemanager.php#cprmmv
2.3查阅文件内容:
cat --> http://linux.vbird.org/linux_basic/0220filemanager.php#cat
less --> http://linux.vbird.org/linux_basic/0220filemanager.php#less
tail --> http://linux.vbird.org/linux_basic/0220filemanager.php#tail
PS. tail命令能够观察文本文件的末端或跟踪文本文件的增长.
BTW, 例如用来看日志:
範例二:持續偵測/var/log/messages的內容
[root@www ~]# tail -f /var/log/messages
<==要等到輸入[crtl]-c之後才會離開tail這個指令的偵測!
3.文件(夹)权限的修改
chmod --> http://linux.vbird.org/linux_basic/0210filepermission.php#chmod
4.打包、压缩相关命令
打包tar--> http://linux.vbird.org/linux_basic/0240tarcompress.php#tar
压缩gzip--> http://linux.vbird.org/linux_basic/0240tarcompress.php#gzip
压缩bzip2--> http://linux.vbird.org/linux_basic/0240tarcompress.php#bzip2
PS. 很多人还是对概念比较模糊,补充说明下
*.Z compress 程式壓縮的檔案;
*.gz gzip 程式壓縮的檔案;
*.bz2 bzip2 程式壓縮的檔案;
*.tar tar 程式打包的資料,並沒有壓縮過;
*.tar.gz tar 程式打包的檔案,其中並且經過 gzip 的壓縮
*.tar.bz2 tar 程式打包的檔案,其中並且經過 bzip2 的壓縮
Linux上常見的壓縮指令就是 gzip 與 bzip2 ,至於 compress 已經退流行了。
若說 gzip 是為了取代 compress 並提供更好的壓縮比而成立的,那麼 bzip2 則是為了取代 gzip 並提供更佳的壓縮比而來的。
不過,單純的 tar 功能僅是『打包』而已,亦即是將很多檔案集結成為一個檔案, 事實上,他並沒有提供壓縮的功能。
BTW, in my opinion: bzip2 > gzip >compress. here '>' means better than.
5.管道pipe, 命令中用符合'|'表示 -->http://linux.vbird.org/linux_basic/0320bash.php#pipe
6. 过滤信息grep --> http://linux.vbird.org/linux_basic/0320bash.php#grep
7.VI
7.1VI的三种模式 --> http://linux.vbird.org/linux_basic/0310vi.php#vi
PS. 复习下,一般模式,编辑模式,命令模式
7.2VI必杀键 --> http://linux.vbird.org/linux_basic/0310vi.php#vi_command
PS.下面列出按键使用较为频繁,推荐熟练掌握
a.一般模式常用按键
移动光标
上:k nk:向上移动n行
下:j nj:向下移动n行
左:h nh:向左移动n列
右:l nl:向右移动n列
首行:gg
末行:G
第几行:nG PS.n为数字,你要到达的行数
行首:^
行末:$
搜索
/word --> 向下搜索关键字'word'
?word --> 向上搜索关键字'word'
n --> 向下的next匹配
N --> 向上的next匹配
删除
x,X --> x 为向后删除一个字符(相当于[DEL]),X为先前删除一个字符(相当于[Backspace])
dd --> 删除光标所在整行
b.编辑模式常用按键
i --> insert,在所在光标前插入
a --> append,在所在光标后插入
c.命令模式常用按键
:w --> 保存
:w! --> 当文件是只读时,强制保存
:q --> 退出vi
:q! --> 当文件已被修改,又不想保存,强制退出
:wq --> 保存,然后退出
:e! --> 放弃修改文件内容,重新载入该文件编辑
: set nu --> 显示行号
: set nonu -- > 隐藏行号
---note end---
- linux - basic operation
- linux : libpcap basic operation
- vim basic operation
- binary tree(basic operation)
- Basic Switch Operation 阅读笔记
- VSTO - Named Range Control Basic Operation
- the basic operation of sequence in python
- Realm for android Basic configuration and operation
- linux select operation
- Linux user operation
- svn operation on linux
- Linux services operation list
- jdbc basic operation,how to insert a long raw data
- 【MongoDB】The basic operation of Mongodb, Insert\Query\Delete\Update
- 【MongoDB】The basic operation of Index in MongoDB
- 【MongoDB】The basic operation of Index in MongoDB
- Windows Store Apps note001 about image basic operation
- [Linux][Common command] zip operation
- XAMPP在Ubuntu下详细的安装与启动步骤
- 简介Oracle的9个_name
- MTK直接操作缓存方法
- Linux磁盘配额的设置与检测
- 扩展GridView控件索引-增加多个常用功能
- linux - basic operation
- ASP.NET实现数字和字符相混合的验证码
- 绝对正确!!教你如何配置ogre1.7.2+vs2010
- ORA-24324 & ORA-01041
- Android 下载一个文件以及打开这个apk文件
- [源码、文档、分享] 【连云助手的防火墙挂断模式空号,停机,关机是怎么实现的】
- 如何在ksh中重复执行上一个命令
- rz/sz安装
- 在C#程序中实现插件架构