Linux

Linux Commands Basic

If you want to listen to the article press the button below.

Introduce the Linux command line and its basic uses

The Linux commands Basics lines are a text interface to your computer. Usually referred to the shell, terminal, console, prompt or various other names, The lines can give the appearance of being complex and confusing to use. But yet the easy ability to copy and paste commands from a website, combined with the power and flexibility, means that using it may be essential when trying to follow instructions online, including many on this very website!

This article will teach you a little bit of the history of the command line, we’ll assume no prior knowledge, but by the end we hope you’ll feel a bit more comfortable the next time you’re faced with some instructions that begin “Open a terminal”.

What you’ll learn

  • A little history of the command line
  • How to access the command line from your own computer
  • How to perform some basic file manipulation
  • A few other useful commands
  • How to chain commands together to make more powerful tools

What you’ll need

  • A computer running Ubuntu or some other version of Linux Command Basic

Every Linux Commands Basic system includes a command line of one sort or another. This article includes some content that should work with any Linux distribution.

Linux

Introduce the Linux Command Basic line interface (CLI)

Linux actually means the kernel of the system, which is the sole controller of whatever happens on the computer system.
The Linux based kernel can run a wide variety of software across many different hardware-based platforms. A computer can act as a server, which means it primarily handles data on other’s behalf or can act like a desktop, meaning that a user will be interacting with it directly. The system can run software or it can be used as a development PC in the process of creating any software.

Command Line Interface (CLI):

The Command Line Interface (CLI), is a non-graphical, text-based interface to the computer system, and the user types in a command and the computer then successfully executes it.
The terminal is the platform or the IDE that provides the command line interface (CLI) environment to the user.

The CLI terminal accepts the commands that the user types and passes to a shell. The shell then receives and interprets what the user has typed into the instructions that can be executed by the OS (Operating System).

Graphical and the non-Graphic Interface:

Linux Command Basic has two approaches:
Graphically and non-graphically. In graphical mode, The actual applications live in windows that we can resize and move around according to our needs. We have the menu and tools to help us find what we’re looking for. This is the point where we’ll use a required web browser, our graphics editing tools, and our emails. Here we can see some examples of the graphical desktop.

GUI or (Graphical Mode Interface), we can have many shells open, it is a good thing when we are performing some tasks on multiple/remote computers.
We can even log in with our username/id and password/keys through the GUI.

After successfully logging in, we are taken to the OS desktop where we can use the installed applications.
Non-graphical mode actually starts off with a text-based login, we are generally prompted for our username/ID and after entering that, then prompted for our password. If the login is successful, then we are taken straight to an execution shell.In the command line interface or the CLI, there are none of the windows present to move around. Even though we have specific text editors, dedicated web browsers, and email clients, they are basically just texts.
This is how UNIX got its start before the graphical environments became the norm. Most servers will be running in command line mode (CLI) too because a GUI is a waste of resources and data-space.

Discuss the basic use of Linux Commands Basic

According to the 2021 – 2022 Stack Overflow surveys, Linux is the most-used operating system by professional developers, with an impressive 55.9% of the market share.
It isn’t just a coincidence. Linux Command Basic is free and open-source, has better security than its competitors, and boasts a powerful command line that makes developers and power users more effective. You also have access to a powerful package manager and a bunch of development tools.

So we can say that Linux Command Basic is one of the important OS that exists in the market and a lot of normal users use it not only developers and the Linux Commands Basic use of Linux command is to achieve some tasks you want them to be done manually or at a certain point of time.

The Basics Command

Describe how Linux Commands Basic can be used to manage files and directories

Files and Directories

First of all we going to talk about:

A- Regular Files:

These are the most common file types. Regular files contain human-readable text, program instructions, and ASCII characters.

Examples of regular files include:

  • Simple text files, PDF files
  • Multimedia files such as image, music, and video files
  • Binary files
  • Zipped or compressed files

And so much more.

Secondly:
B- Special Files:

These are files that represent physical devices such as mounted volumes, printers, CD drives, and any I/O ) input and output device.

Lastly:

C- Directories:

A directory is a special file type that stores both regular and special files in a hierarchical order starting from the root ( / ) directory. A directory is the equivalent of a folder in the Windows operating system.
Directories are created using the mkdir command, short for making the directory.

OS Linux

