Basic Linux commands for deploying projects under Linux

Source: Internet
Author: User
Tags clear screen control characters parent directory

2017-03-23:

All commands can be used * *--help to view Help

  1. CD-To-Change directory
    1. Function: Switch directory
    2. Format: CD [catalogue]
    3. Usage
      1. CD ~ Current User Directory
      2. CD/root directory
      3. Cd.. Top level Directory
      4. CD-The last directory accessed (fallback to the last visited directory)
      5. If the CD is the default, it will enter the current user directory as
      6. CD directory name enters a subdirectory of the current directory

  2. LS-to List
      1. Features: Listing directory contents
      2. Format: ls [parameter] [file or directory] Note: The default value for a file or directory is the current directory
      3. Parameters
        1. -L: Displays a list of detailed formats
        2. -T: Sorting using File and directory change times
        3. -R--reverse (reverse): reverse Sort
        4. -A--all (all): Displays all files and directories under it including hidden files and hidden directories and. xxxx files
      4. Attention:
        1. Ls-l---this command is commonly used, providing a simplified command ll
        2. Ll-h---H parameter to convert the file's byte size display to KB,MB, etc.
        3. Example: LL-AHTR = = another example = = = ll *.log


  3. PWD--Print working directory
    1. Function: Show working directory


  4. Clear
    1. Function: Clear Screen

  5. mkdir--Make directory
    1. Function: Create a directory if the specified directory does not exist
    2. Format: mkdir [parameters] [table of contents]
    3. Parameters:
      1. -P--parents (Parent-> previous level): Parent directory is not present (created by Cascade creation)
      2. -V--verbose (verbose--show verbose): Displays detailed information during command execution
    4. Example:
      1. Mkdir-p./abc/123


  6. RmDir--Remove directory
    1. Function: Delete the specified empty directory
    2. Format: rmdir [parameters] [table of contents]
    3. Parameters:
      1. -P--Parents: The parent directory is empty if no subdirectories are deleted, cascade Delete
      2. -V--Verbose: Displays detailed information during command execution
    4. Example:
      1. Rmdir-p/abc/123

                          

2017-03-24  

  1. Cat--Catenate
    1. Features: Quick view of the entire content, file content can not be many
    2. Format: Cat [parameters] [file]
    3. Parameters:
      1. -N--number: Numbering All lines of the output
      2. -S--squeeze-blank (squeeze blank): Multiple lines of blank lines are compressed into one line
      3. If only cat then you enter what, will output what CTRL + C or CTRL + Exit
    4. Example:
      1. Cat-ns Abc.txt

  2. More
    1. Features: page display of file contents
    2. Format: more [file]
    3. Operation:
      1. Enter down n rows, need to be defined, default 1
      2. The space is mixed down one screen
      3. B Return to previous screen
      4. Q Exit More
    4. Example:
      1. More Abc.txt

  3. less   (for viewing profiles)
    1. features: Paging through the contents of a file, operation more detailed    
    2. format: fewer [parameters] [File]
    3. parameter:
      1. -M: Displays a percentage similar to the more command
      2. -N (uppercase): Displays the line number of each line
    4. Action:
      1. Space: Forward page   (PG DN) key
      2. B: Back page     (pg up) key
      3. D: Forward half page
      4. u: Back half page
      5. Enter: forward line
      6. y: Back line
      7. /string: Search Down
      8. ? string: Search up
      9. V: Enter vim
      10. Q: Exit
    5. Example:
      1. less-n abc.txt

  4. Tail tail
    1. Features: Quick View Log after a few lines
    2. Format: tail [parameters] [file] If you have more than one file, the corresponding file name will be displayed at the beginning of each paragraph
    3. Parameters:
      1. -F--follow (following): Data appended to the instant output file change
      2. -N--lines=k: Output the last K line (default is 10 rows)
    4. Example:
      1. tail-5f Abc.txt (cannot multiple files after using the-n parameter)
      2. Tail-f Abc.txt Def.txt

  5. CP--Copy (copy)
    1. Features: Copying Files or directories
    2. Format:
      1. CP [Parametric] ... [-t] source file destination file
      2. CP [Parametric] ... Source file ... Directory
      3. CP [Parameters] ...-t directory source files ...
    3. Parameters:
      1. -R (Recursive-to-recursion) action on directory
    4. Example:
      1. CP abc.txt def.txt file to file will ask if you want to overwrite
      2. Cp-r qwe rty Copy the Qwe directory to the Rty directory

  6. MV--Move (mobile)
    1. Function: Move or rename an existing file or directory
    2. Format:
      1. mv [parameter] ... [-t] source file destination file
      2. mv [parameter] ... Source file ... Directory
      3. MV [parameters] ...-t directory source files ...
    3. Parameters:
      1. -F--force (forced): If file duplication occurs, forcibly overwrite
    4. Example:
      1. MV Qwe ASD renaming
      2. Mv-f asd/qwe Rty Mobile

  7. RM-->remove
    1. Features: Deleting files or directories
    2. Format: RM [parameters] ...    [File] ... By default, the directory is not deleted and will be queried
    3. Parameters:
      1. -F--force: Force Delete, ignore nonexistent files, do not prompt for confirmation
      2. -R--recursive: Recursively deleting a directory and its contents
      3. -V--verbose: Show detailed steps
    4. Example:
      1. Rm-f ASD
      2. RM *.log

  8. The difference between CTRL + C and CTRL + Z
    1. Ctrl + C is the end of the current program
    2. Ctrl + Z is the suspend current task, the task is not finished, still in the background, you can use FG (foreground continue)/BG (background view)

