Created
November 2, 2020 09:57
-
-
Save singh011/04f63df980db19481a9480c4b4f8a852 to your computer and use it in GitHub Desktop.
Dharmendra_CLI_Drills_I
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q1. Create the following directory structure. (Create empty files where necessary) | |
Solution:- | |
:~$ mkdir hello | |
:~$ mkdir hello/five hello/one | |
:~$ cd hello | |
:~/hello$ ls | |
five one | |
:~/hello$ mkdir five/six | |
:~/hello/five$ ls | |
six | |
:~/hello/five/six$ touch c.txt | |
:~/hello/five/six$ mkdir seven | |
:~/hello/five/six$ ls | |
c.txt seven | |
:~/hello/five/six$ cd seven | |
:~/hello/five/six/seven$ touch error.log | |
:~/hello/five/six/seven$ ls | |
error.log | |
:~/hello$ cd one | |
:~/hello/one$ touch a.txt b.txt | |
:~/hello/one$ mkdir two | |
:~/hello/one$ ls | |
a.txt b.txt two | |
:~/hello/one$ cd two | |
:~/hello/one/two$ touch d.txt | |
:~/hello/one/two$ mkdir three | |
:~/hello/one/two$ ls | |
d.txt three | |
:~/hello/one/two$ cd three | |
:~/hello/one/two/three$ touch e.txt | |
:~/hello/one/two/three$ mkdir four | |
:~/hello/one/two/three$ ls | |
e.txt four | |
:~/hello/one/two/three$ cd four | |
:~/hello/one/two/three/four$ touch access.log | |
:~/hello/one/two/three/four$ ls | |
access.log | |
Q2:-Delete all the files having the .log extension | |
:~/hello/one/two/three/four$ rm access.log | |
:~/hello/five/six/seven$ rm error.log | |
Q3:- Add the following content to a.txt | |
nano a.txt | |
Q4:-Delete the directory named five. | |
rm -r five | |
Q5:-Rename the one directory to uno. | |
mv one uno | |
Q6:- Move a.txt to the two directory. | |
mv a.txt two | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment