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

网站建设技术风险分析合肥网站排名推广

网站建设技术风险分析,合肥网站排名推广,北京市住房和城乡建设网站,wordpress 文章评价插件Linux之文件和目录类命令详解(2) 1、mv-移动文件或重命名2、find-查找文件和目录3、locate-快速查找文件4、du-显示目录或文件的磁盘使用情况5、df-显示文件系统的磁盘空间使用情况6、chmod-更改文件或目录的权限7、chown-更改文件或目录的拥有者8、tree…

Linux之文件和目录类命令详解(2)

  • 1、mv-移动文件或重命名
  • 2、find-查找文件和目录
  • 3、locate-快速查找文件
  • 4、du-显示目录或文件的磁盘使用情况
  • 5、df-显示文件系统的磁盘空间使用情况
  • 6、chmod-更改文件或目录的权限
  • 7、chown-更改文件或目录的拥有者
  • 8、tree-以树状结构列出目录内容

1、mv-移动文件或重命名

1.1 基本用法:

##移动文件或目录,或者重命名文件。
mv source_file destination_file

1.2 常用选项:

-i:在目标文件已存在时提示确认
mv -i old_name new_name

1.3 实例

[root@test test]# ll
total 4
-rw-r--r-- 1 root root 8 Nov 10 18:41 a.txt
[root@test test]# mv a.txt b.txt
[root@test test]# ll
total 4
-rw-r--r-- 1 root root 8 Nov 10 18:41 b.txt##当前系统redhat7.9,执行mv默认带-i
[root@test test]# ll
total 8
-rw-r--r-- 1 root root 8 Nov 10 18:53 b.txt
-rw-r--r-- 1 root root 8 Nov 10 18:41 c.txt
[root@test test]# mv b.txt c.txt
mv: overwrite ‘c.txt’? n
[root@test test]# ll
total 8
-rw-r--r-- 1 root root 8 Nov 10 18:53 b.txt
-rw-r--r-- 1 root root 8 Nov 10 18:41 c.txt##若仅执行mv,则不会提示确认,直接更改
[root@test test]# \mv b.txt c.txt
[root@test test]# ll
total 4
-rw-r--r-- 1 root root 8 Nov 10 18:53 c.txt

2、find-查找文件和目录

2.1 基本用法

find /path/to/search -name filename

2.2 常用选项

-type f:仅查找文件-type d:仅查找目录-name pattern:根据文件名模式查找

2.3 实例

[root@test test]# find /root/test -type f -name "*.txt"
/root/test/c.txt
[root@test test]# find /root/ -type d -name "test"
/root/test

3、locate-快速查找文件

3.1 基本用法

locate filename

3.2 常用选项

-r:使用正则表达式实现精确匹配

3.3 实例

[root@test test]# locate c.txt
/root/test/c.txt
/usr/share/doc/alsa-lib-1.1.8/asoundrc.txt
/usr/share/doc/libreswan-3.25/opportunistic-v1.historic/opportunism-spec.txt
/usr/share/doc/python-kitchen-1.1.1/html/_sources/api-text-misc.txt
/usr/share/doc/qemu-kvm/qmp-spec.txt
/usr/share/doc/skkdic-20130104/edict_doc.txt
/usr/share/doc/vim-common-7.4.629/README_amisrc.txt
/usr/share/doc/vim-common-7.4.629/README_mac.txt
/usr/share/doc/vim-common-7.4.629/README_src.txt
/usr/share/vim/vim74/doc/arabic.txt.gz
/usr/share/vim/vim74/doc/os_mac.txt.gz
/usr/share/vim/vim74/doc/os_risc.txt.gz
/usr/share/vim/vim74/doc/pi_spec.txt.gz
/usr/share/vim/vim74/doc/usr_toc.txt.gz##使用正则表达式实现精确匹配
[root@test test]# locate -r '/c\.txt$'
/root/test/c.txt
[root@test test]#

4、du-显示目录或文件的磁盘使用情况

4.1 基本用法

du directory_name

4.2 常用选项

-h:以人类可读的格式显示(KB, MB, GB)
-s:显示总计而非每个文件的大小

4.3 实例

