-
Example_init
- Create a file:
mkdir create-directory-structure.sh - Create the script file and open it in a text editor:
vim create-directory-structure.sh - Copy and paste the following script content into the text editor:
``` # Create directories mkdir -p /home/iamrlz/countries/Pakistan /home/iamrlz/countries/USA /home/iamrlz/countries/UK # Create capital.txt files and add capital cities' names echo "Islamabad" > /home/iamrlz/countries/Pakistan/capital.txt echo "Washington, D.C" > /home/iamrlz/countries/USA/capital.txt echo "London" > /home/iamrlz/countries/UK/capital.txt # Print the system uptime uptime ```- Make the script executable:
chmod +x create-directory-structure.sh - Run the script:
create-directory-structure.sh
- Create a file: