AT-PHPIntership / server-practice

0 stars 2 forks source link

S1-Le Ba Vy #4

Open mvn-vyle-dn opened 6 years ago

mvn-vyle-dn commented 6 years ago

CREATE NEW USER

$ sudo useradd -m -c ‘lebavyclone' lebavyclone

Demo 1

SET PASSWORD FOR USER

$ sudo passwd lebavyclone

Demo 2

DELETE USER

$ sudo userdel vyclone

Demo 3

CREATE NEW GROUP

$ sudo groupadd phpteam

Demo 4

ADD USER INTO A GROUP

$ sudo usermod -a -G phpteam lebavyclone

Demo 5

DELETE USER

$ sudo groupdel phpteam

Demo 6

INSTALL SOFTWARE USING COMMAND TOOL

Install new software using apt command

$ sudo apt install <software_name>  
$ sudo apt install nginx

Demo 7

Uninstall software using apt command

$ sudo apt remove <software_name>
$ sudo apt remove nginx

Demo 8

Update software using apt command

`$ sudo apt update & sudo apt upgrade`

Demo 9

INSTALL SOFTWARE USING COMMAND TOOL

Install new software using dpkg

$ sudo dpkg -i <package_name>.deb
$ sudo dpkg -i skype.deb

Demo screenshot from 2018-06-13 14-34-44

Remove software using dpkg

$ sudo dpkg -r <package_name>.deb
$ sudo dpkg -r skype.deb

Demo 11

List all package installed

$ sudo dpkg -l

Demo 12

LIST FILES IN DIRECTORY

$ ls -al

Demo 13

FILE PERMISSIONS

Update permission for file/folder

$ sudo chmod -R <permission> <file/folder>
$ sudo chmod -R 675 test/

Demo 14

The | symbol

The result in the left is the param for the right $ history | grep cd

Demo 15

System

Listing all processes $ ps

Demo 16

FILE AND DIRECTORY

Listing file and directory

`$ ls <option> <directory>`
-l listing with peropety: owner, permission, time, size ...
-a include hidden file and hidden directory
`$ ll or $ ll -a`

Demo 17

Get current directory

$pwd

Demo 18

Go to directory

$ cd <directory>

Demo 19

Show file content

$ cat <filename>

Demo 20

Copy one or more files to another location

$ cp SOURCE DIRECTORY_DES

Demo 21

Move file or rename file

$mv SOURCE DIRECTORY_DES or mv [filename] [new_filename]

Demo 22

Make directory

$ mkdir <name_directory>

Demo 23

Remove file

$ rm <name_file>

Demo 24

Create file

$ touch <filename>

Demo 25

Show the tail file

$ tail
$ tail -f #show and keep the output, it is useful to check file change realtime
$ tail -n 10 # show the last 10 lines

Demo 26

Open file in nano editor

$ nano newfile1.txt

Demo 27

Open file in Vim editor

$ vim newfile1.txt

Demo 28

OWER, PERMISSION

Login to root user

$ sudo su

Demo 29

Search

Search file or directory

$ find <filename/directoryname>

Demo 30

search a file for a pattern

$ grep <pattern>

Demo 31

Network

Show network information

$ ifconfig

Demo 32

Show information and statistics about protocols

$ netstat

Demo 33

ghost commented 6 years ago

@at-vyle