In: Computer Science
Use Vi text editor or ATOM to create a bash script file. Use the file name ayaan.sh. The script when ran it will execute the following commands all at once as script. Test your script file make sure it works.
Here is the list of actions the script will do:
Thank you in advance. Please show screenshots so I can learn what you did. I'm stuck
BASH Script:
#!/bin/bash # Go to home directory first cd ~ # Create directory structure data2/new2/mondaynews in the home directory mkdir data2 mkdir data2/new2 mkdir data2/new2/mondaynews # Go to mondaynews folder cd data2/new2/mondaynews # Create four files sports.txt, baseball.txt, file1.txt and file2.txt # Here file1 and file2 are hidden by using dot (.) before their names touch sports.txt baseball.txt .file1.txt .file2.txt # Display all files (hidden and not hidden) using ls command ls -a # Redirect output of ls command to a new file called show4files.txt ls -a > show4files.txt # Return to home directory cd ~
BASH SCRIPT SCREENSHOT:
TERMINAL OUTPUT:
FOR ANY HELP JUST DROP A COMMENT