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命令直接 ...
随机推荐
- 微信小程序 Echarts 异步数据更新
微信小程序 Echarts 异步数据更新的练习,被坑了很多次,特作记录. 作者:罗兵 地址:https://www.cnblogs.com/hhh5460/p/9989805.html 0.效果图 ...
- python 回溯法 子集树模板 系列 —— 14、最长公共子序列(LCS)
问题 输入 第1行:字符串A 第2行:字符串B (A,B的长度 <= 1000) 输出 输出最长的子序列,如果有多个,随意输出1个. 输入示例 belong cnblogs 输出示例 blog ...
- banner 跟随鼠标呈现视差效果
参考 Element 官网,利用 js / jq 和 css3, 实现某图片随着鼠标移动呈现的视差效果. <!DOCTYPE html> <html> <head> ...
- TDD 与 CI 在 Python 中的实践
社区化产品的长久生存之道可能莫过于对迭代周期的控制.还记得以前采用老土的阶段开发的年代,将软件生命周期分为各个阶段,当到达每个阶段的里程碑则集中所有的资源.人力作全面冲刺.每次到了里程碑的检查点冲过了 ...
- git笔记:通过给grunt-inline打tag看tag操作
晚上review了下grunt-inline的issues,看到有个兄弟pull request,修正了0.3.0版本的一个bug.于是就merge了下,然后发布了0.3.1版本(这里). npm p ...
- 【亲测有效】Nodepad++/Sublime Text3中Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level解决策略
我在开发游戏的时候,发现一个python脚本,本来都运行好好的,然后写了几行代码,而且也都确保每行都对齐了,但是运行的时候,却出现语法错误: IndentationError: unindent do ...
- VMware在Centos7上配置静态IP的方法
使用NAT模式 在这里记下192.168.161.2 进入系统,为系统自动分配一个ip 记录下 192.168.161.129 进入网络管理器配置文件目录 cd /etc/sysconfig/netw ...
- Haskell(一 )------ Windos下环境配置
1.去官网下载安装包 2.然后运行安装包路径最好就不要改了. 3.打开命令行输入 cabal user-config init 会出现默认的放置配置文件的地址,然后到那个文件夹下修改config文件. ...
- 电梯V1.0
电梯V1.0 GitHub仓库地址 Problem 一栋3层的大楼(楼层编号0-2),设有一台无限载重的电梯,初始时电梯停在0层.电梯移动1层的耗时为1,在某一层停靠的耗时为1(时间初始为0).电梯不 ...
- ElasticSearch 2 (17) - 深入搜索系列之部分匹配
ElasticSearch 2 (17) - 深入搜索系列之部分匹配 摘要 到目前为止,我们介绍的所有查询都是基于完整术语的,为了匹配,最小的单元为单个术语,我们只能查找反向索引中存在的术语. 但是, ...