In this blog, we are going to learn basic commands which every beginner should know about.
What is Linux?
Linux is an open-source, Unix-like operating system kernel originally created by Linus Torvalds in 1991. It serves as the core component of many different Linux distributions or "distros." A Linux distribution is a complete operating system that includes the Linux kernel, system utilities, libraries, and often a graphical user interface (GUI).
What is Bash?
Bash, short for "Bourne Again Shell," is a widely used Unix-like shell or command-line interpreter for Linux and other Unix-based operating systems. It is the default shell for most Linux distributions and is designed to provide a text-based interface for interacting with the operating system.
Why use Linux?
There are several compelling reasons to use Linux as your operating system of choice. Whether you're an individual user, a developer, a system administrator, or an organization, Linux offers a range of benefits that make it a popular and powerful choice. Here are some of the key reasons to use Linux:
Open Source and Free: Linux is distributed under open-source licenses, which means you have access to its source code and can modify and distribute it freely. This reduces software costs and allows for greater transparency and security.
Customization: Linux is highly customizable. You can choose from a variety of desktop environments, themes, and software packages to create a personalized computing experience that suits your preferences.
Stability and Reliability: Linux is known for its stability and reliability. It can often run for long periods without needing to be rebooted, making it a dependable choice for servers and critical systems.
Security: Linux has a robust security model with user-based permissions and a separation between user and administrative privileges. It's less susceptible to malware and viruses compared to other operating systems.
Performance: Linux is efficient in terms of system resource usage. It can run on older hardware and still provide excellent performance, making it suitable for various devices, including low-power systems.
Vast Software Repository: Most Linux distributions offer extensive software repositories with thousands of applications, libraries, and development tools. You can easily install and update software using package managers.
Command Line Power: Linux provides a powerful command-line interface (CLI) that allows you to perform a wide range of tasks efficiently. This is particularly valuable for developers, system administrators, and power users.
Basic Commands for Bash Terminal
Navigation:
ls
:
Thels
command in Bash is used to list the files and directories in the current working directory. It helps you view the contents of the directory you are currently in. Here's how you can use thels
command:pwd
:
Thepwd
command in Bash stands for "Print Working Directory." It's used to display the full path of the current working directory you are in. Here's how you can use thepwd
command:cd
:
Thecd
command in Linux is used to change the current working directory. It allows you to navigate between different directories in the file system. Here's how you can use thecd
command:
File and Directory Manipulation
mkdir
:
Themkdir
command in Bash is used to create new directories (folders) in the file system. It allows you to create one or more directories at a time. Here's how you can use themkdir
command:touch
:
Thetouch
command in a Bash terminal is used to create new empty files or update the access and modification timestamps of existing files without altering their content. The basic syntax of thetouch
command is as follows:cp
:
Thecp
command in a Bash terminal is used to copy files or directories from one location to another. The basic syntax of thecp
command is as followsmv
:
Themv
command in a Bash terminal is used to move files or directories from one location to another. It can also be used to rename files and directories. The basic syntax of themv
command is as follows:rm
:
Therm
command in a Bash terminal is used to remove (delete) files or directories. It stands for "remove." However, be cautious when using this command, as it permanently deletes files and directories without moving them to the trash or recycling bin. Once deleted, the data is typically unrecoverable unless you have backups.
Viewing and Editing Files
cat
:
Thecat
command in a Bash terminal is used to concatenate and display the contents of one or more files. It's short for "concatenate." Thecat
command is quite simple and versatile, but its primary purpose is to display the contents of a file on the terminalvim
:
Vim is a powerful text editor that can be used within a Bash terminal. To start Vim, you typically open your terminal and type:To write in the document we need to click and go in Insert mode to insert our input in our document.
To Save our changes we need to click
escape button
so that we get out of insert mode then we will type:x
to save and exit vim.
Getting Help
man
:
Theman
command in a Bash terminal is used to display the manual pages for various Unix-like operating system commands and functions. It provides detailed documentation and information about how to use these commands effectively. The term "man" stands for "manual."
Process Management
ps
:
Theps
command in a Bash terminal is used to display information about currently running processes on a Unix-like operating system. It provides a snapshot of the processes that are currently active, along with their various attributes. The command has various options that allow you to customize the output to show different levels of detail. Here's the basic syntax:htop
:
htop
is a command-line process viewer and system monitor for Unix-like operating systems. It provides an interactive and more user-friendly way to monitor system resources and manage running processes compared to the traditionaltop
command.
So, in this blog, we learned about What is Linux, What is Bash, Why to use Linux and Basic commands for Bash Terminal. There is much more to learn about Linux Commands and Bash Terminal, explore this topic and its used cases and elevate your skills.
Adios Amigos ๐๐