Basics of getting Started with Linux

Source: Internet
Author: User
Tags bz2 create directory

  • Basics of getting Started with Linux
    • Linux birth
    • Linux Release Notes
    • Linux official website
    • Linux Kernel official website
    • A more famous Linux distribution
    • Virtual machine (VM), a virtual system, system installed in the system
    • Linux differs from windows
    • Getting Started with Linux basic commands
    • Getting Started with Windows command line (search cmd lookup)
    • Cygwin installation and use
    • The Linux environment complements
    • User groups
        • Owner
        • The group where the files are
        • Other groups
    • Folder Permissions
    • Change folder permissions

Linux Birth

    1. The Linux operating system was born on October 5, 1991 (This is the first time the official outward announcement).
    2. There are many different Linux versions of Linux, but they all use the Linux kernel.
    3. Linux can be installed in a variety of computer hardware devices, such as mobile phones, tablets, routers, video game consoles, desktops, mainframes, and supercomputers.

Linux Release Notes

    1. The Linux distribution says that the simple point is to pack the Linux kernel with the application software.
    2. The more well-known distributions are: Ubuntu, RedHat, CentOS, Debain, Fedora, SuSE, OpenSUSE, Turbolinux, Bluepoint, Redflag, Xterm, Slackware, etc.

Linux official website

    1. Ubuntu and CentOS are used more
    2. Debian in the domestic use of relatively few, in foreign countries in Europe and the United States market share is relatively large
    3. Fedora is very mature and the teacher is using this.
    4. Source of other versions:
      1. Part of it is evolving from one built-in operating system to another.
      2. The other part is for special purposes, for example: Kali is a release that has been developed specifically for security, with many network security tools, many hacking tools, and a dedicated operating system
    5. CentOS and Red hat have a very large share of the server market
    6. Ubuntu, Debian, Fedora have a larger share of desktop systems

Linux Kernel official website

    • There is only one kernel in the world, and this kernel is maintained by Linux himself.
    • There are a lot of programmers who are contributing the source code for this kernel, but the kernel's dominant maintainer is Linux himself.

A more famous Linux distribution

    1. centos , maintained by the community, Three image downloads available:
      1. dvd ISO contains the graphical interface of the operating system
      2. everything ISO in addition to the graphical interface, including all of his own maintenance of the software
      3. minimal ISO does not provide a graphical interface, generally the mini version of iOS installed on the server, with a graphical interface instead of reducing the server's operational performance
    2. redhat
      1. download more trouble on the official website
    3. ubuntu, very popular in China, also provides a Chinese version of the Linux Ubuntu The release version of

Virtual machine (VM), a virtual system, system installed in the system

    • A complete computer system that runs in a fully isolated environment through software simulations with full hardware system functionality. The popular virtual machine software is VMware, Virtual box, and virtual PC, all of which can be virtualized on a Windows system with multiple computers.

Vmware/virtual box/virtual pc Three differences:

    1. Commercialized by VMware, which is charged
      1. Fusion is a Mac system
      2. Workstation Pro is a Windows system
    2. Virtual Box Open-source VMS, maintained by Oracle
    3. Virtual PC is not open source, but can be tried for free and is maintained by Microsoft

Linux differs from Windows

    1. Linux file names are strictly case sensitive
    2. All content in Linux is saved as a file, including hardware
    3. Linux does not differentiate file types by extension
      1. Depending on the permissions, here are some of the conventions that are used to manage files for administrators (that is, easy to manage)
      2. Compress package: '. Gz '. bz2 '. tar.bz2 ' *.tgz ' etc.
      3. Binary packages: '. RPM '
      4. Web page file: '. html '. php '
      5. Script file: ' *.sh '
      6. Configuration file: ' *.conf '
    4. Programs under Windows cannot be installed and run directly in Linux

