"Linux_ notes" Linux common commands

Source: Internet
Author: User
Tags add numbers


The notes are the result of watching Marco's Linux training video tutorial, after I have collated and released.

Knowledge Review:
Gui:graphic User interface--GUI
Windows (Windows desktop)
X-window (Linux Desktop)
Gnome
Kde
Xfce
Cli:command lines interface--Command line interface
SH (initial)
Bash
Csh
Ksh
Zsh
Tcsh

IDE (Generic salutation): the integrated development environment used by programmers when developing programs
Library files:
Windows:dll--dynamic link library (dynamic link libraries)
Linux:.so--shared object (Shared Object)

Login: Username-the operating system identifies the user by the user's ID (the computer recognizes the number faster than the character)
Authentication mechanism: Authentication (identification of the user is the mechanism of the person he claims)--password, fingerprint ...
Authorization: authorization--Authorization for resource access
Audit: Audition (log)--record user actions

Prompt: Command prompt
Simply put (regardless of the issue of authorization): When we type a command at the command prompt and enter, the execution program will be submitted by bash to the kernel, the kernel will then check the magic number of the execution program, to see if it is an executable program, can run, no one refused to run.

Format: # Command Options ... arguments

Magic number (Shebang): Magic Numbers (indicates the execution format of the binary program)--windows and Linux have different magic numbers
#!/bin/bash (#! --linux Number of demons)

List: ls--lists all directories or files under the specified path

Directories: Files, path mappings
Working directory, current directory--working directory, present directory
Directory structure: Inverted tree--Can fork node (directory)--Can not fork node (file)
Path (relative, absolute): the location that passes from the specified starting point to the destination-the mechanism for implementing hierarchical file management
FileSystem (hierarchical file Management mechanism): File system

Common commands:


pwd:Print Working directory--show Current Working directory
ls(Options and parameters default)
-L: Long format
File type (1 bit):
-: Normal file (f)
D: Catalog file
B: Block device files (blocks)
C: Character device file (character)
L: Symbolic Link files (symbolic link file)
P: Command pipe (pipe)
S: Socket file (socket)
File permissions (9-bit): Every 3-bit group, each group represents: rwx (read, write, execute),
Example: rw-(indicates readable, writable, unable to execute)
Number of hard links to files
Owner of the file
Genus Group of files
File size (size), default unit is byte
Timestamp (timestamp)-There are three: the last time the modification was displayed.
Access: Access
Modify: Modify, change the contents of the file
changing: Change, metadata, changing the properties of a file (meta data)
Filename
-H: Do unit conversions, default B, convert to KB ...
-A: Show hidden files starting with. (hidden files in Linux start with dot)
.: Indicates the current directory
.. : Represents the top level directory of the current directory
-A: Displays except. .. Hidden files outside of
-D: Display the directory's own properties
-i:index node,inode Display the index node number of the file-the computer identifies a unique identifier for each file
-R: Reverse Display
-R: Recursive (Recursive) display (recursive display directory)--directories, subdirectories ...

CD: Change directory toggles the current directory
Home directory, home directory, home directory--wavy line representation ([root @lab ~])
CD ~username: Enter the home directory of the specified user
CD-: Switch back and forth between the current directory and the previous directory

Type:Shows which type the specified command belongs to
Command type:
Built-in commands: Shell built-in commands to implement certain management functions.
External command: There is an executable file corresponding to the command name in a path on the file system

Environment variables (simplified commands--no input path for each command): variable is a named memory space
Variable assignment: Name = jerry--put data into memory
printenv:Display environment variables
Path: a bunch of paths separated by colons
When the system executes a command, the path of the command is first looked up through buffering, and no lookup will be found by path in order. So when you execute a command for the first time, the path is looked up through path and the path of the command is cached, and the same command executes again later through the cache.
Hash (Cache-system acceleration): Records the path of the previously used command in a hash list.
Hash table: maintains the command path as a key-value library, and the speed at which the command path is found in the key-value library is O (1).
O (1): No matter how long the queue is, the speed at which any data is found is the same

