Unix operating system



    https://www.tutorialspoint.com/unix/index.htm

    https://help.ubuntu.com/lts/serverguide/index.html

    https://wiki.centos.org/HowTos

    https://aws.amazon.com/premiumsupport/knowledge-center/new-user-accounts-linux-instance/

1. What is unix

Kernel
Shell interpreter
Commands and utilities
Files and directories

User ->Command line ->Shell interpreter->Kernel

2. File management

ls
ls -l
ls -l filename
ls -a

3. Directories


4. File permission / Access modes

4.1 chmod

4.1.1 Using chmod with symbolic mode

Object:
u - user
g - group
o - others
a - all

Permissions
r
w
x
s

Operating
- remove
+ add
= assign

4.1.2 Using chmod with absolute permissions




4.2 chown

4.3 chgrp

4.4 SUID and SGID file permission

5. Environment

6. Basic utilities, Printing, Email

7. Pipes and Filter

To make a pipe put ( | ) between 2 command
ls -l | grep "Aug"

grep --color -n -i "product" product-listing.html
grep --color -n -i "product" *.html
grep --color -n -i -r "product" *

8. Processes management

Foreground processes
Background processes : add (&) at the end of command
ps
ps -f
top

9. Network communication utilities

ping
telnet
ssh: ssh client, ssh server
ftp: ftp client, ftp server


10. Vi/Vim editor

i : turn to insert
esc : click esc to out of insert mode
:w : save
:q : quit
:wq : save and quit
:q! : force quit without save

11. Shells

12. User administration


Three type of accounts:
+ Root Account
+ System Accounts
+ User Accounts

groups : get groups of user login
groups username: show list group of specific user
usermod -a -G wheel tuan : wheel is sudo group of centos
su - username : change user login
/etc/passwd : info of users
/etc/group : info of group


groupadd dev1
groupmod -n dev2 dev1
groupdel dev2

useradd -d /home/user1 -g dev2 -s /bin/sh user1
passwd user1
usermod -d /home/tuan -m -l user1 tuan
userdel -r tuan

usermod -a -G dev2 tuan   : add secondary group
usermod -g wheel tuan : assign a primary group

13. Symlink

14. Common command

- Check space
du -sch *
df =h



Comments