[root@test test]# ll
total 12
-rw-r--r-- 1 root root 8 Nov 10 19:10 a.txt
-rw-r--r-- 1 root root 8 Nov 10 19:10 b.txt
-rw-r--r-- 1 root root 8 Nov 10 18:53 c.txt
[root@test test]# du -h
12K     .
[root@test test]# du -h *
4.0K    a.txt
4.0K    b.txt
4.0K    c.txt
[root@test test]# du -s
12      .
[root@test test]# du -s *
4       a.txt
4       b.txt
4       c.txt
[root@test test]# du -sh
12K     .
[root@test test]# du -sh *
4.0K    a.txt
4.0K    b.txt
4.0K    c.txt

5、df-显示文件系统的磁盘空间使用情况

5.1 基本用法

df

5.2 常用选项

-h:以人类可读的格式显示

5.3 实例

[root@test test]# df -h
Filesystem             Size  Used Avail Use% Mounted on
devtmpfs               3.9G     0  3.9G   0% /dev
tmpfs                  3.9G     0  3.9G   0% /dev/shm
tmpfs                  3.9G   13M  3.9G   1% /run
tmpfs                  3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/rhel-root   26G  3.9G   23G  15% /
/dev/sda1             1014M  170M  845M  17% /boot
tmpfs                  797M   12K  797M   1% /run/user/42
tmpfs                  797M     0  797M   0% /run/user/0

6、chmod-更改文件或目录的权限

6.1 基本用法

chmod 755 filename

6.2 常用选项

+x:添加执行权限
-x:移除执行权限
r:读取权限
w:写入权限
x:执行权限

6.3 实例

[root@test test]# ll
total 4
-rw-r--r-- 1 root root 8 Nov 10 19:10 a.txt
[root@test test]# chmod u+x a.txt
[root@test test]# ll
total 4
-rwxr--r-- 1 root root 8 Nov 10 19:10 a.txt

7、chown-更改文件或目录的拥有者

7.1 基本用法

chown user:group filename

7.2 常用选项

-R:递归地更改目录及目录内所有文件的所有者和组

7.3 实例

[root@test test]# ll
total 4
-rwxr--r-- 1 root root 8 Nov 10 19:10 a.txt
[root@test test]# chown test:test a.txt
[root@test test]# ll
total 4
-rwxr--r-- 1 test test 8 Nov 10 19:10 a.txt##更改文件目录也一样,若果想更改文件目录及目录下所有文件的权限,可加-R参数
[root@test test]# chown -R test:test test/

8、tree-以树状结构列出目录内容

8.1 基本用法

##通常不是在某些Linux发行版中默认安装的,使用前需进行安装
tree /path/to/directory

8.2 实例

[root@test ~]# tree /root
/root
├── anaconda-ks.cfg
├── Desktop
├── Documents
├── Downloads
├── initial-setup-ks.cfg
├── Music
├── Pictures
├── Public
├── Templates
├── test
│   └── a.txt
└── Videos
http://www.yayakq.cn/news/618822/

相关文章:

  • 网站备案是先做网站上线还是app在线开发制作平台
  • 网站的做公司米绘设计师服务平台
  • 网站指向错误宣城市建设监督管理局网站
  • 保定做网站建设记事本做网站如何添加图片
  • 做网站购买空间多少钱变更网站做推广需要备案
  • 常熟外贸网站建设360推广开户
  • 网站平台怎么建立天津市住房与城乡建设部网站
  • 专题网站模板wordpress外链图片不显示
  • 北京住总第一开发建设有限公司网站首页2020 惠州seo服务
  • 微信的网站开发产品软文范例软文
  • ashx做网站短链生成
  • 做网站买什么品牌笔记本好海口网站建设加王道下拉
  • 计算机网络网站wordpress友链
  • 实验教学网站的建设研究wordpress 更换logo
  • 深圳品牌网站设计公司价格炫酷html5网站模板
  • 网站系统制作教程网络信用贷款哪个好
  • 免费响应式网站wordpress查询文章分类列表
  • 淮安企业网站网站后台文章字体
  • 泉州模板自助建站微信开发app
  • 设计网站公司名称医疗器械注册证查询
  • 网站建设有哪些作文网入口
  • 服务器网站跳转怎么做的建设公司网站的可行性研究
  • 网站设计师网站沈阳哪个医院人流好一点
  • 怎么做网站小图标北京网站备案号查询
  • 电商 做图 网站有哪些网站静态文件
  • 毕业设计代做哪个网站好网站建设与管理教学视频教程
  • ps 怎么做网站搜索框自适应企业建站企业
  • 门户网站怎么建设需要多长时间宜春的网站建设公司
  • 容桂电子商务网站建设个人网站psd
  • 广州汽车网站建设化工产品网站建设