Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mkdir 20118025
- cd 20118025
- mkdir documents documents/results scripts
- cd documents/
- touch file1.doc file2.doc file3.doc file4.doc
- cd ../scripts/
- touch script.sh
- cd ..
- chmod 771 scripts/* scripts
- cd results/
- touch count
- cd ..
- cd scripts/
- vi script.sh
- #!/bin/bash
- # Count the number of files in the documents directory
- num_files=$(ls ../documents | wc -l)
- # Write the result to a file named count in the results directory
- echo $num_files > ../documents/results/count
- # List all directories in the documents folder and save the result in a file
- #!/bin/bash
- cd ../documents/results
- cd ..
- ls -d */ > ./results/files
- #List all files with .png extension
- #!/bin/bash
- cd ../results
- touch test
- cd ..
- ls -l img/ | egrep '\.png$' > results/test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement