复制: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上常用的基本命令的更多相关文章

  1. linux系统常用的基本命令分类

    linux系统常用的基本命令分类: 文件命令:vim vimdiff diff mkdir touch rm mv cp ln cd ls more less head tail cat grep e ...

  2. Linux上常用软件安装和总结

    Linux总结: 以前只顾着撸码,Linux这些一般都是运维玩的,然后也没怎么折腾过,每次上线也都只是发布下,最多也就是启停服务器.最近闲来无事就玩了玩Linux,还挺好的. 这里做一个总结来结束Li ...

  3. linux最常用的基本命令

    //**********************对应linux centos常用命令 **************************/// 安装centos6.6带有gnome桌面 ctrl+c ...

  4. Linux上常用命令整理(一)—— cat

    近几个月刚从windows上转过来,开始慢慢熟悉linux,先不撕比到底哪个更好,首先要怀着相互借鉴的精神去了解各个平台. Linux上做开发,除去使用文本编辑器做开发的大神之外,大家(包括我这种菜鸟 ...

  5. 大数据学习——Linux上常用软件安装

    4.1 Linux系统软件安装方式 Linux上的软件安装有以下几种常见方式: 1.二进制发布包 软件已经针对具体平台编译打包发布,只要解压,修改配置即可 2.RPM发布包 软件已经按照redhat的 ...

  6. Linux上常用插件的一些命令

    Linux上关于jdk tomcat MySQL dubbo等的一些启动,结束,查看状态的命名. 1.tomcat 运行tomcat cd bin/ 进入tomcat 的bin 文件夹,直接运行: . ...

  7. hadoop,spark,linux上常用命令

    记下常用命令,慢慢补充 1.hadoop 查看hdfs上的目录: hadoop fs -ls /给hdfs上目录授予权限:   hadoop fs -chmod 777 /tmp/hive 在hdfs ...

  8. Linux上常用的文件传输方式以及比较

    tp ftp 命令使用文件传输协议(File Transfer Protocol, FTP)在本地主机和远程主机之间或者在两个远程主机之间进行文件传输. FTP 协议允许数据在不同文件系统的主机之间传 ...

  9. Linux上常用命令整理(二)—— paste

    上一篇整理了cat指令的几个基本常见用法,这次整理一下paste指令的基本用法. cat paste cut grep paste paste可以简单的理解为把两个文件的内容按列合并,与cat命令直接 ...

随机推荐

  1. WPF编程,窗口保持上次关闭时的大小与位置。

    原文:WPF编程,窗口保持上次关闭时的大小与位置. 版权声明:我不生产代码,我只是代码的搬运工. https://blog.csdn.net/qq_43307934/article/details/8 ...

  2. matplotlib 雷达图2

    说明 搞了一个最新版本的雷达图,比以前那个美观. 不多说,代码奉上: 完整代码 ''' matplotlib雷达图 ''' import numpy as np import matplotlib.p ...

  3. HTML基础语法

    目录 HTML基础语法 1.全局架构标签 2.标题 3.段落 4.文本 5.属性 6.链接 7.图片 8.列表 9.表格 10.区块 11.布局 12.表单 13.框架 14.头部 HTML基础语法 ...

  4. 如何解决markdown中图片上传的问题

    1.第一种方式(图床) 1.1 google中的插件-新浪微博图床 2.第二种方式,操作流程如下 2.1 下载一个有道云笔记客户端 2.2 然后把图片通过有道云笔记分享出来,见下动态图 3.总结一下 ...

  5. JavaWeb项目学习教程(1) 准备阶段

    写在最前面 为什么要写一个这样的教程?作为一个软件工程专业的学生,上课老师讲得飞快,几乎都是在课后自己消化,我知道学习记录的重要性.我自己本身还有很多很多基础的东西都没有学会,比较博客园的人有很大的差 ...

  6. PTA (Advanced Level) 1002 A+B for Polynomials

    1002 A+B for Polynomials This time, you are supposed to find A+B where A and B are two polynomials. ...

  7. 区块链Hyperledger Fabric 学习记录(一)开发环境搭建(ubuntu16.04/ubuntu18.04)

    目录 Fabric开发环境搭建 更新说明 教程环境及软件版本 Docker 安装Docker 配置用户组 配置Aliyun Docker加速器 安装docker-compose Go 下载源码 安装源 ...

  8. C++ 多态Polymorphism 介绍+动态绑定、静态绑定

    什么是多态? 多态(polymorphism)一词最初来源于希腊语polumorphos,含义是一种物质的多种形态. 在专业术语中,多态是一种运行时绑定机制(run-time binding) ,通过 ...

  9. Scrum Meeting NO.2

    Scrum Meeting No.2 1.会议内容 今天,我们对已经确定的任务进行了分配,并针对界面设计方面的细节进行讨论. 由于这周其它课程任务繁重(编译+数据库).前端的任务主要分配给编程能力较好 ...

  10. MyEclipse同时配置多个tomcat

    步骤: 1.可以把原有tomcat复制一份,或者下载新的tomcat,如果有必要的话,修改/conf/service.xml文件中tomcat的端口号,避免端口同时暂用出现错误 2.请看一下图片:打开 ...