Education

Basics Commands of Linux with examples

Introduction

A feature of the Linux operating system is the command. By running commands, you can complete all simple and complex activities. The Linux terminal is used to run the commands. Similar to the command prompt in the Windows OS, the terminal is a command-line interface for interacting with the system. Linux commands are case-sensitive.

Compared to other operating systems like Windows and MacOS, Linux has a robust command-line interface. Through its terminal, we can perform both fundamental and sophisticated tasks. We can perform some simple operations like adding, removing, and moving files. Additionally, we are capable of performing complex jobs including networking chores, administrative tasks (such as package installation and user administration), and (ssh connections).

Linux terminal offers a variety of assistance features, making it a user-friendly terminal. Press “CTRL + ALT + T” keys together to open the Linux terminal, and then press the “ENTER” key to run a command.

Linux Commands with Diagrams:

  1. pwd

pwd is used to show the location of the current working directory.

Pwd working directory

2. mkdir

mkdir is used to create the new working directory.

working of mkdir

working of mkdir

3.rmdir

rmdir is used to delete the directory.

Working of rmdir

working of rmdir

4. ls

ls is used to show the list content of the directory.

working of ls

5. cd

cd is used to change the working directory.

workig of cd

6. cd ~

cd ~ is used to move to the previous directory.

Working of cd ~

7. touch

touch is used to create empty files.

working of touch

8. cat

cat command is used to write content in the file and display the content.

working of cat

cat command is also used to view the content of the file as well as to display the content.

how to view the content

9. rm

rm command is used to remove the file.

working of rm

10. cp

cp command is used to copy a file or directory.

working of cp

11. mv

mv is used to move files or directories from one location to another.

working of mv directory

12. head

head command is used to display the content of the file and the first 10 lines of the content.

working of head

13. tail

tail displays the last ten lines of the content of the file.

working of tail

14. tac

tac works in a reverse way and shows the content in reverse order.

working of tac

15. comm

comm is used to compare the files.

working of comm

16. wc

wc is used to count the words, characters, and lines in the file.

working of wc

17. od

od command is used to display the file content in different formats like octal, decimal, and hexadecimal.

working of od

18. gzip

gzip is used for reducing the file zip and compressing it.

working of gzip

19. gunzip

gunzip is used to decompress the file.

working of gunzip

These all are the necessary Linux commands to operate the Linux and ubuntu.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button