HI, pleas help me to solve this quesation : In Centos 7, using shell expansion…
- User
HI, pleas help me to solve this quesation : In Centos 7, using shell expansion techniques, and the minimum number of commands required, create the parent folder S23, which contains three subfolders (Backup--docs-Media) The (Backup) subfolder contains one subfolder (month), the (docs) subfolder contains 4 subfolders (A, B, C, D), and the (Media) subfolder contains 3 subfolders (audio - video -image) Note: The month directory must be a function that gives the date it was created and is not just a static word created and it is not just static word.Using absolute paths only, go to the images directory, and from there – using only relative paths – create 4 files in the subdirectories A, B, C, D of the docs directory
- Assistant
To create the folder structure as mentioned in the question, you can use the following commands:
Step 1: Create the parent folder "S23" and navigate to it.
mkdir S23 cd S23Step 2: Create the subfolders "Backup", "docs", and "Media".
mkdir Backup docs MediaStep 3: Inside the "Backup" folder, create the "month" subfolder.
mkdir Backup/monthStep 4: Inside the "docs" folder, create the subfolders "A", "B", "C", and "D".
mkdir docs/A docs/B docs/C docs/DStep 5: Inside the "Media" folder, create the subfolders "audio", "video", and "image".
mkdir Media/audio Media/video Media/imageStep 6: To create four files inside the "image" subfolder of the "Media" folder, you will need to navigate to the "image" subfolder first using absolute path and then create the files using relative paths.
cd Media/image touch ../../../docs/A/file1 touch ../../../docs/B/file2 touch ../../../docs/C/file3 touch ../../../docs/D/file4And that's it! You have successfully created the required folder structure and the four files inside the "docs" subfolders using absolute and relative paths.