Second article: The first knowledge of Linux

Source: Internet
Author: User
Tags clear screen

Linux basic Commands

shutdown System: Init 0
Exit Current User: Exit
switch Terminal: ctr+alt+f[1-6]
view directories and files in the current directory: LS
view directories and files under current directory (Details): ls-l (=LL)
View all directories and files (including hidden files) in the current directory: Ls-a or Ls-all
view directories and files under the specified path: LS path
view current logged in User: WhoAmI
to view all Terminal logins: Who
viewing time: Date
Modified: Date ' month of the year '
View calendar: Cal Month Year
Clear Screen: Clear
Append user name: Useradd user name
Change Password: passwd user name
Switch User: Su-user name
Change Password: passwd user name
View command Help information: Man command, Command--help
View current path: pwd

Linux operating system directory and file operations

1. Important Catalogue:

A.bin directory: Used to store common executable files

B.sbin Directory: The executable file used to store the system

C. Home directory: Used to store the user's own files or directories, where Superuser root home directory is/root, while the normal user's home directory is stored in the/home directory, and use the user name as the last level directory (family directory) name, such as User01 user's home directory is/home/ User01

D.dev directory: Device Files directory

E.ETC Directory: Configuration file directory

F. Mount point (Directory): Typically removable hardware is mounted in the/media or/mnt directory

2. File operation

A. Switch to the current user's home directory: cd ~ or CD

B. Return to the previous level directory: CD-

C. copy files and rename files: CP original path new path/file name

D. Alias the command: for example, alias xx= ' Ls-l ', execute XX command equivalent to execute ls-l

E. Moving files, directories: MV Original path New path

F. Change of name: MV formerly known as New

G. Creating a directory: mkdir path

Create a tree-shaped directory: Mkdir-p/dir1/dir2/dir3

H. Creating a File: Touch path/File name

I. Delete Files: RM path/file name
J. Deleting a directory: Rm-r path/directory name
K. Display file All contents: Cat file
L. displaying the first 5 lines of a file: Head-5 file
M. displaying files last 5 lines: tail-5 file
Dynamic View file contents: Tail-f file

3. Create user-related files

A. User information exists in file:/etc/passwd, less/etc/passwd can view user information
Each line in the file represents a user's information, with each piece of information separated into seven paragraphs
1th paragraph: User
2nd paragraph: Password placeholder (x indicates password)
3rd: User ID (root id=0, normal self-created user ID starting from 500, the normal user ID changed to 0, that is, the root authority)
4th: Group ID (Root id=0, normal self-created user ID starting from 500)
5th paragraph: Description information
6th paragraph: Home directory
7th: Whether you can log in to the operating system executable file (/bin/bash means you can log in,/sbin/nologin means no login)
B. User password file exists:/etc/shadow
C. group file exists:/etc/group
Group name: Group Password: Group ID: Team member
D. The group password file exists:/etc/gshadow
E. User mailbox file:/var/spool/mail/user name
F. Check user Id,group ID, group: ID user name

Second article: The first knowledge of Linux

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.