2017-03-27

  1. Vim
    1. Mode: General mode (Command mode) command modes insert mode, end line mode
    2. Transformation:
      1. Normal mode: Will enter the bottom row mode
      2. General mode I a O, etc. into the insert mode
      3. ESC enters normal mode in insert mode
      4. Vim file into general mode
    3. Common commands:
      1. Enter insert mode from Normal mode:
        1. I insert before the cursor
        2. Shift + I starts inserting at the current line of the cursor
        3. A after the cursor is inserted
        4. Shift + A is inserted after the current line of the cursor
        5. o Insert a new row on the next line of the current line of the cursor
        6. Shift + O Inserts a new row on the previous line of the cursor's current row
      2. Copy or paste in normal mode
        1. yy but row copy the line where the cursor is copied
        2. Nyy N--and digital multi-line copy the row where the cursor is located and the following n rows total n rows
        3. P (paste) paste
      3. Locating in general mode
        1. GG to the first line of text
        2. Shift + G to the last line of text
      4. Delete in general mode
        1. DD Delete the line where the cursor is located
        2. NDD Delete the row of the cursor and the following n rows total n rows
      5. Exit
        1. : Q Exits Vim, when no changes are in the text
        2. : q! Force quit does not save
        3. : W Save does not exit
        4. : Wq to exit after saving
    4. | Pipeline
      1. Function: The output of command 1 as input to command 2
      2. Format: Command 1 | Command 2
    5. grep-World Regular expression print global regular expressions
      1. Features: Specific characters for filtering/searching
      2. Format: grep [parameter] ... filter conditions [file] ...
      3. Parameters:
        1. -i-ignore-case ignoring character case differences
      4. Example:
        1. Grep-i Control/root/install.log to view the contents of the Install.log file that contain control characters
      5. with | Format:
        1. Other Commands | grep [parameter] filter conditions
      6. Example:
        1. Cat/root/install.log | Grep-i control is filtered based on the results of the cat command output
    6. PS--Process status
      1. Feature: Provides a one-time view of the process. and execute the PS command at the moment process information
      2. Format: ps [parameter] ...
      3. Parameters:
        1. -A-E Show All
        2. -F Display Uid,ppid, C and Stime fields
      4. Example:
        1. PS aux = = Ps-ef
        2. Ps-ef | grep java
    7. Kill
      1. Function: Remove the program or work in execution
      2. Format: Kill [Parameter] [program PID number]
      3. Parameters:
        1. -l list all information names
      4. Example:
        1. Kill-l Show All the information
        2. Kill-9 5638 forced termination of program # NO. 5638-9 means forced termination
    8. Ifconfig
      1. Function: Display network device
      2. Example:
        1. Ifconfig
    9. Ping
      1. Testing connectivity to the target host
      2. Example:
        1. Ping 192.168.2.23
    10. Tar
      1. Function: File Compression decompression
      2. Format: tar [parameter] ... [File] ...
      3. Parameters:
        1. -C--create Compressed file
        2. -X--extract--get unzip the file
        3. -Z--gzip is compressed by gzip
        4. -V--verbose show the compression process
        5. -F--file Use the compressed file name after F to follow the filename
      4. Example:
        1. TAR-ZXVF hehe.tar.gz-c c1/c2/c3 decompression hehe.tar.gz, extracted into the C1 directory under C2 of the current directory
        2. TAR-ZXVF hehe.tar.gz Decompression hehe.tar.gz to the current directory
        3. TAR-ZCVF hehe.tar.gz * Package and compress all contents of the current folder, compressed file name is hehe.tar.gz

        

      

  
  
                        

     

Basic Linux commands for deploying projects under 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.