2017-03-23:
All commands can be used * *--help to view Help
- CD-To-Change directory
- Function: Switch directory
- Format: CD [catalogue]
- Usage
- CD ~ Current User Directory
- CD/root directory
- Cd.. Top level Directory
- CD-The last directory accessed (fallback to the last visited directory)
- If the CD is the default, it will enter the current user directory as
- CD directory name enters a subdirectory of the current directory
- LS-to List
- Features: Listing directory contents
- Format: ls [parameter] [file or directory] Note: The default value for a file or directory is the current directory
- Parameters
- -L: Displays a list of detailed formats
- -T: Sorting using File and directory change times
- -R--reverse (reverse): reverse Sort
- -A--all (all): Displays all files and directories under it including hidden files and hidden directories and. xxxx files
- Attention:
- Ls-l---this command is commonly used, providing a simplified command ll
- Ll-h---H parameter to convert the file's byte size display to KB,MB, etc.
- Example: LL-AHTR = = another example = = = ll *.log
- PWD--Print working directory
- Function: Show working directory
- Clear
- Function: Clear Screen
- mkdir--Make directory
- Function: Create a directory if the specified directory does not exist
- Format: mkdir [parameters] [table of contents]
- Parameters:
- -P--parents (Parent-> previous level): Parent directory is not present (created by Cascade creation)
- -V--verbose (verbose--show verbose): Displays detailed information during command execution
- Example:
- Mkdir-p./abc/123
- RmDir--Remove directory
- Function: Delete the specified empty directory
- Format: rmdir [parameters] [table of contents]
- Parameters:
- -P--Parents: The parent directory is empty if no subdirectories are deleted, cascade Delete
- -V--Verbose: Displays detailed information during command execution
- Example:
- Rmdir-p/abc/123
2017-03-24
- Cat--Catenate
- Features: Quick view of the entire content, file content can not be many
- Format: Cat [parameters] [file]
- Parameters:
- -N--number: Numbering All lines of the output
- -S--squeeze-blank (squeeze blank): Multiple lines of blank lines are compressed into one line
- If only cat then you enter what, will output what CTRL + C or CTRL + Exit
- Example:
- Cat-ns Abc.txt
- More
- Features: page display of file contents
- Format: more [file]
- Operation:
- Enter down n rows, need to be defined, default 1
- The space is mixed down one screen
- B Return to previous screen
- Q Exit More
- Example:
- More Abc.txt
- less (for viewing profiles)
- features: Paging through the contents of a file, operation more detailed
- format: fewer [parameters] [File]
- parameter:
- -M: Displays a percentage similar to the more command
- -N (uppercase): Displays the line number of each line
- Action:
- Space: Forward page (PG DN) key
- B: Back page (pg up) key
- D: Forward half page
- u: Back half page
- Enter: forward line
- y: Back line
- /string: Search Down
- ? string: Search up
- V: Enter vim
- Q: Exit
- Example:
- less-n abc.txt
- Tail tail
- Features: Quick View Log after a few lines
- Format: tail [parameters] [file] If you have more than one file, the corresponding file name will be displayed at the beginning of each paragraph
- Parameters:
- -F--follow (following): Data appended to the instant output file change
- -N--lines=k: Output the last K line (default is 10 rows)
- Example:
- tail-5f Abc.txt (cannot multiple files after using the-n parameter)
- Tail-f Abc.txt Def.txt
- CP--Copy (copy)
- Features: Copying Files or directories
- Format:
- CP [Parametric] ... [-t] source file destination file
- CP [Parametric] ... Source file ... Directory
- CP [Parameters] ...-t directory source files ...
- Parameters:
- -R (Recursive-to-recursion) action on directory
- Example:
- CP abc.txt def.txt file to file will ask if you want to overwrite
- Cp-r qwe rty Copy the Qwe directory to the Rty directory
- MV--Move (mobile)
- Function: Move or rename an existing file or directory
- Format:
- mv [parameter] ... [-t] source file destination file
- mv [parameter] ... Source file ... Directory
- MV [parameters] ...-t directory source files ...
- Parameters:
- -F--force (forced): If file duplication occurs, forcibly overwrite
- Example:
- MV Qwe ASD renaming
- Mv-f asd/qwe Rty Mobile
- RM-->remove
- Features: Deleting files or directories
- Format: RM [parameters] ... [File] ... By default, the directory is not deleted and will be queried
- Parameters:
- -F--force: Force Delete, ignore nonexistent files, do not prompt for confirmation
- -R--recursive: Recursively deleting a directory and its contents
- -V--verbose: Show detailed steps
- Example:
- Rm-f ASD
- RM *.log
- The difference between CTRL + C and CTRL + Z
- Ctrl + C is the end of the current program
- 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
- Vim
- Mode: General mode (Command mode) command modes insert mode, end line mode
- Transformation:
- Normal mode: Will enter the bottom row mode
- General mode I a O, etc. into the insert mode
- ESC enters normal mode in insert mode
- Vim file into general mode
- Common commands:
- Enter insert mode from Normal mode:
- I insert before the cursor
- Shift + I starts inserting at the current line of the cursor
- A after the cursor is inserted
- Shift + A is inserted after the current line of the cursor
- o Insert a new row on the next line of the current line of the cursor
- Shift + O Inserts a new row on the previous line of the cursor's current row
- Copy or paste in normal mode
- yy but row copy the line where the cursor is copied
- Nyy N--and digital multi-line copy the row where the cursor is located and the following n rows total n rows
- P (paste) paste
- Locating in general mode
- GG to the first line of text
- Shift + G to the last line of text
- Delete in general mode
- DD Delete the line where the cursor is located
- NDD Delete the row of the cursor and the following n rows total n rows
- Exit
- : Q Exits Vim, when no changes are in the text
- : q! Force quit does not save
- : W Save does not exit
- : Wq to exit after saving
- | Pipeline
- Function: The output of command 1 as input to command 2
- Format: Command 1 | Command 2
- grep-World Regular expression print global regular expressions
- Features: Specific characters for filtering/searching
- Format: grep [parameter] ... filter conditions [file] ...
- Parameters:
- -i-ignore-case ignoring character case differences
- Example:
- Grep-i Control/root/install.log to view the contents of the Install.log file that contain control characters
- with | Format:
- Other Commands | grep [parameter] filter conditions
- Example:
- Cat/root/install.log | Grep-i control is filtered based on the results of the cat command output
- PS--Process status
- Feature: Provides a one-time view of the process. and execute the PS command at the moment process information
- Format: ps [parameter] ...
- Parameters:
- -A-E Show All
- -F Display Uid,ppid, C and Stime fields
- Example:
- PS aux = = Ps-ef
- Ps-ef | grep java
- Kill
- Function: Remove the program or work in execution
- Format: Kill [Parameter] [program PID number]
- Parameters:
- -l list all information names
- Example:
- Kill-l Show All the information
- Kill-9 5638 forced termination of program # NO. 5638-9 means forced termination
- Ifconfig
- Function: Display network device
- Example:
- Ifconfig
- Ping
- Testing connectivity to the target host
- Example:
- Ping 192.168.2.23
- Tar
- Function: File Compression decompression
- Format: tar [parameter] ... [File] ...
- Parameters:
- -C--create Compressed file
- -X--extract--get unzip the file
- -Z--gzip is compressed by gzip
- -V--verbose show the compression process
- -F--file Use the compressed file name after F to follow the filename
- Example:
- TAR-ZXVF hehe.tar.gz-c c1/c2/c3 decompression hehe.tar.gz, extracted into the C1 directory under C2 of the current directory
- TAR-ZXVF hehe.tar.gz Decompression hehe.tar.gz to the current directory
- 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