2-1 Linux operating system and common commands, 2-1 Linux

Source: Internet
Author: User
Tags current greenwich mean time

2-1 Linux operating system and common commands, 2-1 Linux

Edit it based on the beginner videos 2-1 and 2-2 of Marco's linux

1. GUI and CLI

GUI: Graphic User Interface

CLI: Command Line Interface

Note: In Windows, DLL: Dynamic Link Library is a Library file. In fact, there is a similar SO: Shared Object in Linux.

2. Commands

Format: # command options ...... Arguments .........

Note: Some options include parameters rather than command parameters.

3. ls: list lists the subdirectories and files of the specified file, which are omitted as the current directory.

Note: The file System is a hierarchical management.

Directory: working directory/Current directory

-L: long format, displaying details

-H: human readable for unit conversion. Differences between the following two images

-A: all indicates that all files are displayed.

In Linux, all hidden files start with., that is, hidden files starting with. are displayed.

. Indicates the current directory

.. Indicates the upper level of the current directory

-A: All files are displayed, but not including. And ..

-D: displays the directory attributes.

4. pwd: print working directory shows the current directory path

Note: Linux is/, while Windows is \,

5.-I: Is index node, index node number, first make a knot, there is a blog content http://blog.chinaunix.net/xmlrpc.php? R = blog/article & uid = 28455968 & id = 4105989

The

6.-r: Display in reverse order

7.-R: recursive display

# Ls-R is run in the root directory, and many results are displayed. You can keep this problem first. It should be shown below it and below,

I personally think that this command should not be used frequently, because if a file contains a large number of magnitude, the Operation will consume a lot of resources.

8. cd: change directory

Cd can only be a directory, not a file

Compare ls/etc/issue and cd/etc/issue. Of course, this path is generally not used, but the problem is explained.

Ls is to display the following content, while cd is just to open the directory, not to look at the specific things below.

NOTE: If cd is followed by a slash (/), it indicates to find it from the root directory. If not, it means to find it under the root directory.

Cd returns to the home directory of the user without adding any parameters.

Cd ~ Username: Enter the Home Directory of the specified user. For example, the returned username is root. If the user is switched

Cd-: refers to the switch between the previous directory and the current directory, similar to the rollback, and then the rollback.

9. The command types are divided into built-in commands (shell built-in) and external commands. An external command has an executable file corresponding to the command name in a certain path of the file system.

Type indicates the type of the command, and which indicates where the executable command is.

10. clear: used for Screen Cleaning.

11. printenv: used to display environment variables, but other information can also be displayed.

12. hash, which means that there are many commands executed in Linux. You need to find them in order in the path for each execution. However, you can use it to store all the used commands in the cache, it will be executed soon. The preceding figure shows the number of clicks.

13. Display System Time

# Date

After Windows is shut down, the time will be normal, because there is a network time server (via NTP network time protocol) in Windows, and RTC (real time click) reads the current time at the beginning of Linux.

# Date is the system time

# Clock is the hardware time, or # hwclock

Note: The running time is, but my system time and hardware time are incorrect.

14. How to obtain the command and use help.

Internal COMMAND # help COMMAND, such as # help cd, but # help ls is not internal.

External COMMAND # COMMAND -- help, for example, # ls-help

Common usage, COMMAND manual, # man COMMAND

Man is divided into eight chapters.

1. USER commands

(/Bin,/usr/bin,/usr/local/bin)

2. System Call

Which chapter should be used first? It should be displayed first. If you want to display other chapters, consider this issue.

The format is # whatis COMMAND, which shows which chapters are available. For example, # whatis ls, # whatis read

3. Library call

4. Special files (device files)

There is no content on the disk, but the access portal of the device exists. It is not a real file, so special files are used. For example, # man 4 tty

Note: This tty has several (# whatis tty). If you use a normal command # man tty is the second graph, use TTY (1) in the upper left corner) you can know the type of tty. If you call the fourth one, run the command # man 4 tty, 3.

5. File Format

Configuration File Syntax

6. Games

7. Miscellaneous

Miscellaneous

8. Manage commands

Only the administrator can use it. (/sbin,/usr/sbin,/usr/local/sbin)

15. supplement the system time of date

[]: Enclosed in parentheses, indicating that the content can be omitted.

|: Multiple vertical bars

<>: Angle brackets indicate that the content must be provided.

... : Three vertices indicate that multiple vertices can appear.

{}: Group, no special significance

NAME: command NAME and function description

SYNOPSIS: usage instructions

DESCRIPTION: Detailed DESCRIPTION of the command function.

FILES: configuration file related to this command

EXAMPLES: Example

See also: For more information, SEE

The modification time should have a default time format as follows, so # date-u MMDDhhmm and # date MMDDhhmm should be the same (which is actually incorrect)

-U can see in the help that it is Coordinated Universal Time, UTC, Greenwich Mean Time, but the default format behind it is MMDDhhmm

The running result is as follows:

The Linux date command can be used to display or set the date and time of the system. In terms of display, you can set the format to be displayed. The format is set to a plus sign followed by several tags,

If it does not start with a plus sign, the time is set, and the time format is MMDDhhmm [[CC] YY] [. ss], where MM is the month, DD is the day, hh is the hour, mm is the minute, CC is the first two digits of the Year, YY is the second digit of the Year, ss is the second digit.

·-D datestr: display the time set in datestr (non-system time)

· -- Help: displays auxiliary messages.

·-S datestr: set the system time to the time set in datestr

·-U: display the current Greenwich Mean Time

· -- Version: displays the version number.

Format, # date + % D

Generally, the system time is accurate, and the hardware time needs to be modified by the system.

# Hwclock-w

Hardware time to system time

# Hwclock-s

Also refer to http://www.runoob.com/linux/linux-comm-date.html

16. Small skills

Flip back: space

Forward screen flip: B

Flip One Line Backward: enter

One row forward: k

17. Search

/KEYWORD backward Lookup

? KEYWORD forward lookup

If there are multiple, n is the next, and N is the previous

Q: Exit

18. online manuals/online files, more detailed, are a supplement to man

# Info date

19. The document directory is in this directory

20. Calendar

Cal: calendar. Note that calculator is a calculator.

# Cal

# Cal 2016

# Cal 12 2016

21. There is also an echo function, which is very common.

Related Article

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.