Script 1
Script 1
#!/bin/bash
#!/bin/bash
#!/bin/bash
if [ -f /path/to/file ]; then
else
fi
#!/bin/bash
if [ "$(id -u)" -ne 0 ]; then
exit 1
fi
#!/bin/bash
uptime
#!/bin/bash
df -h > disk_usage_report.txt
#!/bin/bash
mv "$file" "${file%.jpg}.png"
done
#!/bin/bash
ping -c 4 $ip
done
9. Create Multiple Directories
#!/bin/bash
mkdir $dir
done
#!/bin/bash
cat /proc/cpuinfo
#!/bin/bash
#!/bin/bash
#!/bin/bash
#!/bin/bash
#!/bin/bash
ping -c 4 google.com
#!/bin/bash
useradd "$user"
#!/bin/bash
#!/bin/bash
#!/bin/bash
free -m
#!/bin/bash
cat /etc/os-release
#!/bin/bash
#!/bin/bash
read a b
#!/bin/bash
ps aux
24. Kill a Process by Name
#!/bin/bash
pkill -f process_name
#!/bin/bash
while true; do
sleep 5
done
#!/bin/bash
gzip *.log
#!/bin/bash
#!/bin/bash
#!/bin/bash
#!/bin/bash
wget http://example.com/file.zip
#!/bin/bash
last
#!/bin/bash
#!/bin/bash
mv "$file" "new_${file}"
done
uptime
#!/bin/bash
top
#!/bin/bash
mkswap /swapfile
swapon /swapfile
#!/bin/bash
dpkg -l
#!/bin/bash
if [ ! -s /path/to/file ]; then
fi
#!/bin/bash
free -h
#!/bin/bash
docker ps
#!/bin/bash
df -h
#!/bin/bash
ifconfig
#!/bin/bash
useradd newuser
#!/bin/bash
#!/bin/bash
#!/bin/bash
#!/bin/bash
tail -f /var/log/syslog
#!/bin/bash
for i in {10..1}; do
echo $i
sleep 1
done
#!/bin/bash
whoami