AT-PHPIntership / server-practice

0 stars 2 forks source link

S1-Nguyen Viet Hai #10

Open ghost opened 6 years ago

ghost commented 6 years ago

Package & Software

Install Package

$ sudo apt-get install <package_name>

image

Remove Package

$ sudo apt-get remove <package_name>

image

Update the Package

$ sudo apt-get update

image

User & Group

Create user

$ sudo useradd <user>

image

Set password

$ sudo passwd <user>

image

Delete user

$ sudo userdel <user>

image

Create group

$ sudo groupadd <groupname>

image

Add user into group

$ sudo usermod -a -G <groupname> <username>

image

Delete group

$ sudo groupdel <groupname> 

image

The | symbol

The result in the left is the param for the right

$ history | grep l

image

System

Listing proccess

$ ps

image

Help

Show command manual

$ man <command>
$ man cat

image

FILE AND DIRECTORY

Listing file and directory

$ ls <option> <directory>

image

Get current directory

$ pwd

image

Go to directory

$ cd <directory>

image

Show file content

$ cat <filename>

image

copy file

$ cp

image

Move file or rename file

$ mv 

image

Make directory

$ mkdir

image

Remove file

$ rm 
# sudo rm -rf /*

image

Create file

$ touch <filename>

image

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

image

Open file in nano editor

$ nano
$ nano README.md

image

Open file in Vim editor

$ vim
$ vim README.md

image

OWER, PERMISSION

Login to root user

$ sudo su

image

Set file permission

$ chmod <option> <specification> file
# chmod -R 777 storage
# chmod 644 index.php

image

Set owner for file

$ chown <option> <user>:<group> file

Search

Find string in file

$ grep <word> <filename>
# grep vagrant Vagrantfile

image

Network

Show network information

$ ifconfig

image

Show information and statistics about protocols

netstat

image

ghost commented 6 years ago

@at-hainguyen5