FolSec Linux Disk Enlargement
The disk
size of the linux machine on VMware is increased.
“reboot” The machine is restarted with the command.
“cfdisk” command is typed.
“dev/sda3” Click the Resize button.
The new dimension appears and click enter.
You will see the Write option.
“yes” Written.
Hit the Quit button and log out.
On a Linux machine, go to “cd /folsec/bin”
“bash extend_disk_space.sh” The command is executed.
Changing rope
“cd /folse/bin” Written.
“bash ip_setup.sh” Written.
DNS Change Command
sudo nano
/etc/resolv.conf
# nameserver
8.8.8.8
# nameserver
8.8.4.4
sudo
systemctl restart systemd-resolved
Linux Machine Name Change Command
sudo
hostnamectl set-hostname yeni-isim
sudo nano
/etc/hosts
# 127.0.0.1
localhost yeni-isim
Docker Update Command
“docker
compose down” Closes services.
“docker
compose pull backend” backend update command.
“docker
compose pull client” client update command.
“docker
compose up --build -d” Command to uninstall services.
“docker logs
folsec-backend -f” If the control command says Application Start up, you can
leave the command line and switch to the interface by doing ctrl + z within 15
– 20 seconds.
Disk Size Learning Command
“df -h”
Command to Learn RAM Usage
“free -m”
IP Address Learning Command
ip addr show
| System / File Management Commands | |||
| Command | Description | Example Usage | |
| pwd | Shows the current directory | pwd → /home/tevfik | |
| ls | Lists files and folders in the directory | ls -l | |
| cd | Change directory | cd Documents | |
| mkdir | Create a new folder | mkdir NewFolder | |
| rmdir | Remove an empty folder | rmdir OldFolder | |
| touch | Create a new file | touch file.txt | |
| cp | Copy file/folder | cp file.txt copy.txt | |
| mv | Move or rename file/folder | mv file.txt NewFile.txt | |
| rm | Delete file or folder | rm file.txt / rm -r FolderName | |
| cat | View file content | cat file.txt | |
| nano | Edit file in terminal | nano file.txt | |
| chmod | Change file/folder permissions | chmod 755 script.sh | |
| chown | Change file/folder ownership | chown tevfik:tevfik file.txt | |
| grep | Search inside files | grep "searched_word" file.txt | |
| System / Process and Service Management | |||
| Command | Description | Example Usage | |
| top | Shows system and process status | top | |
| ps | Lists running processes | ps aux | |
| sudo | Run commands with administrative privileges | sudo apt update | |
| apt | Package management (install/update/remove) | sudo apt install git / sudo apt remove git | |
| dpkg | Query package status | dpkg -l | |
| systemctl | Start, stop, check status of services | sudo systemctl start apache2 | |
| service | Alternative service management command | sudo service apache2 restart | |
| df | Show disk usage | df -h | |
| du | Show file/folder size | du -sh Documents/ | |
| Network / Networking Commands | |||
| Command | Description | Example Usage | |
| ifconfig / ip a | Show network interfaces | ifconfig / ip a | |
| ping | Test connectivity to another computer | ping 8.8.8.8 | |
| netstat | Show network connections and ports | netstat -tulnp | |
| ss | Show active connections and port status | ss -tuln | |
| ufw | Firewall enable/disable and management | sudo ufw enable / sudo ufw disable | |
| wget | Download a file | wget https://example.com/file.zip | |
| curl | Fetch data from web | curl https://example.com | |
| netplan apply | Apply Netplan configuration files | sudo netplan apply | |
| netplan generate | Check Netplan configuration | sudo netplan generate | |
| netplan try | Test Netplan changes | sudo netplan try | |
| netplan --debug apply | Apply Netplan with detailed output | sudo netplan --debug apply | |
| Docker Commands | |||
| # | Command | Description | Example Usage |
| 1 | docker --version | Shows Docker version | docker --version |
| 2 | docker info | Provides detailed info about Docker | docker info |
| 3 | docker pull | Download image from Docker Hub | docker pull ubuntu:22.04 |
| 4 | docker images | List local Docker images | docker images |
| 5 | docker rmi | Remove Docker image | docker rmi ubuntu:22.04 |
| 6 | docker run | Create and run a new container | docker run -it ubuntu:22.04 bash |
| 7 | docker ps | List running containers | docker ps |
| 8 | docker ps -a | List all containers (including stopped) | docker ps -a |
| 9 | docker stop | Stop a container | docker stop container_id |
| 10 | docker start | Start a container | docker start container_id |
| 11 | docker restart | Restart a container | docker restart container_id |
| 12 | docker rm | Remove a container | docker rm container_id |
| 13 | docker exec | Run command inside a running container | docker exec -it container_id bash |
| 14 | docker logs | View container logs | docker logs container_id |
| 15 | docker build | Build image from Dockerfile | docker build -t myimage:latest . |
| 16 | docker tag | Add a new tag to image | docker tag myimage:latest myrepo/myimage:v1 |
| 17 | docker push | Push image to Docker Hub | docker push myrepo/myimage:v1 |
| 18 | docker inspect | Detailed info about container or image | docker inspect container_id |
| 19 | docker network ls | List Docker networks | docker network ls |
| 20 | docker volume ls | List Docker volumes | docker volume ls |