Three years of drinking ice-ai-linux-02 initial Linux

Source: Internet
Author: User
Tags clear screen set time

Reference Blog: https://www.cnblogs.com/linhaifeng/articles/6045600.html

1: initial Linux command

Right-click, open Terminal, or Ctrl+alt "F1-f6" to open terminal

Normal User Login After the system prompt $;root sign in after the prompt for #;

Exit Terminal: Exit;

Shutdown system: Init 0;

  basic format for Linux commands : command "Options" "Parameters"

Command: Tell the system what to do? Options: How commands are run. Parameters: What is the command operation

1.1 Presentation files

ls-l/boot; ls-a Show hidden files

1.2 View Current User

Who am I: Lists the user names used by the current login system

WHO lists which users are currently working on the system, logging on at the terminal

1.3 Date Time

Date View Time

Date ' month of the year ' Set time

1.4 Viewing calendars

Cal or Cal month year

  

View hardware time: Hwclock

1.5 Clear Screen

Clear

1.6 Creating a user

Useradd User Name

Useradd-u 1000-g aaron-d/home/alex-c bigalex-s/bin/bash Alex

User ID Group ID home directory description information execution permissions

1.7 Change Password

passwd User Name

1.8 Switching users

Su-aaron

1.9 Deleting a user

Userdel-r User Name

1.10 Viewing users

ID User Name

1.11 Modifying users

A) –u: Modify the UID of the user
b) –g: Modify the user's GID
c) –G: Add a user to the specified group
d) –d: Modify the user's home directory
e) –c: Modify User's Notes information
f) –s: Modify the shell used by the user

1.11.1 Modify Home Directory

usermod-d/HOME/SB Alex

Note: This modification is only the user's passwd profile, but in fact there is no SB home directory. Need Cp-r/home/alex/. [!.] */home/sb/First copy

1.11.2 adding users to a group

Create group: Groupadd Group name

USERMOD-G Group name User name

1.11.3 changed the GID of Alex's user to the command of the Aaron Group:
Usermod–g Aaron Alex

1.13 Help

--help or command--help

You can complete the command prompt by using the TAB key.

File structure of the 2:linux

Unlike the window system, the Linux system file structure is a tree, a tree with a "/" root directory

2.1. Indicates the current directory

2.2.. Represents the previous level of the directory

2.3 PWD Show content

2.4 Common Directories

A) Bin directory: Store common executable files

b) Sbin directory: The executable file that holds the system

c) Home directory: Used to store users ' own directories and files. The root user is stored under the/root folder. Normal users are stored under the/home folder.

d) Dev directory: Device files directory

2.5 There is also the assertion that there is a relative path and an absolute path in the system.

2.6 CD Command

A) Return to the previous level: CD.

b) return home directory: cd~

c) return last: cd-or direct CD

2.7 ls command

A) View hidden directory: ls-a

b) View more information: ls-l

2.8 CP Command

CP Original path target path and name

Cp-r recursive copy, can be used to copy folders
2.9 MV Operation
MV Source file destination file: Mobile
MV FileName New file name: rename
2.10 Mkdi operation
MKDIR/A Create a directory.
Mkdir-p: Cascading creation
2.11 Touch
Touch Aa.txt Creating a text document
2.12 RM Delete File
RM file Name
Rm-f a.txt Delete file, and ignore prompt
RM-R file name, cascade Delete
2.13 Cat Command
Show file contents
2.14 Head
Displays the first few lines of the file, default 10
Head-2: Show first two lines
2.15 Tail
Show the end of a few lines, default 10 rows

3: Create user-related files

3.1 Viewing user information through the passwd file

less/etc/passwd

3.2 via Shadow file (view user password)

Less/etc/shadow

3.3 Passing files (viewing group information)

Less/etc/group

3.4 via File (view group password)

Less/etc/gshadow

3.5 View Home Listings

less/home/

3.6 Viewing mailboxes

Ls/var/spool/mail

3.7 Exercise: Placing a Tom user in the Aaron Group

Edit Modified file: vim+ path

Save exit File: Esc +: Wq

3.8 Adding users by modifying the file

3.8.1 Modify passwd file (modify user details file)

3.8.2 Modify Shadow File (modify user password file)

3.8.3 Modifying a group file (modifying a set file)

3.8.4 Modify Gshadow file (group password)

 

3.8.5 Modify Home file (home directory)

Note Create the Yangke directory under home with mkdir

If you don't have a folder, you'll need to copy some documents.

3.8.6 Creating a Mailbox file

Three years of drinking ice-ai-linux-02 initial Linux

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.