Marco Note 08_01~~~08_04

Source: Internet
Author: User

Facl:

Filessystem Access Control List

Use file extensions to save additional access control permissions.

jerry:rw-

Set Facl

-M: Set

U:uid:perm

G:gid:perm

-X: Cancel

U:uid

G:gid


Get Facl (Cancel)



The file attributes end with the "+" sign, which is the extended property of the file. If you copy or archive such a file, the additional properties of the new file will be discarded unless you use a special command.

Terminal type:

Console: Consoles

Pty: Physical Terminal (VGA)

TTY: Virtual terminal (VGA)

TTYs: Serial Terminal

pts/#: Pseudo-terminal (terminal formed under pseudo-file system)

Sleep

Last: Displays the/var/log/wtmp file. Displays user login history and system restart history.

-N #: Displays information about recent # times:

Lastb,var/log/btmp file that displays user error login attempts.

-N #:lastlog Displays the last successful logon information for each user:

-U USERNAME: Displays the most recent login information for a specific user.

BaseName

$: Script path and name for script execution

Random: Generates a stochastic number,

echo $RANDOM

Hostname: Displays the primary current machine name


Random number generator:

/dev/random

/dev/urandom





08_02

Case USAGE:

#!/bin/bash

#


Case $ in

' Start ')

echo "Start server ...";;

' Stop ')

echo "Stop server ...";;

' Restart ')

echo "Restart server ...";;

*)

echo "' basename $ ' {start|stop|restart|status}";;

Esac


Command:

./service.sh Start

Example two:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Let the script show the details:

#!/bin/bash

#

Debug=0

Case $ in

-v|--verbose

Debug=1;;

Esac

[$DEBUG-eq 1] && echo ' Hello. '

08_03

Disk and file explanation

MBR: Not part of the operating system

Low-level formatting

Partition File System

MBR: Master boot Record (512byte)

Master Boot Record

Main Boot Record

446bytes:bootloader, program

64bytes:

16bytes: Identifies a partition (maximum of 4 primary partitions)

2byte:

Last two: Magic number

Mark MBR is valid

Hard links:/backup/a/m.txt/backup/b/n.txt directly to the different paths of the same inode, which can be called a link.

---->1, can only be created on files and cannot be applied to a directory.

2, can not cross the file system;

3. Creating a hard link increases the number of times a file is linked

Symbolic Link: (soft link)--small link is the quickest way.

To create a connection command:

ln

Example:

Ln/tmp/abc/tmp/abc2

Ls-i (show inode number)

2981891 ABC

2982891 ABC2

Df-p on same line, no line break

08_04

/dev

Main device number (major numbers)

Identifies the device type.

This device number (minor numbers)

Identifies a different device in the same type.

Mknod (Create a device file (block or character file))

Pipeline files, FIFO files.

The device file name of the hard disk device.

IDE, ATA, HD

Sata:sd

Scsi:sd

Usb:sd

A, B, c ... To differentiate different devices under the same type.

IDE: First IDE port: Master, slave

Dev/hda/dev/hdb

Second IDE port: Master, slave

Dev/hdc/dev/hdd

Hda

HDA1: First primary partition

HDA2:

Hda3:

HDA4:

HDA5: First logical partition.

Check that the current system recognizes several hard drives:

fdisk-l [/dev/to/some_device_file]

Vfs:virtual Filesystem.

In Linux, all file systems are eventually converted to VFS

To manage disk partitions:

Fdisk:/DEV/SDA

P:

N: Create new partition->p: Main zone->e: Extended partition.

D: Delete a partition

W: Save exit

Q: Do not save exit

T: Modify the partition type

L

L: Displays all supported types.


Marco Note 08_01~~~08_04

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.