8-linux-commands (11)
8-linux-commands (11)
1. help
$ <command> -h / <command> --help
2. manual
$ man <command>
-----------------------------------------------------------
1. ls (list show/ list directory)
$ ls / ls -a / ls -l
2. cd (change directory)
$ cd <name of dire.>
3. pwd (present working directory) -> current location
$ pwd
4. mv (rename / move objects)
$ mv <old-name of object> <new-name of object>
$ mv <source-of-object> <destination-of-object>
5. cp (copy)
$ cp <source-of-object> <destination-of-object>
6. mkdir (make directory)
$ mkdir < Name of direc>
7. touch (create files)
$ touch <file name>
8. cat (list cont. of file)
$ cat <filename>
9. rm (remove object)
$ rm <filename> -> remove the file
$ rm -rf <directory>
10. echo (print anything)
$ echo 'write what to print'
--------------------------------------------
> -> redirection
echo 'hello' > echo.txt
--------------------------------------------
11. sudo (super user do)
$sudo <command>
Brace Expressions
{} -> {a..z}
* ->
*.txt
r -> read 4
w -> write 2
x -> execute 1
- -> No permissions 0
USER
GROUP
OTHERS
Symbolic way
user -> u
groups -> g
others -> o
permission.txt
PIPE: '|'
command 1 | command 2
output | input
----------------------------------------------------------
----------------------------------------------------------
IAM -> Identity access management
1. adduser:
$adduser <name of user>
2. passwd:
$passwd -l <account name> -> lock a acc.
$passwd -u <account name> -> unlock acc.
3. addgroup:
$addgroup <group name>
4. usermod:
$usermod -a -G <group name> <username>
$usermod -l <new username> <old username>
5. deluser:
$deluser <usernmae> -> delete a specific user
6. delgroup:
$delgroup <groupname> -> delete a group
----------------------------------------------------------
PID -> process id
PPID -> Parent process id
---------------------------------------------------------------------
SERVICES
---------------------------------------------------------------------
commands to update the system
PS: Yet to be covered in class but are important for
healthy system
--------------------------------------------------------------------
NETWORKING
Types of IP:
Priate : IP within the network
Public : Global Comm.
Static : It is constant
Dynamic: Keeps on changing
192.168.0
192.168.1
192.168.171
192.168.159
Versions of IP:
IPv4:
8 8 8 8
192.168.0.131 => 32 bits
1 2 3 4
CLASS: 126
A- 1.0.0.0 to 127.255.255.255 -> 16,777,200/300 Devices - MNC
B- 128.0.0.0 to 191.255.255.255 -> 65535 Devices - small MNC
C- 192.0.0.0 to 223.255.255.255 -> 255 Deviecs - LAN
1 ----- 255
IPv6:
====================================================================
MAC Add.
14-AB-C5-44-57-AA -> windows / dell(HP, len, etc)
8 8 8 8 8 8 => 48 bit
first 3 octate: vendor, company, org. (14-AB-C5)
last 3 octates: NIC -> first connection (44-57-AA)
ipv4 -> dynamic IP
=============================================
1. Binary conversion
1 1 0 1 1 0 1 -> binary
-------------
6 5 4 3 2 1 0
=============================================
2. Hexa Decimal
0 1 2 3 4 5 6 7 8 9 A B C D E F
10 11 12 13 14 15
A4F6
A 4 F 6 -> hexa
--------
3 2 1 0 -> indexing
====================================================================
Subnetting
192.168.0.1 - 192.168.0.255
192.168.0.1 = 32
8 8 8 8
00000000.00000000.00000000.00000000
8 16 24 32
11111111.11111111.11111111.11111111
10.0.1.1/8
32-8 => 24
129.1.2.31/16
32-16 = 16
192.168.0.1/24