RHCE笔记整理-RH033.Unit3--Filesystem

  1. Linux File Hierarchy Concepts

  2. Some Important  Directories

  • The home directory

    • /root  /home/username

  •  The bin directories

    • /bin,/user/bin,/usr/local/bin    常用执行文件

    • /sbin, /user/sbin, /usr/local/sbin    系统管理可执行文件

  • Foreign filesystem mountpoints

    • /mnt  amd /media

  1. 3.Other Important Directories

  • /etc --system config files

  • /tmp

  • /boot --kernel and bootloader

  • /dev --device

  • /usr --Programs

  • Lost+found --遗失的片段

  • /var --存放经常变动的文件,如:log,email

  • /srv --存放目前所有和server有关的服务

  • /proc --反应kernel的环境,是虚拟的目录,不占用任何磁盘空间

  • The lib directories

  • /lib,/usr/lib,/usr/local/lib

  1. Current Working Directory (CWD)

Usage: pwd

5. File and Directory Names (文件命名规则)

  • Less than 255 characters

  • all characters are valid,except the “/”,若用空格等特殊字符作为文件名,必须用引号把这个字符括起来

  • Names are case-sensitive(大小写是敏感的)例如:Mail,mail mAil,是不同的文件

6. Absolute Pathnames (绝对路径)

  • Begin with a slash(/)

  • Complete “road map” to file location
    //
    为文件位置作指向

  • Can be used anytime you wish to specify a file name

7. Relative Pathname

  • Don't begin with a slash(/)

  • specify location relative to your current working directory

  • Can be used as a thort way to specify a file

8. Change Directory

  • command: cd

9. Listing Directory Concents

  • 查看当前目录本身的属性:ls -ld

10. Copying Files and Directories

  • Usage:

cp [options] file destination

  • More than one files may be copied at a time if the destination is a directory

cp [options] file1 file2 destination

  • cp技巧:

cp -p file dest 保持文件拷贝前的时间

11. Linux Copying Files and Directories //linux中复制行为是怎么动作的

  • If destination exists and is a file ,the copy overwrite the destination file

  • If the destination is a directory,and is exists,the copy is placed there with the same name

  • If the destination doesn't exist,the copy is created with that name

14. Creating and Removing Files

  • rm -- remove files

  • Usage

rm [options] file

  • -i --interactive(确认信息)

  • -r --删除目录时必用选项

  • -f --force

  • Redhat 中,rm在普通用户下使用时,默认不带-i参数,在root用户下使用时,默认会带-i参数

  • touch create files

若所要建立的文件已在存在,则会改变文件的修改时间,不会改变其内容。 15. Creating and Removing Directory

  • mkdir --create directory

  • rmdir --remove an empty directory

  • rm -r --remove a directory

16. Using Nautilus

  • Gnome Graphical filesystem browser

  • Can run in “spatial” and “Browser” mode

  • Spatial --open directory in each window

  • Browser --open all directories in one window

18. Ceterming File Content

  • File can contain many types of data

  • syntax

file [options] filenames

20. Viewing Text Page by Page

  • syntax:

less [options] filename

  • Uage:

  • /text --search

  • n/N --next/previous match

  • v --open file in text editor

  • space -next page

  • b --previous page

  • Ctrl+d --next falf page

  • Ctrl+u --previous half page

  • g --to top of the file

  • G --to bottom of the file

  • /text --find text downward

  • ?text --find text forward

  • v --editor mode

  • q --quit

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值