Basics of Linux

Basics of Linux

Linux:

Linux is a free, open-source operating system based on Unix and capable of running on a variety of hardware with heavy operating demands. It is developed by Linus Torvalds in Sep 1991.

Pros and Cons of Linux OS:

What is Linux Operating System?

What is Linux Operating System?

Basic Commands of Linux

pwd -> it shows the present working directory

ls -> it shows available files and directory list in the present working directory

uname -> it shows the name of the kernel

uname -r -> it shows a version of the kernel

cd -> to change the directory

clear-> use to clear screen

whoami ->currently login user

history -> it shows the list of previously used commands

date -> current date and time

Create a file or directory

To Create a single directory

-> mkdir devops

To Create multiple directories

-> mkdir qa dev test

Directory path(directory inside the directory)

->mkdir -p /dev/qa/test/devops

To create several directories

->mkdir /student{1..10}

Create File:

Touch: The touch command is used to create an empty file, we can’t write data in a file, can’t edit or save a file.

To create a single file

->touch notes

To create multiple files

->touch python java c#

To create several files

->touch books{1..10}

For Copy and paste

cp: It is used to copy and paste files or directory

Syntax: cp <option> <source> <destination>

Options:

-r for recursive

-v for verbose

-f for forcefully

For copy file

->cp -rvf devops/hello.txt /home

To copy all data which start from the D alphabet

->cp -rvf /root/D* /home

To remove files and directory

->rm -rvf /devops/hello.txt

For moving or renaming files and directory

->mv /home/dev /root/Desktop

For renaming files or directory

->mv dev devops

Thank you for reading this Blog. Hope you learned something new today! If you found this blog helpful, please share it with others.