linux study notes three

Permissions and file

Competence

Linux system is divided into the owner's permissions, user groups and others three categories.

Each category has r read, write, and W x execute three permission, permission for each number 1, 2, 4

Directory and file permissions Description

Package content r w x
file detailed data Read the contents of the file Modify the contents of the file Execute the file contents
table of Contents file name Read the file name Modify the file name The directory access rights

Modify Permissions command

chgrp 修改文件组
chown 修改所有者
chmod 修改文件权限

chmod 777 /demo

754 指的是:所有者权限 1 + 2 + 4 用户组权限 1 + 0 + 4 其他人权限 0 + 0 + 4

File and directory commands

ls 列出文件
mkdir 创建目录
rmdir 删除空目录
cd 切换目录
pwd 显示当前目录
touch 创建文件
more/head/tail 显示文件内容
rm 删除文件或者文件夹
cp 复制文件
mv 移动文件
file 观察文件
whereis 查找文件
tree 目录树

Mount Disk

Step 1. Partition

lsblk / blkid output disk device information
fdisk / gdisk MBR partition using fdisk, GPT partition uses gdisk

Step 2. Disk Format

mkfs formatted disk, formatted using e.g. mkfs.xfs, mkfs.ext4 command to the file system, etc.

Step 3. Mount Disk

Mount point for the directory, you must first create a mount directory, and then use the mount command device information obtained in accordance with Step 1 to mount

View Directory Usage

df 查看文件系统的整体使用情况
du 查看文件系统的磁盘使用量(常用在查看目录所在磁盘情况)

Guess you like

Origin www.cnblogs.com/SLchuck/p/11420525.html