Learn Linux lesson two with Amin Linux file and directory management

Source: Internet
Author: User
Tags aliases parent directory

2.1 System directory Structure

/root/.ssh/authorized_keys

<man tree> View Instructions

<yum install-y tree > Install tree command

<tree-l 2> Displays the table of contents in tree form, showing two levels

Linux Common directory structure

/bin to store frequently used commands

The core file that is used when/boot starts

/dev external device files-mouse, keyboard, etc.

/ etc System configuration file

/Home User House Directory

/lib/lib64 dynamic Link Shared library,

/media Automatic identification of device files-such as CD-ROM, USB drive

/MNT file system temporarily mounted by user

/opt Empty

/prot process

/root Root's home directory

Temporary files for the/run process

/sbin

Files generated by the/SRV service

/sys system kernel-related files

/tmp System temp File

/USR user application file and program storage directory

/var generated logs log

D: Blue indicates directory

Green indicates an executable file

Red indicates compressed files

L: Light blue indicates linked file

Grey means other files

Flashing red indicates a problem with the linked file

B: Yellow is the device file, including block, Char, FIFO.

-: White Documents: General documents, such as text files, configuration files, source files, etc.

Grey : Indicates other files

c : Yellow String Device mouse keyboard

S: pink: Picture file or socket file

P: Pipeline File


2.3 Instructions

ls command

Syntax--LS (option) (parameter)

Options--

-A: Displays all files and directories (ls default file name or directory name is ".") As hidden, not listed);

-A: Displays the Save Shadow file "." and ".." List of all files except;

-C: Multi-column display output results. This is the default option;

-L: In contrast to the "-C" option, all output information is output in a single-column format and not output as multiple columns;

-F: Append the type identifier of the file after each output item, meaning: "*" means a normal file with executable permissions, "/" for the Directory, "@" for the symbolic Link, "|" Represents a command pipeline FIFO, and "=" represents a sockets socket. When the file is a normal file, do not output any identifiers;

-B: Outputs the non-output characters in the file with the backslash "" and the character encoding;

-C: When in use with the "-lt" option, the output directory content is sorted according to the file status time, sorted by the CTime field in the index node of the file. When in conjunction with the "-l" option, the ordered sentence is the time of the file's state change;

-D: Displays only the directory name, not the list of contents under the directory. Displays the symbolic link file itself without displaying the list of directories it points to;

-F: The effect of this parameter is the same as specifying the "AU" parameter, and the effect of the "LST" parameter is turned off;

-I: Displays the file index node number (inode). An index node represents a file;--file-type: The function is the same as the "-f" option, but does not display "*";

-K: Displays the file size in kilobytes (Kbytes);

-L: Displays the list of contents in a long format in the directory. The output information includes file name, file type, permission mode, number of hard connections, owner, group, file size, and last modification time of file, etc. from left to right .

-M: The name of each file and directory separated by the "," area;

-N: Replace its name with user identification code and group identifier;

-R: The list of directory contents is sorted and output in reverse order of file name;

-S: Displays the size of files and directories, in chunks;

-T: Sorts the file and directory change times;

-L: If you encounter a file or directory with a symbolic link, directly list the original file or directory that the link points to;

-R: Recursive processing, all files and subdirectories under the specified directory are processed together;

--full-time: Lists the full date and time;

--color[=when]: Use different colors to highlight different types of.

< ls-l >==<ll >

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

A total of seven columns of information are displayed, from left to right: permissions, number of files, attribution user, attribution group, file size, creation date, file name

Number of files 3: There are several subdirectories below

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= " Https://s3.51cto.com/wyfs02/M01/9D/EF/wKioL1mJFQXz4bDFAABsgVa92_Y646.png-wh_500x0-wm_3-wmp_4-s_3014996440.png " Title= "8.png" alt= "Wkiol1mjfqxz4bdfaabsgva92_y646.png-wh_50"/>

----------------------------------------------------------------------------------

<which ls > View aliases

Alias indicates an option with aliases

< alias aming= ' Ls-lha ' > up an alias

< Unalias aming > alias cancellation

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

<pwd > View the directory that is currently in

<CD lib> into the catalogue

<CD, skip back to previous catalog

<CD >=<cd ~> Home Directory

<CD. > Back to Parent directory

----------------------------------------------------------------------------------------------

mkdir instructions to create a directory

<mkdir-p/tmp/aminglinux/1/2> Create a list of directories

<mkdir-pv/tmp/aminglinux/1/2> visualize Creating a list of directories

Rmkdir instructions to remove a directory

<rmdir/tmp/aminglinux/1/2> Delete directory--if no files are in the 2 directory

<rmdir-pv/tmp/aminglinux/1/2> visualize Deleting a list of directories

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= " Https://s2.51cto.com/wyfs02/M02/9D/EF/wKiom1mJFRqSykQGAAAtGWmH8tY475.png-wh_500x0-wm_3-wmp_4-s_2475317307.png " Title= "9.png" alt= "Wkiom1mjfrqsykqgaaatgwmh8ty475.png-wh_50"/>

/tmp not removed-because it is not empty

----------------------------------------------------------------------------------------------

Touch Create File

<touch/tmp/aminglinux/1/2/1.txt> Create a file

<!tree > Run the last tree command, same as other instructions

RM directives delete files, including directories

<rm-f/tmp/aminglinux/1/2/1.txt> forcibly deleting a file can also be used to delete a directory

<rm-r-f/tmp/aminglinux/1> forcibly Deleting a directory


This article is from "Malt's Sky" blog, be sure to keep this source http://iammalt.blog.51cto.com/12054231/1954344

Learn Linux lesson two with Amin Linux file and 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.