Linux File Directory Management

Source: Internet
Author: User
Tags aliases parent directory system log

System directory Structure

    1. To make it easier to view the system directory structure, use the tree command:

Installation commands

Yum install-y Tree

Help

Tree--help

Man help command to use

Mans Tree

Tree Usage Example: viewing the root directory under level two

Tree-l 2/

    1. Root folder detailed

    • Linux Common Commands store folders:/bin/,/sbin/,/usr/bin/,/usr/sbin/

Note: The/sbin/directory can only be used by the root account, and the normal account will use/bin/

    • System startup directory: /boot/

    • Device Files directory: /dev/

    • Configuration file directory: /etc/

    • Normal User home directory:/home/

    • Root User home directory:/root/

    • System Library Files directory:/lib/,/lib64/

View a command using those libraries for example: "/bin/ls"

Ldd/bin/ls

    • Media Catalog:/media/

    • Temporary mount directory:/mnt/

    • Empty directory:/opt/

    • System startup Process directory:/proc/

Each process PID has a separate file in this directory

    • File directory generated by the process:/run/

    • File directory generated by the service:/srv/

    • System kernel related files directory:/sys/

    • System temp directory:/tmp/

Note: Anyone can operate but only their own data

    • User Files directory:/usr/

    • Multiple Storage System log:/var/

    1. ls command

Ls=list

-L Detailed information = = LL

File type, permissions, location, several files exist the same inode, owner, owning group, size, creation time, file name

-I. Inode number

-a show contains hidden directories

-T time, flashback by time

-D only look at the directory itself, not the files listed under Folders

-H automatically displays the most appropriate size units

    1. File type

-   Normal file (can be cat open)

Catalog D

C String Device (mouse, keyboard)

L Soft Link

B-Block devices (discs, disks)

s in-machine communication

    1. Alias command

command: which ll

Function: Query specific command alias details

command: alias

Function: Display all system aliases

command: alias pan= ' Ls-lha '

Role: Custom pan aliases are used instead of Ls-lha

To cancel an alias: Unalias

Note: The custom alias path must be $PATH exist in;

    1. Relative path and absolute path

Absolute Path : The absolute path is the real path on the hard disk of the file or directory on your home page, (URL and physical path) such as:

C:xyz Est.txt represents the absolute path to the Test.txt file. The http://www.sun.com/index.htm also represents a URL absolute path.

relative Path : The path relative to a base directory. Contains the relative path to the web (relative to the directory in HTML)

For example:

In a servlet, "/" represents a directory of Web apps. and the relative representation of the physical path. For example: "./" represents the current directory, ". /"represents the parent directory. This similar representation also belongs to the relative path.

command: pwd

Function: Displays the directory where the current user is located

    1. cd command (change Directory)

    • -   go to your last directory

    • Go to the current user home directory

    • ~ Go to User's home directory

    • .. Parent Directory

    1. MKDIR and RMDIR

Command: mkdir

Options:

-P If the top-level directory to be set up is not currently established, the upper-level directory will be created

-V Visualization

Command: RmDir

Options:

-P deletes the specified directory if the upper-level directory of the directory has become an empty directory.

Note: Cascading deletions can only be deleted by the empty directory

    1. RM command

    • R recursive processing, processing all files under the specified directory with subdirectories

    • F force removal of files or directories

    • I ask for deletion every time you delete

History: View Historical commands


This article is from "a small dream of egg yolk" blog, please be sure to keep this source http://yolks.blog.51cto.com/10857562/1932542

Linux File Directory Management

Related Article

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.