Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- unzip dummy.zip #unzips dummy.zip directory
- echo "enter three file types" #displays message to user for input
- read -r filetype1 filetype2 filetype3 #reads user input
- echo "enter your desired URL with the zip file to be downloaded"
- read -r userURL #reads user input for URL
- ${1+"$@"} #accepts variable number of command line arguments
- mkdir dir1 dir2 dir3 dir4 # creates directories called dir1 dir2 dir3 dir4
- mv ~tony/Desktop/unsorted_files/*.$filetype1 ~tony/Desktop/dir1 #moves all files of type specified as filetype1 in unsorted_files to dir1
- mv ~tony/Desktop/unsorted_files/*.$filetype2 ~tony/Desktop/dir2 #moves all files of type specified as filetype2 in unsorted_files to dir2
- mv ~tony/Desktop/unsorted_files/*.$filetype3 ~tony/Desktop/dir3 #moves all files of type specified as filetype3 in unsorted_files to dir3
- mv ~tony/Desktop/unsorted_files/* ~tony/Desktop/dir4 #moves all remaining files in unsorted_files to dir4
- ls -S ~tony/Desktop/dir1>Dir1SizeList.txt #sorts files in dir in order of size, largest first; outputs content of sorting to Dir1SizeList.txt file
- ls -S ~tony/Desktop/dir2>Dir2SizeList.txt #sorts files in dir2 in order of size, largest first; outputs content of sorting to Dir1SizeList.txt file
- ls -S ~tony/Desktop/dir3>Dir3SizeList.txt #sorts files in dir3 in order of size, largest first; outputs content of sorting to Dir1SizeList.txt file
- ls -S ~tony/Desktop/dir4>Dir4SizeList.txt #sorts files in dir4 in order of size, largest first; outputs content of sorting to Dir1SizeList.txt file
- mv ~tony/Desktop/Dir1SizeList.txt ~tony/Desktop/dir1 #moves .txt file to dir1
- mv ~tony/Desktop/Dir2SizeList.txt ~tony/Desktop/dir2 #moves .txt file to dir2
- mv ~tony/Desktop/Dir3SizeList.txt ~tony/Desktop/dir3 #moves .txt file to dir3
- mv ~tony/Desktop/Dir4SizeList.txt ~tony/Desktop/dir4 #moves .txt file to dir4
- ls -r ~tony/Desktop/{dir1,dir2,dir3,dir4} >> AllDirectoriesFileInfo.txt #sorts contents of directories contained within braces in reverse alphabetical order and stored in .txt file
- ls -l ~tony/Desktop/{dir1,dir2,dir3,dir4} >> AllDirectoriesFileInfo.txt #provides count of number of files in each directory, stores in .txt file
- curl -O $userURL #takes command line argument URL, and then downloads the file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement