Linux 20180409 file Directory Management

Source: Internet
Author: User
Tags aliases system log

2.1 System directory structure (up and down)

2.3 ls Command

2.4 File types

2.5 alias Command


System directory Structure


Ls-list


All users in the system have their own home directory, such as now logged in is the root user, log in is in the root home directory, you can see the previously created public key file is also here.

However, if another user uses the key to log in, it is necessary to create a Authorized_keys file in the user's home directory to hold the public key.


For example, create a new user bill, with which you will also have a folder for new users under Home

/home/bill

/USER (Root/bill)/.ssh/authorized_keys This is a fixed public key file and path if you want to modify this path, you need to/etc/ssh/sshd_config this configuration file to change


The tree displays the table of contents in the form of trees


Introduction to the most commonly used catalogs

Bin-> Usr/bin soft links, a bit like a shortcut will say

Bin/sbin/usr/bin usr/sbin inside are commonly used commands such as Tree Man VI mkdir and so on because of the environment variables can be directly used directly through the command


What is the difference between/bin//sbin/?

/sbin/is usually the root user command, ordinary users can not use, ordinary users use/bin/under the sbin/----s is super mean




Boot system startup-related files

Single-user mode is entered in the grub changed parameters, How can protection not be mistakenly deleted?



Dev is a device-related file

Hard disk, mouse, keyboard, CD, XXX is the device file




ETC is the path where the system configuration file resides. For example, previously edited NIC configuration information, ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ENS33

and a etc/ssh/ssh_config.


Home is the user's home directory



LIB/LIB64 is the path to the system library file, many commands depend on the library file, and the library file is similar to the. dll file under Windows

Use the command LDD command to view which library files under the command-dependent bin




Media directory is a medium directory, usually an empty directory by default


MNT Mount Directory


Proc is a system-initiated process that will have a PID and a directory at the same time. See for a moment.


Run is a temporary file that is generated by some processes and disappears once the shutdown occurs.


The SRV directory holds some files generated by some services


SYS directory will hold some system kernel-related files


TMP is the system temp directory, the permissions are very high, but different users will have their own directory


The USR directory is where some of the user's files are placed, and some of the commands used by the system's users

Some services are usually placed under usr/local and feel a bit like the program files under Windows D



Var/log is the storage log.

Var/log/messages is the system log

Var/run/will also put some system process pid

The cache will also be placed inside




Common options for the LS command

Ls-l listing the details of a file

Permissions how many files use the same inode owner to which the group file size (in bytes) creates a time file name

The next ls-i is to view the inode, the so-called Inode is the name of the information

If two files use the same inode, it means that the database location where the files are stored is unique and identical. is the equivalent of a different name, a different path, the same thing.

h Option is human humanized display

a option is to view all files, including hidden files

-d,–directory Displays the directory as a file, rather than displaying the file below it. See that means/root this directory is occupied by three (3 directories)

You can see the following three/actually. Represents the current directory/.ssh/: Indicates that the previous level of the directory is root, so the same root directory is used

As can be seen from the following figure, the root directory has three directories, that is, these three directories are using the root directory


The T option is sorted by time

LL = Ls-l

Overall

Option-l-i-t-a-h-D


File type (see)

The first bit of ls-l represents the file type D is the directory-indicates that the file C represents a string device L represents a soft link file (shortcut, point to a file) B refers to a block device, such as a disc, the disk Cat command cannot view the binary file


S is a socket file, used for native communication, transmits data, signals, etc. The pink one represents the socket file.


4



which can see aliases, some have aliases or not.

View all aliases Commands

Alias


echo $PATH environment variables are the paths to those commands.


You can customize the command by using the alias

Cancel can be used Unalias

Linux 20180409 file Directory Management

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.