当前位置: 首页 > news >正文

网站建设作业云南网络公司网站建设

网站建设作业,云南网络公司网站建设,企业法治建设工作计划,养生网站模板下载#x1f4a5;1、Linux基本指令 1.1 mv 指令 mv指令是move的缩写#xff0c;用来移动或重命名文件、目录#xff0c;经常用来备份文件或目录。 mv old_name new_name#xff1a; 重命名文件或目录mv file /path/to/directory#xff1a; 移动文件到指定目录 roothcss-ecs…1、Linux基本指令 1.1 mv 指令 mv指令是move的缩写用来移动或重命名文件、目录经常用来备份文件或目录。 mv old_name new_name 重命名文件或目录mv file /path/to/directory 移动文件到指定目录 roothcss-ecs-8f13:~/112# ls -l total 8 drwxr-xr-x 2 root root 4096 Sep 16 20:13 dir -rw-r--r-- 1 root root 78 Sep 16 20:04 test.c roothcss-ecs-8f13:~/112# mv test.c name.c roothcss-ecs-8f13:~/112# mv dir mydir roothcss-ecs-8f13:~/112# ls -l total 8 drwxr-xr-x 2 root root 4096 Sep 16 20:13 mydir -rw-r--r-- 1 root root 78 Sep 16 20:04 name.c roothcss-ecs-8f13:~/112# mv name.c ../ roothcss-ecs-8f13:~/112# ls -l ../ total 12 drwxr-xr-x 3 root root 4096 Sep 16 20:16 112 -rw-r--r-- 1 root root 78 Sep 16 20:04 name.c drwx------ 3 root root 4096 Sep 16 11:32 snap roothcss-ecs-8f13:~/112# ls -l total 4 drwxr-xr-x 2 root root 4096 Sep 16 20:13 mydir roothcss-ecs-8f13:~/112# mv mydir ../ roothcss-ecs-8f13:~/112# ls -l ../ total 16 drwxr-xr-x 2 root root 4096 Sep 16 20:16 112 drwxr-xr-x 2 root root 4096 Sep 16 20:13 mydir -rw-r--r-- 1 root root 78 Sep 16 20:04 name.c drwx------ 3 root root 4096 Sep 16 11:32 snap roothcss-ecs-8f13:~/112# ls -l total 0 roothcss-ecs-8f13:~/112# 1.2 cat 指令 语法 cat [选项] [文件] 功能 读取文件内容并将其输出到标准输出设备通常是终端或屏幕 常用选项 -b 对非空行输出行编号-n 对输出的所有行编号-s 不输出多行空行 roothcss-ecs-8f13:~/112# pwd /root/112 roothcss-ecs-8f13:~/112# touch test.c roothcss-ecs-8f13:~/112# ls test.c roothcss-ecs-8f13:~/112# nano test.c roothcss-ecs-8f13:~/112# cat test.c #include stdio.hint main() {printf(hello world\n);return 0; } roothcss-ecs-8f13:~/112# cat -b test.c1 #include stdio.h2 int main()3 {4 printf(hello world\n);5 return 0;6 } roothcss-ecs-8f13:~/112# cat -n test.c1 #include stdio.h2 3 int main()4 {5 printf(hello world\n);6 return 0;7 } roothcss-ecs-8f13:~/112# cat -s test.c #include stdio.hint main() {printf(hello world\n);return 0; } roothcss-ecs-8f13:~/112# cat会把文件中的所有内容显示出来因此cat不适合看大文本适合看小文本。 如果cat后什么都不跟则通常情况下我们从键盘输入什么屏幕上就输出什么。 roothcss-ecs-8f13:~/112# cat hello world hello world Are you ok? Are you ok?tac指令 功能和cat相反逆序打印文件内容。 roothcss-ecs-8f13:~/112# ls mydir name.c roothcss-ecs-8f13:~/112# tac name.c }return 0;printf(hello world\n); { int main()#include stdio.h roothcss-ecs-8f13:~/112# 1.3 echo 指令 功能 echo 文本 在终端命令行界面上输出文本echo 文本文件如果文件不存在则新建 将文本写入到文件中 roothcss-ecs-8f13:~/112# ls -l total 4 drwxr-xr-x 2 root root 4096 Sep 16 20:13 mydir roothcss-ecs-8f13:~/112# echo hello world hello world roothcss-ecs-8f13:~/112# echo hello worldtest.txt roothcss-ecs-8f13:~/112# ll total 16 drwxr-xr-x 3 root root 4096 Sep 16 20:41 ./ drwx------ 7 root root 4096 Sep 16 20:23 ../ drwxr-xr-x 2 root root 4096 Sep 16 20:13 mydir/ -rw-r--r-- 1 root root 12 Sep 16 20:41 test.txt roothcss-ecs-8f13:~/112# cat test.txt hello world roothcss-ecs-8f13:~/112# 1.4 重定向 Linux下一切皆文件Linux下显示器、键盘、网卡、普通文件等都可以看作文件只不过显示器只有写方法向显示器打印其实就是向显示器文件写入无法从显示器读取数据。键盘只有读方法。而普通文件具有读写两个功能。 echo指令默认把后面跟的文本写入显示器文件中。cat指令后面如果没有跟任何文件则默认从键盘文件中读取数据然后写入到显示器文件中。 上面我们用echo 文本输出重定向文件将文本写入到文件中如果文件不存在则新建。 roothcss-ecs-8f13:~/112# ll total 12 drwxr-xr-x 3 root root 4096 Sep 16 22:47 ./ drwx------ 7 root root 4096 Sep 16 20:23 ../ drwxr-xr-x 2 root root 4096 Sep 16 21:57 dir/ roothcss-ecs-8f13:~/112# echo hello worldtest.txt roothcss-ecs-8f13:~/112# cat test.txt hello world roothcss-ecs-8f13:~/112# echo Are you ok? test.txt roothcss-ecs-8f13:~/112# cat test.txt Are you ok? roothcss-ecs-8f13:~/112# echo aa test.txt roothcss-ecs-8f13:~/112# cat test.txt aa roothcss-ecs-8f13:~/112# 通过测试我们还可以得出如果指定的文件里面有内容则会先清空原内容然后再写入并不是覆盖。 当文件不存在时文件名可以新建空文件当文件存在时文件名可以清空文件内容 roothcss-ecs-8f13:~/112# ll total 12 drwxr-xr-x 3 root root 4096 Sep 16 22:58 ./ drwx------ 7 root root 4096 Sep 16 20:23 ../ drwxr-xr-x 2 root root 4096 Sep 16 21:57 dir/ roothcss-ecs-8f13:~/112# test.txt roothcss-ecs-8f13:~/112# ll total 12 drwxr-xr-x 3 root root 4096 Sep 16 22:58 ./ drwx------ 7 root root 4096 Sep 16 20:23 ../ drwxr-xr-x 2 root root 4096 Sep 16 21:57 dir/ -rw-r--r-- 1 root root 0 Sep 16 22:58 test.txt roothcss-ecs-8f13:~/112# echo Are you ok? test.txt roothcss-ecs-8f13:~/112# ll total 16 drwxr-xr-x 3 root root 4096 Sep 16 22:58 ./ drwx------ 7 root root 4096 Sep 16 20:23 ../ drwxr-xr-x 2 root root 4096 Sep 16 21:57 dir/ -rw-r--r-- 1 root root 12 Sep 16 22:59 test.txt roothcss-ecs-8f13:~/112# cat test.txt Are you ok? roothcss-ecs-8f13:~/112# test.txt roothcss-ecs-8f13:~/112# ll total 12 drwxr-xr-x 3 root root 4096 Sep 16 22:58 ./ drwx------ 7 root root 4096 Sep 16 20:23 ../ drwxr-xr-x 2 root root 4096 Sep 16 21:57 dir/ -rw-r--r-- 1 root root 0 Sep 16 22:59 test.txt roothcss-ecs-8f13:~/112# cat test.txt roothcss-ecs-8f13:~/112# 用指定文件写入内容会把原内容删除掉如果我们就不想删除原始内容将新内容追加到原始内容后可以用追加重定向实现。 roothcss-ecs-8f13:~/112# cat test.txt roothcss-ecs-8f13:~/112# echo Are you ok? test.txt roothcss-ecs-8f13:~/112# cat test.txt Are you ok? roothcss-ecs-8f13:~/112# echo Hello test.txt roothcss-ecs-8f13:~/112# cat test.txt Are you ok? Hello roothcss-ecs-8f13:~/112# 除了和进行输出还有输入重定向符号。前面我们说了如果cat后面什么都不跟则默认从键盘上取数据。所以如果我们用输入重定向符号指定文件则会输出文件中的内容。 roothcss-ecs-8f13:~/112# cat test.txt Are you ok? Hello roothcss-ecs-8f13:~/112# cat test.txt Are you ok? Hello roothcss-ecs-8f13:~/112#
http://www.hkea.cn/news/14452861/

