Activity: Practice Linux Command
Step 1: Log in to PythonAnywhere
Go to pythonanywhere.com.
Log in to your account.
Open a Bash Console from your dashboard.
Step 2: Create 20 Directories/Folders
Once you are inside the Bash Console, execute the following command to create 20 directories. This example creates various types of directories (e.g., documents
, music
, etc.):
documents
pictures
downloads
music
videos
projects
notes
backups
reports
logs
work
templates
drafts
code
images
scripts
tests
archives
configs
keys
resources
Verify the directories were created using the ls
command:
This will list all the directories you just created.
Step 3: Add 10 Files to the "documents" Folder
Now, navigate to the documents
directory and create 10 files inside it:
file1.txt file2.txt file3.txt file4.txt file5.txt
file6.txt file7.txt file8.txt file9.txt file10.txt
To verify that the files were created, list the contents of the documents
folder:
Step 4: Removing Files from the Documents Folder
remove a specific file from the documents
folder, use the rm
command:
Step 5: Removing Directories
If you need to remove a specific directory, you can use the rm -r
command. This removes the directory and its contents recursively.
To remove the documents
directory:
rm -r documents
Step 6: Document Your Process on Hashnode
Steps for Documentation:
Sign in to Hashnode: Go to hashnode.com and sign in to your account.
Create a New Blog Post: Start a new post to document your process.
Title Suggestion: "Managing Files and Folders on PythonAnywhere with Bash Commands"
Content Outline:
Introduction: Briefly explain the task of creating, managing, and removing directories and files using Bash.
Creating Directories:
Explain the command used to create 20 directories.
Add the command used and any details about the purpose of these directories.
Adding Files:
Describe how you added 10 files to the
documents
directory using thetouch
command.Show the command and explain the verification process with the
ls
command.
Removing Files and Directories:
Explain how to remove files using the
rm
command.Show how to remove directories recursively with
rm -r
.
Conclusion: Summarize the importance of these commands for file and folder management in a Bash environment.
Include Code Snippets: Add snippets of the commands used for easy reference.
Publish: Once the blog post is complete, publish it.
Recap of What You Did:
Created 20 directories using
mkdir
.Added 10 files to the
documents
folder usingtouch
.Removed files using the
rm
command.Removed directories using
rm -r
.Documented your process on Hashnode.
Now, share your Hashnode post link on the svfc portal once it's published!