Linux Learning Note 20130315

Source: Internet
Author: User

Yesterday and girlfriend broke up, really no mood to write, but anyway, life is going forward, today also continue to learn.

Today is still the basic operation of the command.

1, the File command, the role is to view the type of files, the use of a very simple document AAA can, can see the path, or binary or other information with file * Can see the current path of all the types of files, using file to view the type of binary executable, you can view the execution platform

2, view the contents of the file command cat AA, there are other such as less, more, in fact, do not remember, fairies first remember and one on the line.

3, file merging, simple merge with command cat+ redirect Character >>,cat original function is to print the contents of the file to the screen, plus redirection can control the flow of characters to complete the Paste function, note >> You can glue the new file to the end of the old file, > The original file content will be overwritten directly.

4, delete files Anyway is not for others to see, when the textbook, so no tube format what, in said Delete command, say a bit more Linux operating system file operation understanding, first is the operation path, after the path plus a/And not add is an effect, plus only can represent the current operation of the file is a path. The command to delete the file was also introduced before the RM usage, the following main record under the move and rename operation, the command is MV, explained that, under Linux, the file full name is the path of the file plus the filename, so the file for the move operation and rename operation modified the file full name, This effect in the Linux file system is the same, so move and rename these two functions can be completed with a command, using MV a B, where a is the source file, B is the target file, if a B in the same folder, then the final result is a rename to B, if a, a, a different folder, Then move the operation

5, the file Copy command CP, the use of CP a B, the source file a copy to the target file B, if you want to copy a in this path again, then you must enter the name of B, if b in other paths, then you can not enter the name, the default copy of the previous file is also called a, can also use other names, If b already exists in another folder, the content of a will overwrite the contents of B directly.

6, the following is today's study focus, the establishment of file links, there are some concepts let me have a preliminary understanding of the Linux file system, first review the command LS, using ls-l can see the details of the file, including a file of the number of hard links, in the second, The following is a file of hard links and soft connections, the file system to the file is so agreed to manage, the first layer is a variety of file names, and then each file name in the file system in a directory called the area of a inode_num, a node number, In another area inode_table has a physical block corresponding to each num, equivalent to a level two index that corresponds to a specific physical address, then the hard link means that some files in the upper layer correspond to the same inode node, Then these hard links can be regarded as a fixed memory of the different portals, so hard link is not much memory, and arbitrarily modify the contents of a hard link, the content in the underlying address will be modified, the upper layer of the other hard links are also modified, the soft connection is equivalent to the application of a pointer to the original memory , equivalent to a shortcut, without the contents of the original file, access to the soft connection will automatically jump to the source file there, the soft connection is required to occupy additional memory, and because it is also a file, it will produce a new node corresponding to it.

Note that the directory can only have soft connections and cannot have hard links. Create a method

ln AA BB Creates a hard-link bb,ln-s aa bb for the file AA, creating a soft-connect BB for AA,

7, change the file access Properties command chmod each file has three sets of access properties, respectively, the owner, group, and other users, in the character manipulation command these three types of support, respectively, using the U g O to represent the executable operation of the file with rwx, with a minus sign to increase or decrease a certain type of operation, such as Ch MoD o-x AA, the consciousness is the file AA, the other user's executable attribute is removed, chmod g+w aa, meaning to put the action of the group in the file Plus "write" This operation, if you want to add the same command for three kinds of users, you can use a instead of U g O, writing chmod a+x AA , which means to add an executable attribute to all three users of AA.

Just write it down here today.

Linux Learning Note 20130315

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.