复制: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. mfc 动态创建EDIT控件

    知识点: CWnd::Create CWnd::CreateEx Spy++工具 动态创建控件 一. CWnd::Create 参数 virtual BOOL Create( LPCTSTR lpsz ...

  2. .NetCore利用BlockingCollection实现简易消息队列

    前言 消息队列现今的应用场景越来越大,常用的有RabbmitMQ和KafKa. 我们用BlockingCollection来实现简单的消息队列. 实现消息队列 用Vs2017创建一个控制台应用程序.创 ...

  3. JavaScript快速入门-实战(例子)

    1.模拟bootstrap中的模态框 效果图:(点我后,弹出对话框,最下面的内容可以看到,但是有一定的透明度.) 思路分析: 整体分为三层,最底层(点我),中间透明层(实现透明效果),最顶层(最新内容 ...

  4. Redux系列02:一个炒鸡简单的react+redux例子

    前言 在<Redux系列01:从一个简单例子了解action.store.reducer>里面,我们已经对redux的核心概念做了必要的讲解.接下来,同样是通过一个简单的例子,来讲解如何将 ...

  5. centos 7 jenkins 部署

    安装jenkins 1.拉取库的配置到本地对应文件 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redha ...

  6. centos7 部署LNMP

    1.安装Nginx 使用Nginx官方提供的rpm包 [root@nginx ~]# cat /etc/yum.repos.d/nginx.repo [nginx] name=nginx repo b ...

  7. python3绝对路径,相对路径

    from __future__ import absolute_import的作用: 直观地看就是说”加入绝对引入这个新特性”.说到绝对引入,当然就会想到相对引入.那么什么是相对引入呢?比如说,你的包 ...

  8. git常用命令学习总结

    英语真是我的硬伤啊,提示都要用百度翻译看一遍,费劲... 下面是我日常工作中遇到的各种问题汇总 1.远程服务器分支与本地代码合并 我第一次打出 git pull 显示下面的错误 就怪我英语太差,都懒得 ...

  9. 汉码盘点机PDA无缝对接思迅思迅盘点机思迅条码数据采集器批号商品盘点的方法

    1.1.    盘点批号 如果某些商品进行了批号管理,我们不仅仅要清点什么商品总数有多少个,我们还要区分该商品的某个批号有多少个数量,因此以前批号盘点工作量是非常大的. 我们的盘点机PDA支持批号盘点 ...

  10. (Alpha)Let's-展示博客

    Let's Alpha 项目答辩 ·选题由来     手机端——用户相对较多,使用环境限制相对宽松     手机游戏?校园p2p应用?线下交流!(滴滴打水?)     模式的选择:发起——加入活动   ...