DEV Community

Chirag Kumar
Chirag Kumar

Posted on

Basic CLI Commands

➔ Open Terminal

➔ Know where you are? Present Working Directory

Image description

➔ Create a directory/folder in your home directory

Image description

➔ Change your current working directory to linux-practices(Go to linux-practices folder).

Image description

➔ Create some more directories and list them with “ls” command.

Image description

➔ Create some empty files with “touch” command and list them.

Image description

➔ Reconfirm your location in your system

Image description

Absolute path and Relative path

What is a path?

A path is a unique location of a file or a folder in a file system of an OS. A path to a file is a combination of / and alpha-numeric characters.

What is an absolute path?

An absolute path is defined as specifying the location of a file or directory from the root directory(/). In other words, an absolute path is a complete path from the start of the actual filesystem from the / directory.

Some examples of the absolute path:
/home/imran/linux-practices/
/var/ftp/pub
/etc/samba.smb.conf
/boot/grub/grub.conf

If you see all these paths started from the / directory which is a root directory for every Linux/Unix machine.

What is the relative path?

The relative path is a path related to the present working directory(pwd). Suppose I am located in /home/imran and I want to change the directory to /home/imran/linux-practices. I can use the relative path concept to change the directory to Linux practices and also the devopsdir directory.

Image description

If you see all these paths did not start with / directory.
➔ Creating directories in devopsdir directory with absolute and relative path.

Image description

➔ Copying files into directory.

Image description

➔ Copying directories from one location to another.

Image description

➔ Moving files from one location to another.

Image description
Image description

➔ Removing files and directories.

Image description

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more