相关文章:

  • 创一个网站怎样赚钱网站模板能自己做吗
  • 如何在vps上搭建网站如何将图片生成链接
  • seo网站推广简历网站html5自适应
  • 建设网站需要哪些流程iis7 伪静态 wordpress
  • 皮卡剧网站怎样做东莞寮步
  • 专业的设计网站有哪些内容网站建设广告有哪些平台
  • 中国交通建设监理协会网站制作图片的软件免费
  • 义乌高端网站设计品牌有设计师做的装修效果图的网站
  • 选择seo网站排名优化宁波专业的网站建设
  • 教你学做窗帘的网站林西网站建设优化
  • 建设400官方网站win7 iis网站无法显示
  • 自己做的电影网站犯法吗广州网站推广费用
  • 怎么说服客户做网站logo设计免费平台
  • 石家庄网站建设公司怎么样常州seo收费
  • 域名的时间长短与网站权重关系建设部执业资格注册中心网站查询
  • 自己做店招的网站网站APP注册做任务
  • 域名 空间 网站制作个人如何注册网址
  • 路由器电脑可以做网站主机网页设计与制作的岗位职责
  • 苏州网站排名方案免费商城网站建设平台
  • 株洲网站建设兼职网站推广seo系统
  • 大学生课程设计网站万网如何做网站
  • 深圳做网站便宜网络推广运营团队
  • 荣成市信用建设网站网站采用什么方法建设
  • 免费家装设计网站科技公司名字
  • 建设厅网站沙场限期通知书行政事业单位网站建设
  • 新万网站建设平面设计网站灵感
  • 网站建设公司 - 百度wordpress重新发布
  • 网站建设百度小程序荆门网站建设公司
  • 智能建站网站广东住房和建设局网站官网
  • 打字赚钱一单一结appseo关键词怎么选