---
# System prepended metadata

title: Linux-Basic

---

# Linux-Basic

Unix -> Linux -> Ubuntu(ram 512), Debian 

[TOC]

# File systems 

## Basic cmd 
ls,cd,cat,pwd
tocuh,mkdir,cp,mv,rm,file(determining file type )



## Search File

### find (search the file)

```
find -name password
```

```
find -name *.txt
```

![](https://i.imgur.com/uxG1HzH.png)

### grep (search the content of file)

```
grep '12.23.4.1' access.log
```


```
wc -l access.log
```
![](https://i.imgur.com/GavzuVx.png)


## Permission 

```
ls -la 
```

![](https://i.imgur.com/DSz2qkz.png)


### su --login user2

![](https://i.imgur.com/m8uZ32A.png)


# Shell Operator

## &
![](https://i.imgur.com/oinoCXr.png)

## &&

![](https://i.imgur.com/NqcowVu.png)

## > (overwrite)

![](https://i.imgur.com/aQr8teG.png)


## >>

![](https://i.imgur.com/XqLKAGL.png)


# SSH 

![](https://i.imgur.com/XbZQOmv.png)

# Flag/switch 

![](https://i.imgur.com/kmyZuUm.png)

# Directory 

## /etc

Store systems files 
![](https://i.imgur.com/7HOSHnl.png)


## /var

Store for variable files
![](https://i.imgur.com/OxquhaU.png)


## /root

/root = /home/root

![](https://i.imgur.com/HDZyQzE.png)


## /tmp

![](https://i.imgur.com/U8ReQEL.png)



# Download File 

## wget (HTTP)

![](https://i.imgur.com/m40JZWx.png)


## scp

![](https://i.imgur.com/2qjnD1K.png)

![](https://i.imgur.com/0xI4joN.png)



## Static file server 

![](https://i.imgur.com/DVtIYUl.png)


# Process 

## kernel

![](https://i.imgur.com/5wCgjtE.png)


## Viewing Process 

```
ps
```

```
aux
```

![](https://i.imgur.com/MKq7MmK.png)

![](https://i.imgur.com/a5vPcJW.png)


###  Real-time Static

```
top    
```

## Managing Process 

![](https://i.imgur.com/QU8bpQB.png)


- kill
- sigterm
- sigkill
- sigstop


## How do process start 

### Name space

![](https://i.imgur.com/7Hs39No.png)

### Initial Start

![](https://i.imgur.com/XsGytAB.png)


## Getting Process 


### systemd 

![](https://i.imgur.com/ZT2lYY7.png)


### systemctl 

![](https://i.imgur.com/cIWIYEH.png)

## Process front/background in Linux 


### echo 

![](https://i.imgur.com/JeKY1oA.png)


### Foreground process 

```
fg
```

![](https://i.imgur.com/p3V5jFb.png)

# Maintaining Systems


## Automation


```
cron
```

![](https://i.imgur.com/2VlvuAI.png)


## package management 

![](https://i.imgur.com/j6wHS2b.png)


## logs 

![](https://i.imgur.com/P9RaJI4.png)

- fail2ban (Defense sowfware)