Linux For Devops

Linux For Devops

Day 2 : Basics Linux Command

ยท

2 min read

1: Checking your present working directory.

In the world of programming and file management, it is crucial to be able to navigate through directories and efficiently locate files. In this blog post, we will explore how to check your present working directory, list all files (including hidden ones), and create a nested directory structure using emojis and bullet points for enhanced readability.

Checking Your Present Working Directory Before we dive into the details of listing files and directories, let's start by understanding how to check your present working directory. The present working directory refers to the directory in which your current session or program is running.

To check your present working directory, follow these steps:

  1. Open your linux terminal or command prompt.

  2. Type the command pwd (short for "print working directory") and press Enter.

The output will display the path to your present working directory.

2: List all the files or directories including hidden files.

๐Ÿ“Œ To list all files and directories, including hidden ones:

  1. Open your terminal or command prompt.

  2. Navigate to the directory you want to list the files and directories from, using the cd command.

  3. Once you're in the desired directory, use the command ls -a to list all files and directories, including hidden ones.

  4. The output will display a list of files and directories, including hidden files that start with a dot (e.g., .gitignore, .bashrc).

3: Create a nested directory A/B/C/D/E

To create a nested directory structure follow these steps:

  1. Open your linux terminal or command prompt.

  2. Use the below commands to create the nested directories:

mkdir -p A/B/C/D/E

Visual representation of the nested directory structure :

๐Ÿ“‚ A

  • ๐Ÿ“‚ B

    • ๐Ÿ“‚ C

      • ๐Ÿ“‚ D

        • ๐Ÿ“‚ E

Conclusion: In this blog post, we explored how to check your present working directory, list all files (including hidden ones), and create a nested directory structure using emojis and bullet points for improved readability. By mastering these techniques, you can enhance your file management skills and streamline your workflow.

ย