ls command:
- Ls-1: Displays the files in this directory in one line
- Ls-a: Show hidden files
- LS/: View something under the root path
- Ls-r/: Recursively view all content under the root path
- Ls-s: Display size
- Ls-alsh: Show the size of each file in the form of human understanding, specific to K
- LS--help: If the option is a word, or multiple letters for a whole as a command option, the front to add 2 bars
- LS-T: Display in reverse order of file modification time
- Ls-i: Ignore ....
- Ls-l--TIME=ATIME/HOME/LIUSHU/PRAC/AA Show access time for content under the AA folder
- Ls-l--TIME=CTIME/HOME/LIUSHU/PRAC/AA Displays the creation time of content under the AA folder
ls-l command in detail: The results of a total of 7 columns, the following respectively describe the meaning of the following columns:
- Second column: The number of hard links representing the file
- Third column: Represents the owner of the file
- Column Fourth: Represents the group in which the file resides
- The Fifth column: represents the size of the file, byte size, after LS-LH plus h parameter, can be more user-friendly display file size
- The sixth column: The time stamp that represents the file, the time that was created or last modified
- Column seventh: Name representing the file
- First column:
- 1) The first character of the first column-: ordinary file; d: directory (folder); B: Device files (block files-devices that can store things, such as: U disk, hard disk, disk, etc.); C: Device file (character file-cannot store device such as TTY, terminal, keyboard, mouse, monitor, etc.); L: Shortcuts (soft links)
- 2) XXX yyy zzz:xxx--owner's permission, yyy--the owner's group, zzz--other people's rights
- 3) rwx:r--read Read permission, w--write write permission, X--execute executable permission, the relevant location is-------no permission
- 4) 7=4+2+1 (4:read; 2:write; 1:execute)
- 5) Execute: For a text file, an executable permission; for a folder, the permission to have a CD to that folder
pwd: Print the current pathchmod:
- Give permission to Ugo +/-/=; comma-delimited, comma-preceded and trailing spaces; a (all) = = = Ugo
- chmod 777 Aa.txt
chmod-
R 777 AA--
recursion changes permissions that include the contents of the AA folder itself and its folders (Note: AA is a folder and there is a AA file under the AA folder), such as:
- mkdir AA
- CD AA
- Touch AA
- Ls-l AA: View specific information for files under the AA folder
- Ls-ld aa: Check the specific information of the AA for this folder itself
- Chmod-r 744 AA
Chown: Changing the file owner and group
- Useradd Tom---Add a new Tom user
- Chown Tom Aa.txt---Change the owner of Aa.txt to Tom
- Chown tom:root aa.txt---Change the owner of the Aa.txt to Tom and change the group to the root group
- Chown tom.root aa.txt---Change the owner of the Aa.txt to Tom and change its group to the root group (3 and 4 have the same effect, and the owner and the group are separated by: or.)
- Chown-r root:root AA---Change the AA file and the owner of the file below to root and the same group as root
CHGRP: Changing the group in which files are located
- CHGRP Root Aa.txt---Change the group of Aa.txt to root
- CHGRP-R root AA---Change the AA file and the group under which it resides to root
File: View the type of files: The name of the File+ file (folder) Clear-screen command:
- Clear
- Shortcut keys: Ctrl + L
Date--help usage: date [options] ... [+ format] or: Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]] Displays the current time in the given format, or sets the system date. Date command: The day is 2016-06-30 23:56:38
- Date +%y--shows the full 4 bits of the current year, such as: 2016
- The date +%y--shows the following 2 bits of the current year, such as: 16
- Date +%m--shows the current month, such as: 6
- Date +%m--shows the current score as: 56
- Date mmddhhmm--Setting the current system time
- Date command, change the display format date + '%y%m%d-%h:%m:%s ' (use this command to automatically get the current time when you back up the database or the log requires a timestamp)
Cal command: Used to display the calendar
- cal--shows this month's calendar.
- Cal 2016--shows the calendar for all months of the year
- Cal M Y--cal followed by month and then with year--cal 12 2016--show December 2016, this month's calendar
BC Command: Calculator
- Bc
- Usage: Execute BC
- Then enter the number to be calculated, such as 1/3 to get 0 on another line
- Setting accuracy: scale=4
- Quit: Quit
Linux Common Command logging