Linux command operations (summary of the lesson)

1. user management command:
root: Superuser (has all rights)
[User Name]: ordinary users (restricted permissions)
man: user manual
su: switch the root)
sudo: for more advanced permissions

Operating practices:
ordinary users to switch to root:
enter: sudo passwd root password for root (root switch without this step can not enter the home)
Enter: su root to complete the switch from the normal user and the root

Here Insert Picture Description
2. Create a user command
adduser: add a user
deluser: delete user
passwd: Change Password
command press Ctrl + c to return the input error

3. The file operation command
(1) ls: View the current directory (folder)
(2) Linux file classification: regular files (-), catalog file (D), the device file (c character device / b block device), link file (L)
(. 3) Linux special files: file pipe (p), the stack file (f), file sharing (S)
(. 4) Linux operating authority file: R & lt (read), w (write), x (available execution)
(5) chmod: modify file permissions
(6) touch: files created
cat: view the contents of the file
rm: delete the file
(7) gedit: file editing

Operating practices:
entering the home directory, create a directory 0303, hello.c file:

Here Insert Picture Description
Permission to modify the file hello.c WX-RX--rwx:
R & lt =. 4, W = 2, X =. 1
Input: chmod 735 hello.c complete permissions to modify the file hello.c

Here Insert Picture Description
To hello.c file for editing, achieve 1-100 summation:
Input: vi hello.c hello.c open after keyboard input a carriage return into the edit page, edit the program after completion - Enter -esc-shift +: - wq save and exit
Here Insert Picture Description
to helo.c compile and see the results:
input: gcc hello.c compiled
enter: ./ a.out View results
Here Insert Picture Description

(8) file editor: gedit, vim, gvim, - text editor
excellent IDE: VScode
compile the file: gcc compiler ./a.out
[sudo apt-get install vim editor] installation
Here Insert Picture Description
3. directory operations command:

(1) cd: into the directory
(2) cd / cd ...: a return to the command
: Current ...: upper layer

Practical operation:
enter the home command:
Here Insert Picture Description
(3) ~: The current user work orders
mkdir: create a directory
rmdir / rm-r: delete non-empty directory

Practice Action:
Create Directory 0303:
Here Insert Picture Description
(. 4) CP: file copy
Music Videos: File Cut / rename

Practice:
Copy the file to hello.c mm directory:
Here Insert Picture Description
The directory mm rename mm1:
Here Insert Picture Description

(5) the absolute path: start from the root directory of
the relative path: from the current directory
(6) commonly used commands:
the Clear: clear screen
reset: Delete
pwd: View Path
tar: compression, decompression

Practical operation:
the compressed file demo.c
Here Insert Picture Description
extracting file demo.c
Here Insert Picture Description

4: linux directory
root /: parent directory of all files of the
commands of the storage system required: / bin (binary)
/ Boot: the Linux kernel and the boot program requires file directory
/ dev (device): used to store the device file
/ etc: this directory is for the use of the system to manage various configuration files and subdirectories in
/ home: store the user's home directory
/ mnt: mount is generally used to store storage devices mounted directory
/ root: Linux super root user's home directory permissions
/ sbin: super user root privileges to store executable command, who sbin directory contains all root privileges to run the
/ usr: used to store shared system resources
Here Insert Picture Description

Published an original article · won praise 2 · views 70

Guess you like

Origin blog.csdn.net/m0_46409206/article/details/104748266