Knowledge of Linux Systems

Source: Internet
Author: User
Tags echo command

1. What is Linux?Components: Hardware, kernel, LIB library, application hardware: The real part of the work is the hardware Linux kernel (kernel): The version Lib library that manages the hardware Linux team management: encapsulates the kernel interface, provides the system invoke application: and user interaction, Provide a specific service GNU: Many common applications have been developed on top of the Linux kernel, and these applications are open source 2. Linux distribution? RedHat: The Linux kernel, LIB libraries, and applications are composed of an operating system in a specific format, RedHat release version centos:6.6 Ubuntu: 3. Linux Philosophy thought:1, Linux All Files 2, Linux will be a large demand, broken down into a lot of small needs, there is a special small program to complete each small demand, a small program only one thing to do 4. What is a shell? It can be simply understood that the shell is a command parser that parses and communicates the commands you enter into the kernel shell as a user interface (the interface between the user and the operating system), the shell is an application, and the shell is a special application, and all programs running on the kernel are called applications. The shell is a special interactive utility. It provides users with a way to start programs, manage files in the file system, and manage processes running on Linux systems. The shell contains a set of internal commands that can be used to control file copying, file movement, file renaming, and displaying programs that are currently running on the system. In addition to internal commands, the shell allows the command to output the name of the program at a command prompt the shell can pass the program name to the kernel to start the program. Command Category: Internal command: External command: Command prompt: [\[email protected]\h \w]\$ configuration command prompt line style: PS1 =\d display date, format "sun and Moon Year" \h local hostname \h full domain name \ t display 24-hour format of "hours: minutes: Seconds" \ t displays the time, 12-hour format, "Hours: minutes: Seconds" \u the current user name \w the current working directory \w the absolute path path to the current working directory: root directory://root/test/etc/text/bin/te XTCD testcd/root/test relative path: Finds an absolute path starting from the current path: finding from the root pathcommand format:Command    command Options     command parameters   commands: Program   command options: Specifies how to run this command long option:--short option:-  Command parameter: Specifies that the program functions again on that object   How to get help with commands: Help for internal commands: Help for external commands for the Assist command: 1, command   --help                 2, man command   help manual:             NAME             synopsis            description             OPTIONS             examples            author             BUGS             see also             synopsis:&nbSp;               []: Optional content                  <&gt: Required content                  a|b: Choose from a;  &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP: The same content can appear multiple       Manual: is a compressed format file, and there are chapters of the         1: User command;   &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;2: System call;         3:c Library function;         4: Equipment files and special files;         5: File Formats;         6: Game;         7: Miscellaneous;  &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;8: Management tools and Daemons;         Where the man manual is stored:/usr/share/man &nbsP;          man Command own config file:/etc/man.config                 manpath/path/to/somewhere: Define the man manual lookup path;             -m/path/to/somewhere: Specify a list of paths to find help manuals      man Command action method:          Flip Screen:              SPACEBAR: Turn the screen at the end of the file;             b: Turn screen to file header;             Enter: Turn the end of the file;   &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;K: Flip a line to the file header;             ctrl+d: Turn half screen to the end of the file;             Ctrl+u:        Header              g: Jump to end of file            &NBSP;&NBSP;1G: Jump to the first line;             #G: Jump To Line #;          Text Search:             /keyword: Searches for the specified string, does not distinguish between character case, and from file header toFile tail direction to find;                 n: Next                 n: Previous              ?keyword: Searches for the specified string, does not distinguish the character case, and looks for the file header from the end of the file;                 n: Next                  n: Former                   Exit:q     linux file system:         /bin: Store Basic user Commands          /boot:boot loader related static files, kernels and RAMDisk files         /dev: Device related files    &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;/ETC: Host-specific system configuration file         /home: User's home directory (optional)         /lib: Basic shared library files, and kernel module files                  .so, .ko       Basic Shared library file for   /lib64:64bits system         /media: Removable device mount point   &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;/MNT: mount point for temporary use of mounted file systems          /opt: Installation location for third-party applications         /root: admin root User's home directory          /sbin: System Management-related binaries               Note: Execution settingsoperation, the command under this directory only has administrative privileges for users who can execute &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;/SRV: current system service-related data     &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;/TMP: Temporary file directory with special permission settings &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;/USR: can be shared, Where read-only data is stored             bin: Binary program              include:c header files used by the program              lib: library Files             &NBSP;LIB64: library file             local: Local program directory structure              share: Platform architecture-independent data              sbin: Management Program          &NBSP;&NBSP;&NBSP;&NBSP;SRC: Source code directory         /var: variable file directory        &nbsP;     cache: Cache data for Applications            &NBSP;&NBSP;LIB: Variable state information data             local: for/usr/ Variable Data directory for program preparation under local             lock: Lock file directory              log: Log Files              run: Run process-related data, such as PID files for daemons          &NBSP;&NBSP;&NBSP;&NBSP;TMP: Temporary file directory         /proc required to be retained after system reboot: Virtual file system Interfaces              pseudo-file systems for kernel and process-related information: Not a file system by itself, But the output is file system         /sys: Pseudo file system, hardware device related information virtual file system interface       linux parts of the application:         binaries: Bin, sbin          Library Files:LIB, lib64         configuration file:etc          Help file:/usr/share/man, file types under/usr/local/share/man     linux:         -: Normal file         d: catalog file          b:block, block device files               Random access device         c:character, character device files               linear access Device         l: Soft link file          p:pipe, named pipe         s:socket, Socket files   Environment variables: PS1: Define command Prompt Format:  command: Type: Determines whether a program is an internal command or an external command CD: Toggle work path PWD: show current working path LS: Displays files and directories under current or specified directory      -a: Show all files, including shadow files     -a    -l: Long format list, display file attributes information          -rw-r--r--1 root root 1619 nov  9 22:55/etc/passwd     & nbsp;      -: File Type              rw-r--r--: File access rights              1: Number of times the file has been hard             root root: Owner of the file, file group ( Group)             1619: File size, default unit is bytes             nov  9 22:55    The time the file was last modified;            /etc/passwd      file name     -d: Displays the information of the directory itself     -h:human-readable, to do a unit conversion to achieve easy to read     -r: Recursive     -i: Display file inode number  cat: Show file Contents     cat [ File]...  &nbsP;     -n: Add line numbers to the output;         -e: Displays nonprinting characters and line terminator $   File Content Type view command:     file [file]...         Determine the type of file content   echo command: Echo    echo [options] [argus]    -n: No Line break;  &NBSP;&NBSP;&NBSP;-E: Allow the control to take effect;         \n: NewLine     echo $ {Var_name}: Display the value of a variable  8, bash globbing:     file name wildcard: metacharacters          *: Matches any character             pa* of any length, *PA *, *pa, p*a, *p*a        ?: matches any single character              p?             Thinking:                 pad:p?d, P*d                  pd:p?d, p*d                 paad:p?d, p*d         []: matches any single character within the specified collection           &NBSP;&NBSP;&NBSP;[0-9]: Any number             [a-z] : Any lowercase characters             [A-Z]:             [0-9a-zA-Z]             p[mn]*        [^]: matches any single character outside the specified collection              p[^m-z]*          Character set:             [:space:] All whitespace characters, [[: Space:] ]            [:p UNCT:] All punctuation              [:lower:] All lowercase letters              [:upper:]      Big              [:d igit:] All numbers             [:alpha :] All letters &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;[:ALNUM:] All letters and numbers       Exercise 1: Displays a file or directory where all L starts with a lowercase letter ending with a single digit in the/var directory;     # ls-d/var/l*[0-9]*[a-z]     # ls-d/var/l*[[:d igit:]]*[[:lower:]]              Exercise 2: Display a file or directory that starts with any digit and ends with a non-digit in the/etc/directory;     # ls-d/etc/[0-9]*[^0-9]              Exercise 3: Display the/etc/directory, starting with a non-letter, A file or directory followed by a letter and any character of any length;      # ls-d/etc/[^[:alpha:]][[:alpha:]]*              Exercise 4: Copy/etc/, all files or directories starting with M, not ending with a number to the/tmp/mageedu directory;     #cp-R/etc/m*[^0-9]/tmp/ mageedu         Exercise 5: Copy all files or directories ending with. D in the/etc directory into the/TMP/MAGEEDU2 directory;      #cp-R/etc/*.d/tmp/mageedu2              Exercise 6: Copy/etc directory, all end with. conf, files or directories beginning with m,n,r,p to the/TMP/MAGEEDU3 directory;     #cp-R/etc/[mnrp]*. CONF/TMP/MAGEEDU3&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;9, Directory Management class commands: CD, PWD, ls     mkdir, Rmdir    mkdir:        mkdir [options] DIRECTORY ...             -v:verbose, more info              -p:parent, the cascade creates the directory, and the parent directory of the specified target directory is created if it does not exist;    &nBsp;aa/bb    rmdir: Delete Empty directory         rmdir [options] Directotry ...            -v             -p:     Question 1: How to create/tmp/x/y1,/tmp/x/y2,/ tmp/x/y1/a,/tmp/x/y1/b,/tmp/x/y2/a,/TMP/X/Y2/B&NBSP;&NBSP;&NBSP;&NBSP;MKDIR-PV x/{y1,y2}/{a,b}   &NBSP;&NBSP;MKDIR-PV X/Y1/A&NBSP;&NBSP;&NBSP;&NBSP;MKDIR-PV X/Y1/B&NBSP;&NBSP;&NBSP;&NBSP;MKDIR-PV x/y2/a  &NBSP;&NBSP;&NBSP;MKDIR-PV x/y2/b     Question 2: How do I create a a_d, A_c, B_d, b_c four directories?         # mkdir a_d a_c b_d b_c 10, file management tools: CP, MV, rm   & nbsp;    cp   options    source files    Target locations          cp   source files    target files         cp   file1   file2                      Presence                           does not exist            cp   source files    directories         cp   source Directory    directory &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;CP Common options:             -r: Implementing recursive replication when replicating directories              -d: Do not follow the source file that the symbolic link file points to, that is, copy the linked file itself rather than the file it points to              -a: equivalent to-dr            -i:interactive, When the target file is saved, remind the user whether to perform the overwrite (y/n);             -f:force, forcibly overwrite;          Note: If the source file is a symbolic link file, the content of the source file that the link points to is copied;         File movement: MV&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;MV [OPTION] SRC DEST   &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;MV [OPTION] SRC ... directory            mv   Source Files      Target files                  source files     Catalogue                   Source directory     target directory             - i:interactive            -f:force          File Deletion:rm            &NBSP;RM [OPTION] file...                -r: Recursively deletes the directory and all files inside it;                 -f: Force Delete               Note: It is recommended to move to a dedicated directory; After a while to clean up the;       

Knowledge of Linux systems

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.