Skip to main content

Command Palette

Search for a command to run...

Linux Basics (Day 02): Mastering Essential Terminal Commands πŸš€πŸ’»

Updated
β€’2 min readβ€’View as Markdown
A

DevOps Enthusiast | Python | Chef | Docker | GitHub | Linux | Shell Scripting | CI/CD & Cloud Learner | AWS

What is Linux?

Linux is an open-source, Unix-like operating system (OS) based on the Linux kernel, created by Linus Torvalds in 1991.Before Linux was created in 1991 by Linus Torvalds, most operating systems were:

  • Expensive – UNIX was powerful but costly.

  • Proprietary – Windows and macOS restricted user control.

  • Limited – No free, customisable alternative for developers and businesses.

Linux is a kernel, not a full operating system. However, it is often referred to as an OS because it is the core component of Linux-based operating systems (also called Linux distributions).

  • Linux = Kernel (the core system software).

  • Linux-Based OS = Kernel + Tools + UI + Applications.

    When people say β€œLinux,” they usually mean a Linux-based OS , but technically, Linux itself is just the kernel.

Basic Commands:

Check your present working directory.

In Linux, you can check your present working directory (PWD) by using the following command in the terminal:

Input:

pwd

Explanation:

  • pwd stands for Print Working Directory.

  • It shows the absolute path of the current directory you are in.

Output:

/home/user/Documents

List all the files or directories including hidden files.

To list all files and directories, including hidden files, in Linux, use ls-a.

Input:

ls-a

Explanation:

  • ls β†’ Lists files and directories.

  • -a β†’ Shows all files, including hidden files (files starting with .).

Output:

.  ..  .bashrc  .profile  Documents  Downloads  Pictures
  • . β†’ Represents the current directory.

  • .. β†’ Represents the parent directory.

  • Files like .bashrc, .profile are hidden files.

Create a nested directory A/B/C/D/E.

To create a nested directory structure (A/B/C/D/E) in Linux, we use mkdir -p A/B/C/D/E.

Input:

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

Explanation:

  • mkdir β†’ Creates a directory.

  • -p (--parents) β†’ Creates all parent directories if they don’t exist.

41 views

More from this blog

9

90daysofDevOps

47 posts