Date:System time management (display, modification time)
Linux at the start of the RTC Read time (Hardware clock time), once read successfully, no longer use this time, and then no longer use the time, after the operating system's kernel will be software to simulate the oscillator, within the system to maintain a clock (system clock)
LINUX:RTC (real Time clock)--Hardware clock time--clock/hwclock
System Clock--date
DateUse of commands:
Date 0226104913.30 Set system time February 26 10:49:30 13
Date +%d Show month/day/year
Date + "This yearly is%Y" displays this annual is
Date + "Today is%d" What day is it?
Date + "This%Y%n Today's%d" is displayed in two lines
Date +%t display hour minute seconds
Date +%f display year-month-day date +%y-%m-%d
Date +%h:%m display hours: minutes
Date +%s Linux Time method 1970-1-1 0:0:0 to the present time (excluding today)
HwclockUse of commands:
System time is right, hardware time is wrong, to synchronize the system time to hardware time: hwclock-w
System time is wrong, hardware time is right, read hardware time to system time to: Hwclock-s

ways to get help with the use of commands:

Internal command:
Help COMMAND

external command:
COMMAND--help

Command Manual(Common Command Help method): manual
Man command--for internal commands, the shell manual that this internal command belongs to is displayed, so for internal commands, help is generally used to view the assistance.
Man Chapter:
Whatis command: A section for viewing commands
Add numbers after the man to specify which chapters to view.


1: User command (/bin,/user/bin,/user/local/bin)
2: System call
3: library Call
4: Special file (device file)--as the access entry for the device exists
5: File format (syntax for interpreting configuration files)
6: Game
7: Miscellaneous (Miscellaneous): Order for inconvenient categorization
8: Administrative Commands (/sbin,/user/sbin,/user/local/sbin): Commands that administrators have permission to use
symbol meanings in the manual:
[]: The representation enclosed in brackets can be omitted--optional
<>: Indicates must be given--required
... : Indicates that there can be multiple
|: Choose one More
{}: Grouping
What's In The Man Handbook:
Name: command names and features brief description
Synopsis: Usage notes, including available options
DESCRIPTION: A detailed description of the command function, which may include the meaning of each option
Options: Explaining the meaning of each option
Files: The configuration file associated with this command
BUGS: Who reports Bugs to
EXAMPLES: Using the example
See ALSO: Another reference
Manual Flip Screen:
Turn back one screen: SPACE
Turn One screen forward: b
Turn back one line: ENTER
Turn One line forward: K
Find(default is case insensitive):
/keyword: Searching backwards
N: Next
N: Previous
? KEYWORD: Search Forward
N: Next
N: Previous
Exit: Q
example of using the man command:
Mans LS
Man CD
Mans LS
Mans Read
Mans 2 Read
Export lang=en
Mans 2 Read
Mans Mount
Whatis Read
Whatis ls
Man 4 TTY
cat/etc/passwd
Mans passwd
Mans 5 passwd
Man Mans
Man Date
Mans Mount
Mans LS

online Documentation:Info command--Example: info ls

Documentation:/usr/share/doc
Example: Cd/usr/share/doc
Ls

Google

Cal(Calendar): Calendar
Cal: Show Monthly calendar
Cal 2015: Show calendar
Cal 12 2015: Show 2015 of December

Echo(line break by default): Internal command, displaying a line of text
Echo-e "This was 2015.\ntoday is 20"--how to wrap the display
\b: Back one grid
\ t: Tab (8 spaces)
\v: longitudinal watchmaking
-N: Remove line break

printf(No line break by default): Format and display data
Learn C language should know how to use the
Example: printf "The year was 2015.\ntoday is 20.\n"



This article from "Not Daze" blog, please make sure to keep this source http://tobeys.blog.51cto.com/10620284/1686621

Linux_ notes Linux common commands

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.