INTRODUCTION TO LINUX

INTRODUCTION TO LINUX

What is LINUX?

Just like Windows, iOS, and Mac OS, Linux is an operating system. Linux is a powerful and versatile operating system known for its command- line interface, which allows users to perform a wide range of tasks efficiently,

An operating system is software that manages all the hardware resources associated with your desktop or laptop. To put it simply, the operating system manages the communication between your software and your hardware. Without the operating system (OS), the software wouldn’t function.

One of the fundamental operations in Linux is managing directories, which involves tasks like checking you present working directory, listing files and directories (including the hidden ones) and creating the nested directories.

So here we will be exploring the few Linux command which you need to know in this journey.

1.Checking your present working directory: - First we need to know what present working directory is, so present working directory is the directory in which your terminal or shell session is currently located. To check your present working directory, you can use pwd command.

pwd- print work directory. Gives the present working directory.

pwd command will display path of the current directory.

2. Listing Files and Directories: - To list all the files and directories in the current directory, including the hidden files (those which start with ‘.’(dot)), you can use the ls command with the -a flag. You will get the list of all the files and directories in the current location.

ls -a

The -a flag instruct the ls command to show the hidden files. You will get the list of all the files and directories in the current location.

3. Creating a Nested Directory

Creating a nested directory structure in LINUX is easy and quite straightforward. You can use mkdir command to make one or more directories, including the nested directories.

Suppose we need to create a directory structure like “a/b/c/d/e”, then we can use the -p option with mkdir command, which ensures that parent directories are created if they don’t exist.

In the terminal, we can execute the following command.

mkdir -p a/b/c/d/e

The above command will create the directory structure a/b/c/d/e also it will create any missing parent directories along the way.

LISTING COMMANDS

ls option_flag arguments – list the sub directories and files available in the present directory.

Examples: -

1.?????? ls -l a list files and directory in long list format with extra information.

2.?????? ls -a a list all the hidden files and directory.

3.?????? ls *.sh a list all the files having .sh extension.

4.?????? ls -i a list files and directory with index number in order.

5.?????? ls -d */ a list only directories (we can also specify a pattern)

DIRECTORY COMMANDS

1.?????? pwd – print work directory. Gives the present working directory.

2.?????? cd path_to_directory – change directory to the provided path.

3.?????? cd – change directory to the home directory.

4.?????? cd.. – change directory to one step back.

5.?????? cd../.. – change directory to 2 levels back.

6.?????? mkdir directory_Name – to make directory in a specific location.

7.?????? mkdir .New_folder – make a hidden directory (also dot(‘.’) before a file make it hidden)

要查看或添加评论,请登录

Riya Negi的更多文章

  • Kubernetes Overview

    Kubernetes Overview

    What is Kubernetes and Why Do We Call It K8s? Kubernetes (often abbreviated as K8s) is an open-source platform for…

    1 条评论
  • Jenkins Important Interview Questions

    Jenkins Important Interview Questions

    Important Interview Questions. Jenkins is a cornerstone of modern CI/CD pipelines, and mastering it can give you a…

  • Mastering Jenkins Agents!

    Mastering Jenkins Agents!

    The Jenkins Master, often referred to as the Jenkins Server, is the core component in a Jenkins architecture. It…

  • Jenkins Declarative Pipeline with Docker

    Jenkins Declarative Pipeline with Docker

    Hello Connections, So we will start with Jenkin Declarative pipeline with Docker. Before that we should know why to…

    2 条评论
  • Jenkins Declarative Pipeline

    Jenkins Declarative Pipeline

    So, Lets go deep into Jenkins and learn to start Pipeline in Jenkins. First let basics of Pipeline and all stuffs.

  • Complete Jenkins CI/CD Project

    Complete Jenkins CI/CD Project

    Let Set Up the Jenkins CI/CD Project For this follow these step carefully and here we begins Step 1: Fork the…

  • Jenkins Freestyle Project for DevOps Engineers.

    Jenkins Freestyle Project for DevOps Engineers.

    What is CI/CD? CI/CD stands for Continuous Integration (CI) and Continuous Deployment (CD) (or Continuous Delivery). It…

  • Getting Started with Jenkins

    Getting Started with Jenkins

    What is Jenkins? Jenkins is an open-source continuous integration (CI) and continuous delivery/deployment (CD)…

  • Docker Important interview Questions.

    Docker Important interview Questions.

    1. What is the difference between an Image, Container, and Engine? Image: An image is a lightweight, stand-alone…

  • Docker Cheat Sheet

    Docker Cheat Sheet

    Docker is a powerful tool for containerization that enables developers to package applications along with their…

社区洞察

其他会员也浏览了