Day 03 Learnings: Exploring Linux Commands
Welcome back to my Linux journey! Today, I dived deeper into understanding basic yet powerful Linux commands that are essential for navigating and organizing files within the Linux environment. Let’s walk through what I learned today, the steps I followed, the challenges I faced, how I resolved them, and the resources I utilized.
What I Learned This Week
How to Display Current Working Directory in Linux (
pwdCommand):
Thepwdcommand (Print Working Directory) helps you determine the exact path of the current directory you are in. It's particularly useful when navigating through multiple directories.How to Create Directories in Linux (
mkdirCommand):
Themkdir(Make Directory) command allows the creation of new directories. This is a straightforward yet crucial command for structuring files effectively in a Linux system.
Steps I Followed
Understanding the
pwdCommand:I opened the terminal and used the
pwdcommand to check the current directory path.Experimented by navigating through directories using the
cdcommand and confirm the location withpwd.
Using the
mkdirCommand:Ran
mkdir new_folderto create a single directory.Used
mkdir -p folder1/folder2/folder3to create nested directories.
Problems I Encountered
Incorrect Directory Path Errors:
While creating nested directories, I encountered an error because the parent directories didn't exist.Permission Denied Issue:
When attempting to create directories in certain system-level folders, I faced a "Permission Denied" error.
How I Solved These Problems
Resolving Path Issues:
Learned about the-pflag, which automatically creates parent directories if they don't exist. Usingmkdir -p, I was able to create nested folders without issues.Fixing Permission Denied Errors:
Discovered that administrative rights are required for some directories. By prefixing themkdircommand withsudo(e.g.,sudo mkdir restricted_folder), I was able to create directories in restricted areas.
Resources I Used
Linux Command Documentation
Linux Basics for Beginners on YouTube
Online forums like Stack Overflow for troubleshooting common errors.
Conclusion
Today's learning reinforced the significance of mastering fundamental commands such as pwd and mkdir. These commands are the building blocks for efficient file and directory management in Linux. As I progress, I'm gaining confidence in navigating and organizing files effectively.
Stay tuned for Day 04 learnings!x commands and dive into file operations. See you then!