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命令直接 ...
随机推荐
- python 23 种 设计模式
频率 所属类型 模式名称 模式 简单定义 5 创建型 Singleton 单件 保证一个类只有一个实例,并提供一个访问它的全局访问点. 4 创建型 Abstract Factory 抽象工厂 提供一个 ...
- Linux 学习日记 2 (常用命令 + deb包的安装)
常用命令:以下是一些比较常用的命令,主要是关于安装软件的一些命令 @_@ cd ~/下载(文件名)/ //进入这个文件夹 , ~指的是根目录 cd .. //返回上一级文件夹 sudo apt-get ...
- Java 多线程(二)之 Thread 优先级
目录 Thread 中线程优先级相关属性 相关函数 优先级初始化 设置优先级 获取优先级 默认优先级 指定优先级 注意事项 优先级继承 @ Thread 中线程优先级相关属性 每个线程均有优先级,在 ...
- Linux部署DotNetCore记录
一.背景 最近半年或最近三个月来,公司在计划大刀阔斧的规划重构新的产品.按目前的计划和宣传还是很令人期待的.前端预计应用现在很流行的前端框架,有Vue.ElementUI等,后端宣传了很多微服务.持续 ...
- node基础:文件系统-文件读取
node的文件读取主要分为同步读取.异步读取,常用API有fs.readFile.fs.readFileSync.还有诸如更底层的fs.read,以及数据流(stream),后面再总结下咯~ 直接上简 ...
- Python初学者随笔Week1
Python从入门到放弃 本文主要是描述的是作为初学者对python学习的过程与经历分享,包括一些历程的分享与重要的时间节点记录,对于python学习的笔记与心得. 如果你也是初学者,我们可以一起学习 ...
- [T-ARA][결혼 하지마][不要结婚]
歌词来源:http://music.163.com/#/song?id=27808773 作曲 : 二段横踢 [作曲 : 二段横踢] 作词 : 二段横踢 [作词 : 二段横踢] Hey anybody ...
- mac osx 初次使用PHP环境搭建
非常简单,一共2个步骤: Step1: 启动Apache mac osx 系统默认安装Apache服务. 首先打开terminal,输入: sudo apachectl start 如果需要输入密码, ...
- 【读书笔记】Linux内核设计与实现(第五章)
5.1 内核通信 系统调用在用户空间和硬件设备之间添加了一个中间层. 该层主要作用: 1.为用户空间提供了一种硬件的抽象接口. 2.保证了系统的稳定和安全. 3.每个进程都运行在虚拟系统中. 在Lin ...
- “数学口袋精灵”App的第一个Sprint计划
一.现状 我们这个团队想制作一个关于运算的游戏类型手机软件,针对我们这个学期的Android软件开发的课程,制作出一个关于数学算术游戏软件. 二.任务认领 第一阶段先把静态网页制作出来,各自的任务: ...