Getting Started with Linux basic commands

  1. LS display short format; ls-l Display long format
  2. Ls-l Display Information Explanation (drwxr-xr-x+ 5 Liufeifei Staff 8, 15:56 public)
      1. First column: drwxr-xr-x+ access rights
      2. Second column: 5 current directory memory in the number of files
      3. Columns three and fourth: Liufeifei staff indicates which user and user group the current file belongs to
      4. Column Five: 170 indicates the size of the current directory or file
      5. 8 18 15:56 creation time for a directory or file
      6. The last column is the name of the directory or file
  3. Ls-a Show all files, including hidden files
      1. Under Linux, as long as the file name is preceded by a dot, it is a hidden file
      2. There are two file names are very special, the first one is a point, the second is two points
        1. A point: Represents the current directory
        2. Two points: Represents the previous level of the directory
  4. mkdir Creating a directory (make directories)
      1. mkdir-p [directory name]: recursive creation
      2. -P is to establish a multilevel directory mkdir-p a/b/c, no-P return: No such file or directory
  5. The directory where the CD is switched
      1. CD [directory] (change directory)
      2. CD ~ or CD into the current user's home directory
      3. CD-Go to last directory
      4. Cd.. Go to the top level directory
      5. Cd. Go to current directory
  6. CP Copy Command (copy), formula: CP [Options] [Original file or directory] [target directory]
      1. -R Copy Directory
      2. -P Joint File attribute copy
      3. -D If the source file is a linked file, copy the link property
      4. -A equals-RPD
      5. Copy file cp is OK, if the copy directory needs to have the-R, the default copy file
      6. CP-A Copy all the hidden properties are the same, cheer up, happy
  7. PWD Query directory location (print working directory)
  8. rmdir [directory name] Delete empty directory (remove empty directories)
  9. RM-RF [File or directory] (remove)
      1. -R Delete Directory
      2. -F Mandatory
      3. RM-RF/This is a Linux suicide command, will be more than 90% of computer files deleted, will not affect the normal operation of the computer, very individual files can not be deleted
  10. MV (move) Cut or rename command; MV [original file or directory] [target directory]

Getting Started with Windows command line (search cmd lookup)

    1. View all files in the current directory, using dir
    2. The folder under Windows is the directory, and the two are equivalent
    3. Switch directories, use CD [folder name]
    4. Create directory MD [folder name]
    5. Copy the command copy [file to be copied] [Copy location]
    6. Delete command del [delete file name]
      1. Use this command system will not give hints, use time special attention
      2. Files deleted using del will not appear in the Recycle Bin, be careful
    7. Rename Word command: Rename [name to be changed] [name to change]

Cygwin Installation and use

    • Cygwin is a UNIX simulation environment running on the Windows platform
    • Use this environment under Windows to learn Linux commands
    • Cygwin is an open source project
    • Install the default can be selected, the last choice, select the fastest (that is, the first), then select the component installation method, select Full installation

The Linux environment complements

    1. CD/is to enter the system's root directory
    2. touch [filename] New file, such as: Touch index.js
    3. vi or vim [filename] enter into the corresponding file
    4. cat [file name] View file contents
    5. esc +: Wq save file and exit
    6. init 3 into full multi-user mode, standard run level, i.e. into a full command environment
      1. init 0: Shutdown  
      2. < Span class= "S1" >init 1: Single-user mode &NBSP;
      3. init 3: Full multi-user mode, standard run-level &NBSP;
      4. < Span class= "S1" >init 5: Start to enter X-window system, i.e. graphical interface
      5. init 6: Restart

User groups

    • Each user in Linux must belong to a group and cannot be independent of the group. Each file in Linux has the concept of owner, group, and other groups

Owner

    • Typically the creator of the file, who created the file, becomes the owner of the file naturally
    • You can see the owner of the file with the Ls-al command
    • You can also use the Chown user name file name to modify the file owner

The group where the files are

    • When a user creates a file, the group where the file is located is the group that the user is in
    • All groups of files can be seen with the Ls-al command
    • You can also use the CHGRP group name file name to modify the group in which the file resides

Other groups

    • Other users of the system are other groups of files, except for the owner of the file and the user in the same group

Folder permissions

Drwxr-xr-x Liufeifei admin 510 11:38 demo

    1. Drwxr-xr-x 10 characters determine what different users can do with a file
    2. The first character represents a file (-), a table of contents (d), a link (l)
    3. The remaining characters are set per 3 (RWX), read (R), write (W), execute (x)
    4. First set of rwx: The permissions of the file owner are read, write, and execute
    5. Second set of R-x: Permissions for users of the same group as the file owner are read, execute, but not writable
    6. Third group R-x: permissions for other users who are not in the same group as the file owner are read, execute, but cannot be written
    7. can also be represented by a number as: R=4 w=2 x=1, so rwx = 4+2+1 = 7
    8. 15 indicates the number of files connected
    9. Liufeifei indicates that the user
    10. Admin indicates the group where the user resides
    11. 510 indicates the size of the file (bytes)
    12. 11 23 11:38 indicates last modified date
    13. Demo indicates file name

Change folder permissions

chmod change the permissions of a file or directory chmod 777 user name (that is, the file name of the permission to modify)

chmod 777 Index.js: Give Index.js permission rwxrwxrwx

chmod 755 test.js: Give Test.js permission Rwxr-xr-x

chmod u=rwx g=rx o=rx test.js: Ibid. u= User Rights g= group permissions o= different groups other user rights chmod u-x, g+w test.js: Give test.js Remove user-executed permissions, increase group Write permissions chmod a+r test.js : Add Read permissions to all users

Basics of getting Started with Linux

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.