Commit 8c2379ee authored by laila.alabdullah's avatar laila.alabdullah

add files_1to10_atoz.sh

parents
#!/bin/bash
#step1
cd $HOME
mkdir files
cd files
#step2
touch file{1..10}_{a..z}
#step3
for f in *x ; do
echo "Hello Linux" >> "$f"
done
#step4
mkdir {a..z}
find -name "file*a" -exec mv {} a \; 2> /dev/null
find -name "file*b" -exec mv {} b \; 2> /dev/null
find -name "file*c" -exec mv {} c \; 2> /dev/null
find -name "file*d" -exec mv {} d \; 2> /dev/null
find -name "file*e" -exec mv {} e \; 2> /dev/null
find -name "file*f" -exec mv {} f \; 2> /dev/null
find -name "file*g" -exec mv {} g \; 2> /dev/null
find -name "file*h" -exec mv {} h \; 2> /dev/null
find -name "file*i" -exec mv {} i \; 2> /dev/null
find -name "file*j" -exec mv {} j \; 2> /dev/null
find -name "file*k" -exec mv {} k \; 2> /dev/null
find -name "file*l" -exec mv {} l \; 2> /dev/null
find -name "file*m" -exec mv {} m \; 2> /dev/null
find -name "file*n" -exec mv {} n \; 2> /dev/null
find -name "file*o" -exec mv {} o \; 2> /dev/null
find -name "file*p" -exec mv {} p \; 2> /dev/null
find -name "file*q" -exec mv {} q \; 2> /dev/null
find -name "file*r" -exec mv {} r \; 2> /dev/null
find -name "file*s" -exec mv {} s \; 2> /dev/null
find -name "file*t" -exec mv {} t \; 2> /dev/null
find -name "file*u" -exec mv {} u \; 2> /dev/null
find -name "file*v" -exec mv {} v \; 2> /dev/null
find -name "file*w" -exec mv {} w \; 2> /dev/null
find -name "file*x" -exec mv {} x \; 2> /dev/null
find -name "file*y" -exec mv {} y \; 2> /dev/null
find -name "file*z" -exec mv {} z \; 2> /dev/null
#step5
find -name "file[3,4]_*" -exec rm {} \;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment