Last active
April 30, 2024 10:21
-
-
Save yasaswi-24/2b64463ff96a04691835412079f51210 to your computer and use it in GitHub Desktop.
CLI Drill1
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
#Structure of drill creation. | |
pwd | |
#it is to check at present in which directory we are. | |
mkdir hello | |
#To create directory | |
cd hello | |
#cd means change directory ,here to create subdirectories and files we are going to hello. | |
mkdir five one | |
#now we are into hello--here we are creating two directories one is five and other is one. | |
ls | |
#to see files in hello. | |
cd five | |
#now entering into directory five. | |
$ mkdir six | |
#in directory five we are creating one subdirectory that is six. | |
cd six | |
#now going to directory six. | |
touch c.txt | |
#here creating the file with name c.txt in directory name six. | |
cat > c.txt | |
#I am inserting text to c.txt,we can use nano also here.This is c text file.This contains important info----This is information in c.txt | |
cat c.txt | |
#To display information in c.txtyasaswi@yasaswi-Type1ProductConfigId:~/hello/five/six$ mkdir seven | |
cd seven | |
#now going into seven directory | |
touch error.log | |
#created error.log file here | |
cd ../../.. | |
#as we have created two directories in hello,one is completed and to go to other one we should goto hello again know for that it is command. | |
cd one | |
#now we went to hello to go to one directory. | |
touch a.txt b.txt | |
#in that craete two text files. | |
mkdir two | |
#in that one directory is also created | |
cat>a.txt | |
#now inserting text into a.txt | |
cd two | |
#after that going to two directory | |
touch d.txt | |
#here one text file is created | |
mkdir three | |
#one directory named three has created. | |
cd three | |
#after that went to directory three | |
touch e.txt | |
#created one text file | |
mkdir four | |
#created one directory | |
cd four | |
#now went to four | |
touch access.log | |
#created access.log | |
#Till here the structure given is completed. | |
# Answers for Questions given in drill | |
rm *.log | |
#Delete all the files having the .log extension | |
nano a.txt | |
#To open a.txt to add text or update. | |
rmdir five | |
#Delete the directory named five | |
mv one uno | |
#Rename the one directory to uno | |
#to rename mv is used mv old name new name | |
mv a.txt two | |
#Move a.txt to the two directory | |
#here also mv command is used to move text file to two directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment