linux常用命令
来源:互联网 发布:linux 修改host 编辑:程序博客网 时间:2024/06/01 14:37
[root@localhost root]
第一个root表示当前用户,localhost表示主机,第二个root表示当前目录。
登出(注销)命令
logout
远程登录
rlogin ip
eg.rlogin 192.168.4.3
显示文件
Ls 显示文件列表
Ls -l 显示文件详细信息
Ls –a 显示隐藏文件
Ls –l | less 翻页显示
切换目录
Cd .. 到上一级
显示当前目录
Pwd
创建目录
Mkdir 目录名
删除空目录
rmdir 目录名
删除包含文件的目录
rmdir –r 目录名
新建文件
touch 文件名
eg. touch test.txt
复制文件
cp 旧文件 新文件
eg. cp /root/test.txt /root/newtest.txt
删除文件
rm 文件名
连接文件或显示文件内容
cat
1)显示文件(more:分屏显示)
cat test.txt | more
2)将一个文件添加到另外一个文件末尾
cat test1.txt >> test.txt
即test.txt文件的末尾添加了test1.txt的内容。
3)合并文件
cat test1.txt test.txt >> test2.txt
将test1.txt 与 test.txt内容合并后形成test2.txt.
移动或更改文件目录名称
mv
1)mv test.txt ..
将test.txt移动到上一层目录
2)mv test.txt test3.txt
将test.txt 重命名为test3.txt.
3)mv test ..
将test目录移动到上一层
查找指令
whereis:速度快,但是有类型限制。源程序、二进制程序文件、使用手册等。
find :速度没有whereis 快,但是没有类型限制。
grep:一般用来过滤先前的结果,避免显示过多的结果。
eg.
find –name test1.txt –print
查找文件并打印路径
显示文件类型
file * 显示当前目录下所有文件的类型(文件或目录等)
重导
“>” 输出文件,覆盖掉原先的内容。
“>>”输出到文件,追加到原文件的末尾。
eg. ls > test.txt
将当前目录下的文件列表存入test.txt文件。
文件系统的加载
mount
文件的编辑 vi
i 转换为插入模式
压缩和解压缩
Zip/unzip , Gzip/gunzip
- 【linux 常用命令】常用命令整理
- linux常用命令
- Linux常用命令
- LINUX 常用命令
- linux常用命令
- Linux 常用命令
- Linux 常用命令
- Linux常用命令
- LINUX常用命令
- Linux 常用命令
- linux常用命令
- Linux常用命令
- Linux常用命令
- Linux 常用命令
- Linux常用命令
- Linux 常用命令
- Linux 常用命令!
- Linux 常用命令
- zend公司的产品线介绍
- 说说Android上的断点续传下载 (转)
- linux 关机
- package requirements (gudev-1.0) were not met
- linux系统结构及文件目录结构
- linux常用命令
- DirectX 9 游戏汉化详解
- 怎么设计出一个好的网站
- 给网页设计前端开发人员的建议
- 删除文件中的注释文件
- ORACLE执行计划的一些基本概念
- DOM方式动态加载数据
- poj 1318(Word Amalgamation)
- HDOJ Color the ball (线段树方法)