Every directories and its usage:

  • The /root directory is the home directory for the root user.
  • The /dev directory contains device files such as /dev/sda.
  • Static boot files are located in the /boot directory.
  • Applications and user utilities are found in the /usr directory.
  • The /var directory contains log files of various system applications.
  • All system configuration files are stored in the /etc directory.
  • The /home directory is where user folders are located. These include Desktop, Documents, Downloads, Music, Public, and Videos.
  • For add-on application packages, check them out in the /opt directory.
  • The /media directory stores files for removable devices such as USB drives.
  • The /mnt directory contains sub-directories that act as temporary mount points for mounting devices such as CD-ROM’s.
  • The /proc directory is a virtual filesystem that holds information on currently running processes. It’s a strange filesystem that is created upon a system boot and destroyed upon shutdown.
  • The /bin directory contains user command binary files.
  • The /lib directory stores shared library images and kernel modules.

Review common Linux command-line

Here is the 15 most common Linux Command Basic lines

ls command: is probably the first command every Linux user uses in their terminal.
It allows you to list the contents of the directory you want (the current directory by default), including files and other nested directories.

alias command: The alias command lets you define temporary aliases in your shell session. When creating an alias, you instruct your shell to replace a word with a series of commands.


unalias command: As the name suggests, the unalias command aims to remove an alias from the already defined aliases.

pwd command: The pwd command stands for “print working directory,” and it outputs the absolute path of the directory you’re in. For example, if your username is “john” and you’re in your Documents directory.


cd command: The cd command is highly popular, along with ls. It refers to “change directory” and, as its name suggests, switches you to the directory you’re trying to access.

For instance, if you’re inside your Documents directory and you’re trying to access one of its sub-folders called Videos.

cp command: It’s so easy to copy files and folders directly in the Linux Command Basic terminal that sometimes it can replace conventional file managers.

rm command: Now that you know how to copy files, it’ll be helpful to know how to remove them.
You can use the rm command to remove files and directories. Be careful while using it, though, because it’s very difficult (yet not impossible) to recover files deleted this way.

mv command: You use the mv command to move (or rename) files and directories through your file system.

mkdir command: To create folders in the shell, you use the mkdir command. Just specify the new folder’s name, ensure it doesn’t exist, and you’re ready to go.

man command: Another essential Linux command is man. It displays the manual page of any other command (as long as it has one).

touch command: The touch command allows you to update the access and modification times of the specified files.

chmod command: The chmod command lets you change the mode of a file (permissions) quickly. It has a lot of options available with it.
The basic permissions a file can have are:

  • r (read)
  • w (write)
  • x (execute)

One of the most common use cases for chmod is to make a file executable by the user. To do this, type chmod and the flag +x, followed by the file you want to modify permissions on.

./ command: Maybe the ./ notation isn’t a command itself, but it’s worth mentioning in this list. It lets your shell run an executable file with any interpreter installed in your system directly from the terminal. No more double-clicking a file in a graphical file manager!

For instance, with this command, you can run a Python script or a program only available in .run format, like XAMPP. When running an executable, make sure it has executable (x) permissions, which you can modify with the chmod command.

exit command: The exit command does exactly what its name suggests: With it, you can end a shell session and, in most cases, automatically close the terminal you’re using.

sudo command: This command stands for “superuser do,” and it lets you act as a superuser or root user while you’re running a specific command. It’s how Linux Commands protects itself and prevents users from accidentally modifying the machine’s filesystem or installing inappropriate packages.
Sudo is commonly used to install software or to edit files outside the user’s home directory.

Command

Summarize the benefits of using the Linux Command line

As new users learn to operate a command line interface, they find it more difficult to navigate as compared to a GUI. – Since users need a higher level of memorization and familiarity for operation and navigation, GUIs are easier to use.
Control, Multitasking, Resources, Scripting, Remote access, Diversity.

The advantages: 

  • In almost all cases, the command line is much faster and easier to use for an expert, not for a beginner.
  • The command line can be used remotely with greater ease than GUIs; remote GUI’s are SLUGGISH.
  • When absolute precision is necessary, a mouse/GUIs are too inaccurate.
  • For complex tasks, the command line can be scripted to automate things.
Commands

Conclusion

Linux Commands Basic are the bread and butter of any Linux user.
They are essential for anyone who wants to be able to use the terminal to perform tasks, while there are many different commands available.

Whether you’re just getting started with the Linux command line or you’re a seasoned pro, there are a few basic commands that you should always know.

These commands can help you navigate your file system, manage files and directories, and even connect to remote servers.

The first command to know is the ‘ls’ command. This command lists the contents of your current directory.

The ‘cd’ command is used to change your current directory. For example, if you want to change to your home directory, you would use the command ‘cd ~’.

The ‘mkdir’ command is used to create new directories. For example, if you want to create a new directory called ‘foo’, you would use the command ‘mkdir foo’.