Linux Common Command logging

Source: Internet
Author: User

ls command:
    1. Ls-1: Displays the files in this directory in one line
    2. Ls-a: Show hidden files
    3. LS/: View something under the root path
    4. Ls-r/: Recursively view all content under the root path
    5. Ls-s: Display size
    6. Ls-alsh: Show the size of each file in the form of human understanding, specific to K
    7. LS--help: If the option is a word, or multiple letters for a whole as a command option, the front to add 2 bars
    8. LS-T: Display in reverse order of file modification time
    9. Ls-i: Ignore ....
    10. Ls-l--TIME=ATIME/HOME/LIUSHU/PRAC/AA Show access time for content under the AA folder
    11. 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:
    1. Second column: The number of hard links representing the file
    2. Third column: Represents the owner of the file
    3. Column Fourth: Represents the group in which the file resides
    4. 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
    5. The sixth column: The time stamp that represents the file, the time that was created or last modified
    6. Column seventh: Name representing the file
    7. First column:
    8. 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)
    9. 2) XXX yyy zzz:xxx--owner's permission, yyy--the owner's group, zzz--other people's rights
    10. 3) rwx:r--read Read permission, w--write write permission, X--execute executable permission, the relevant location is-------no permission
    11. 4) 7=4+2+1 (4:read; 2:write; 1:execute)
    12. 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:
    1. Give permission to Ugo +/-/=; comma-delimited, comma-preceded and trailing spaces; a (all) = = = Ugo

    1. 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:
    1. mkdir AA
    2. CD AA
    3. Touch AA
    4. Ls-l AA: View specific information for files under the AA folder
    5. Ls-ld aa: Check the specific information of the AA for this folder itself
    6. Chmod-r 744 AA

Chown: Changing the file owner and group
    1. Useradd Tom---Add a new Tom user
    2. Chown Tom Aa.txt---Change the owner of Aa.txt to Tom
    3. Chown tom:root aa.txt---Change the owner of the Aa.txt to Tom and change the group to the root group
    4. 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.)
    5. 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
    1. CHGRP Root Aa.txt---Change the group of Aa.txt to root
    2. 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:
    1. Clear
    2. 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
    1. Date +%y--shows the full 4 bits of the current year, such as: 2016
    2. The date +%y--shows the following 2 bits of the current year, such as: 16
    3. Date +%m--shows the current month, such as: 6
    4. Date +%m--shows the current score as: 56
    5. Date mmddhhmm--Setting the current system time
    6. 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
    1. cal--shows this month's calendar.
    2. Cal 2016--shows the calendar for all months of the year
    3. Cal M Y--cal followed by month and then with year--cal 12 2016--show December 2016, this month's calendar
BC Command: Calculator
    1. Bc
    2. Usage: Execute BC
    3. Then enter the number to be calculated, such as 1/3 to get 0 on another line
    4. Setting accuracy: scale=4
    5. Quit: Quit


Linux Common Command logging

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.