add cli commands task file

This commit is contained in:
Aleksandr Zaitsev 2024-07-19 15:24:06 +03:00
parent eaf769177f
commit 1879575761

31
linux.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
# 1. Connect to the server
ssh user@192.168.1.10
# 2. Navigate to /var/log
cd /var/log
# 3. List files and directories and save to log_list.txt
ls > ~/log_list.txt
# or with details
ls -la > ~/log_list.txt
# 4. Create a new user named testuser without a home directory
sudo useradd -M testuser
# 5. Create a directory named testdir in your home directory
cd ~
mkdir testdir
# 6. Change permissions of testdir
chmod 700 testdir
# 7. Display the current network configuration
ifconfig
# or
ip addr
# 8. Update the package list and install curl for debian and ubuntu and other debian based distro
sudo apt update
sudo apt install -y curl