Ubuntu command line operation

First, enter the command line interface

Alt + Ctrl +T

User management

  1. increase user

useradd [options] [username]

There are many options if the default classification can be written directly for example: useradd yonghuming
and he will add a user name for the user name

  1. Manage user account password

passwd [options] [username]

Here is the only mention that the highest authority of the root account password can be changed
Here Insert Picture Description
This is an operation carried out is who I view the current user sudo su root is the current user to gain root privileges
passwd + username to modify user password
last enter the password twice (input password input process does not display a few)
passwd [options] [user]
options are -S -d -u the -l
the -l lock user password so that the user can not log in
-u unlock
-s state inquiry password
-d remove the password
4. modify user accounts

usermod + Option + users

usermod -l new user name original user commands
this to modify the user name
usermod -L user name locks the user
option to unlock -U
5. Delete the user account

userdel -r username

This is to remove the user

Management Group Account

  1. Create a group account

groupadd option group name

Add users to the group's command
addgroup --gid ID group name

  1. Delete a group account
    groupdel group named delete the group

Document Management

Create a file

mkdir directory name options

Delete files

Options rmdir directory name

Change the working directory

cd directory name

Change into the directory

pwd

View the current directory path

ls directory option
-a show all files including. at the beginning

View the contents of a folder

cat Folder Options

File search

find paths content (matching expression)

File deletion

rm options File List

File compression and decompression

gzip compressed file name options

vim editing commands

Key Description
h Left
l Right (lowercase L)
J at
the K
W move to the next word
b to move to the word
command Description
:! Q force-quit without saving
and: q
:! Wq forced to save and exit
: x save and exit
: wq to save and exit

Into normal mode, the following commands can be text quick removal:
Command Description
x delete the character under the cursor
X to remove before the cursor one character
dd delete the entire line
2dd represents delete two lines
input 10x, deleting 10 consecutive characters
input 3DD, the deletes 3 lines of text
in the normal mode using the copy y
normal mode using p paste

u {n} or undo the last n operations
all modifications U (uppercase) revocation of the current row

Published 24 original articles · won praise 5 · Views 1697

Guess you like

Origin blog.csdn.net/weixin_44091157/article/details/101079059