From 18795757611193c96a7b945201b3565307429057 Mon Sep 17 00:00:00 2001 From: Aleksandr Zaitsev Date: Fri, 19 Jul 2024 15:24:06 +0300 Subject: [PATCH] add cli commands task file --- linux.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 linux.sh diff --git a/linux.sh b/linux.sh new file mode 100644 index 0000000..271a0bc --- /dev/null +++ b/linux.sh @@ -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 \ No newline at end of file