Linux上常用的基本命令
复制:copy
[keysystem@localhost happydzy]$ cp file1 file2
[keysystem@localhost happydzy]$ ll
total
-rw-rw-r--. keysystem keysystem Dec : file1
-rw-rw-r--. keysystem keysystem Dec : file2
[keysystem@localhost happydzy]$
移动:move
[keysystem@localhost happydzy]$ mv file1 ..
[keysystem@localhost happydzy]$ mv file2 dir/
[keysystem@localhost happydzy]$
重命名:rename
[keysystem@localhost happydzy]$ mv file1 file2 #将file1重命名为file2
[keysystem@localhost happydzy]$ mv dir1 dir2 #dir2存在,则为移动操作
移除:remove
[keysystem@localhost happydzy]$ rm file1 #移除file1文件
[keysystem@localhost happydzy]$ rm -r dir #移除dir目录
创建文件:touch 和 >
[keysystem@localhost happydzy]$ touch a.txt #创建a.txt文件
[keysystem@localhost happydzy]$ >b.txt #创建b.txt文件
[keysystem@localhost happydzy]$ ll
total
-rw-rw-r--. keysystem keysystem Dec : a.txt
-rw-rw-r--. keysystem keysystem Dec : b.txt
[keysystem@localhost happydzy]$
创建目录:mkdir
[keysystem@localhost happydzy]$ mkdir dir
[keysystem@localhost happydzy]$ ll
total
drwxrwxr-x. keysystem keysystem Dec : dir
[keysystem@localhost happydzy]$
查看文件:cat
[keysystem@localhost happydzy]$ cat a.txt
hello world
[keysystem@localhost happydzy]$
查看文件类型:file
[keysystem@localhost happydzy]$ file a.txt
a.txt: ASCII text
[keysystem@localhost happydzy]$
[keysystem@localhost happydzy]$ file index.html
index.html: HTML document text
[keysystem@localhost happydzy]$
通配符:* 可以匹配0个或多个
[keysystem@localhost happydzy]$ ls a*
a.txt
[keysystem@localhost happydzy]$
zip包的解压缩指令:unzip
[keysystem@localhost happydzy]$ unzip master.zip
Archive: master.zip
ac4da107fb56c46956d86fc10c7bbe2bb1423a4d
creating: happygrep-master/
extracting: happygrep-master/.gitignore
inflating: happygrep-master/Makefile
inflating: happygrep-master/Makefile.macosx
inflating: happygrep-master/README.md
creating: happygrep-master/contrib/
inflating: happygrep-master/contrib/happygrep.sh
inflating: happygrep-master/contrib/wiki
inflating: happygrep-master/happygrep.c
[keysystem@localhost happydzy]$
zip包的压缩指令:zip
[keysystem@localhost happydzy]$ zip -r happygrep-master.zip happygrep-master/
adding: happygrep-master/ (stored %)
adding: happygrep-master/Makefile.macosx (deflated %)
adding: happygrep-master/Makefile (deflated %)
adding: happygrep-master/contrib/ (stored %)
adding: happygrep-master/contrib/happygrep.sh (deflated %)
adding: happygrep-master/contrib/wiki (deflated %)
adding: happygrep-master/README.md (deflated %)
adding: happygrep-master/.gitignore (stored %)
adding: happygrep-master/happygrep.c (deflated %)
[keysystem@localhost happydzy]$ ll -rlt
total
drwxrwxr-x. keysystem keysystem Sep happygrep-master
-rw-rw-r--. keysystem keysystem Jan index.html
drwxrwxr-x. keysystem keysystem Dec : dir
-rw-rw-r--. keysystem keysystem Dec : a.txt
-rw-rw-r--. keysystem keysystem Dec : happygrep-master.zip
[keysystem@localhost happydzy]$
tar.gz包的解压缩指令:tar zxvf xxx.tar.gz
[keysystem@localhost happydzy]$
[keysystem@localhost happydzy]$ tar zxvf wget-1.11..tar.gz
wget-1.11./
wget-1.11./mkinstalldirs
......
[keysystem@localhost happydzy]$
[keysystem@localhost happydzy]$
[keysystem@localhost happydzy]$ ll -rlt
total
drwxr-xr-x. keysystem keysystem Apr wget-1.11.
-rw-rw-r--. keysystem keysystem Apr wget-1.11..tar.gz
-rw-rw-r--. keysystem keysystem Dec : wget-1.11..tar.bz2
tar.gz包的压缩指令:tar zcvf xxx.tar.gz xxx/
[keysystem@localhost happydzy]$ tar zcvf wget-1.11..tar.gz wget-1.11./
tar.bz2包的解压缩指令:tar jxvf xxx.tar.bz2
[keysystem@localhost happydzy]$ tar jxvf wget-1.11..tar.bz2
tar.bz2包的压缩指令:tar jcvf xxx.tar.bz2
[keysystem@localhost happydzy]$ tar jcvf wget-1.11..tar.bz2 wget-1.11./
Linux上常用的基本命令的更多相关文章
- linux系统常用的基本命令分类
linux系统常用的基本命令分类: 文件命令:vim vimdiff diff mkdir touch rm mv cp ln cd ls more less head tail cat grep e ...
- Linux上常用软件安装和总结
Linux总结: 以前只顾着撸码,Linux这些一般都是运维玩的,然后也没怎么折腾过,每次上线也都只是发布下,最多也就是启停服务器.最近闲来无事就玩了玩Linux,还挺好的. 这里做一个总结来结束Li ...
- linux最常用的基本命令
//**********************对应linux centos常用命令 **************************/// 安装centos6.6带有gnome桌面 ctrl+c ...
- Linux上常用命令整理(一)—— cat
近几个月刚从windows上转过来,开始慢慢熟悉linux,先不撕比到底哪个更好,首先要怀着相互借鉴的精神去了解各个平台. Linux上做开发,除去使用文本编辑器做开发的大神之外,大家(包括我这种菜鸟 ...
- 大数据学习——Linux上常用软件安装
4.1 Linux系统软件安装方式 Linux上的软件安装有以下几种常见方式: 1.二进制发布包 软件已经针对具体平台编译打包发布,只要解压,修改配置即可 2.RPM发布包 软件已经按照redhat的 ...
- Linux上常用插件的一些命令
Linux上关于jdk tomcat MySQL dubbo等的一些启动,结束,查看状态的命名. 1.tomcat 运行tomcat cd bin/ 进入tomcat 的bin 文件夹,直接运行: . ...
- hadoop,spark,linux上常用命令
记下常用命令,慢慢补充 1.hadoop 查看hdfs上的目录: hadoop fs -ls /给hdfs上目录授予权限: hadoop fs -chmod 777 /tmp/hive 在hdfs ...
- Linux上常用的文件传输方式以及比较
tp ftp 命令使用文件传输协议(File Transfer Protocol, FTP)在本地主机和远程主机之间或者在两个远程主机之间进行文件传输. FTP 协议允许数据在不同文件系统的主机之间传 ...
- Linux上常用命令整理(二)—— paste
上一篇整理了cat指令的几个基本常见用法,这次整理一下paste指令的基本用法. cat paste cut grep paste paste可以简单的理解为把两个文件的内容按列合并,与cat命令直接 ...
随机推荐
- CF891C Envy
题面 题解 首先要知道两个性质: 对于任意权值,最小生成树上该权值的边数是相同的. 对于任意一个最小生成树,当加完所有权值小于一个任意值的边之后,当前图的连通性是一样的. 于是我们按照权值分开处理,对 ...
- linux下如何解除被占用的端口号
在本例中,假设8080端口被占用. 1.查看8080端口是否被占用: netstat -anp | grep 8080输出结果:tcp 0 0 :::8080 ...
- 用C语言操作MySQL数据库,进行连接、插入、修改、删除等操作
C/C++ code ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3 ...
- Jmeter(二十二)_脚本上传Gitlab
Docker部署接口自动化持续集成环境第四步,代码上传到远程仓库! 接上文:Ubuntu部署jmeter与ant Gitlab在容器中部署好了之后,本地直接打开.我们可以在里面创建项目,上传脚本. 新 ...
- 浅谈我的UI设计之路
时光匆匆,进入UI学习已经快两个月了,这段时间过得很充实,因为有压力才有收获. 还记的刚刚学习手绘的时候,对于这个行业只有一个初步的认识,知道自己喜欢,但是真正学习的时候才发现,我要学习的东西还有很多 ...
- 【独家】K8S漏洞报告|近期bug fix解读&1.11主要bug fix汇总
内容提要: 1. 高危漏洞CVE-2018-1002105深度解读 2. 11/19--12/11 bug fix汇总分析 3. 1.11重要bug fix解读 4. 1.9重要bug fix解读 在 ...
- Kubernetes调用vSphere vSAN做持久化存储
参考 1.vSphere Storage for Kubernetes 2.IBM vSphere Cloud Provider 3.GitHub vSphere Volume examples 一. ...
- Backbone.js源码浅介
终于看到一个只有一千多行的js框架了,于是抱着一定可以看懂他的逻辑的心态,查看了他的整个源码,进去之后才发现看明白怎么用容易,看懂怎么写的就难了,于是乎有了这篇博客的标题:浅介,只能粗浅的介绍下Bac ...
- 记初学net-SNMP
自从弄完那个jsp的网盘(其实还是个烂摊子),这几天一直在研究snmp. 有需求就激发动力,对,人都是被逼出来的.五一这几天,天天搁这坐着,毫无头绪. 下面切入正题. 要做一个监控园区网在线数的平台, ...
- A02-java学习-classpath配置-标识符-java变量类型
学习 1, classpath的配置和使用 2, java的标识符命名规则和命名规范 3, 字符编码 4, java的变量类型 5, 程序的入口main方法解释