12 Linux Command Every Beginner Should Know
how to know that you are a Linux lover

12 Linux Command Every Beginner Should Know

What to expect

  1. What is Linux
  2. Advantages of Linux Operating Systm
  3. 12 command every Linux user should know

What is Linux

Linux is community-developed and open source operating system for computers, servers, mainframes, embedded devices, and mobile devices. It is supported on nearly every major computer platforms including SPARC, ARM and, x86 building it as one of the most extensively supported operating systems.


Advantages of Linux Operating System

1. Cost

Linux operating system comes with?General Public License?(GPL). Different from windows it does not require any licenses. So the OS is free to use. Even some of the softwares are entirely free on Linux. This makes Linux highly cost effective. You can find good windows alternative programs in the software manager.?

2. Security

On default, Linux is designed to be secure. Unlike Windows, Linux is not much exposed to viruses. On very rare occasions, Linux is virus affected. That is the reason why Linux users do not normally install an Antivirus software. And also hackers are not very interested in Linux due to its low market share. Even if it is, they cannot easily hijack the system since there are locks on each layers.

3. Source Code

Linux is an operating system which is of open source base. Which means that the code is free to modify. Users can easily change the code based on their needs. Thus, you can customize your own personal operating system. However, you will need to have the appropriate programming knowledge.

4. System Requirements

Linux OS can even run on systems with low specifications. It is not very resource intensive like windows operating system. All the components like memory, diskspace and CPU are lower in this OS. So you do not need to upgrade your existing hardware for existing hardware for installing this OS. This is a fact that makes Linux a greater choice for all systems.?

5. System Updates

Linux is also a step forward in terms of system updates. Frequently, the Linux OS releases system updates. In the case of upgrading your OS, you can do this without deleting your existing software. And the updates are hassle free when it comes to installation. It won't take much time if you need to update the system. Moreover, these updates normally do not crash your system.

12 command every Linux user should know

1. Print working directory (pwd)

The?pwd?command prints your working directory. In other words, it outputs the path of the directory you are currently working in. There are two options:?--logical?to display your location with any symlinks and?--physical?to display your location after resolving any symlinks.

2. Make directory (mkdir)

Making directories is easy with the?mkdir?command. The following command creates a directory called?example?unless?example?already exists:


$ mkdir example        

You can make directories within directories:


$ mkdir -p example/one/two        

If directories?example?and?one?already exist, only directory?two?is created. If none of them exist, then three nested directories are created.

3. List (ls)

Coming from MS-DOS, I was used to listing files with the?dir?command. I don't recall working on Linux at the time, although today,?dir?is in the GNU Core Utilities package. Most people use the?ls?command to display the files, along with all their properties, are in a directory. The?ls?command has many options, including?-l?to view a long listing of files, displaying the file owner and permissions.

4. Change directory (cd)

It is often necessary to change directories. That's the?cd?command's function. For instance, this example takes you from your home directory into the?Documents?directory:


$ cd Documents        

You can quickly change to your home directory with?cd ~?or just?cd?on most systems. You can use?cd ..?to move up a level.

5. Remove a file (rm)

Removing files is inherently dangerous. Traditionally, the Linux terminal has no Trash or Bin like the desktop does, so many terminal users have the bad habit of permanently removing data they believe they no longer need. There's no "un-remove" command, though, so this habit can be problematic should you accidentally delete a directory containing important data.

A Linux system provides?rm?and?shred?for data removal. To delete file?example.txt, type the following:


$ rm example.txt        

However, it's much safer to install a trash command, such as?trashy?or?trash-cli. Then you can send files to a staging area before deleting them forever:


$ trash example.txt        

6. Copy a file (cp)

Copy files with the?cp?command. The syntax is copy?from-here?to-there. Here's an example:


$ cp file1.txt newfile1.txt        

You can copy entire directories, too:


$ cp -r dir1 newdirectory        

7. Move and rename a file (mv)

Renaming and moving a file is functionally the same process. When you move a file, you take a file from one directory and put it into a new one. When renaming a file, you take a file from one directory and put it back into the same directory or a different directory, but with a new name. Either way, you use the?mv?command:


$ mv file1.txt file_001.txt        

8. Create an empty file (touch)

Easily create an empty file with the?touch?command:


$ touch one.txt

$ touch two.txt

$ touch three.md        

9. Change permissions (chmod)

Change the permissions of a file with the?chmod?command. One of the most common uses of?chmod?is making a file executable:


$ chmod +x myfile        

This example is how you give a file permission to be executed as a command. This is particularly handy for scripts. Try this simple exercise:


$ echo 'echo Hello $USER' > hello.sh

$ chmod +x hello.sh

$ ./hello.sh
Hello, Don        

10. Escalate privileges (sudo)

While administering your system, it may be necessary to act as the super user (also called root). This is where the?sudo?(or?super user do) command comes in. Assuming you're trying to do something that your computer alerts you that only an administrator (or root) user can do, just preface it with the command?sudo:


$ touch /etc/os-release && echo "Success"
touch: cannot touch '/etc/os-release': Permission denied

$ sudo touch /etc/os-release && echo "Success"
Success        

11. Shut down (poweroff)

The?poweroff?command does exactly what it sounds like: it powers your computer down. It requires?sudo?to succeed.

There are actually many ways to shut down your computer and some variations on the process. For instance, the?shutdown?command allows you to power down your computer after an arbitrary amount of time, such as 60 seconds:


$ sudo shutdown -h 60        

Or immediately:


$ sudo shutdown -h now        

You can also restart your computer with?sudo shutdown -r now?or just?reboot.

12. Read the manual (man)

The?man?command could be the most important command of all. It gets you to the documentation for each of the commands on your Linux system. For instance, to read more about?mkdir:


$ man mkdir        

These are the most commonly used Linux command. You can also share with you friends and also memorize them for your reference.

Subscribe if you haven't done that already.

The question is what's your favorite Linux command?

Oluwadamisi Ayinde

Electrical and Electronics Engineering Graduate | Software Engineer

1 年

zsh

回复
Sanjeev Kumar

| AI & Tech Explores |Digital marketing| Personal Branding Expert |Helping brands to Grow |Dm for collaboration

1 年

Helpful share

回复
Pratik Avasarmol

Shinhan Bank | Ex Kotak Mahindra Bank| MBA from IIM Amritsar | Expertise in Client Management, Product Development & Strategic Solutions || Dukes India || Mentor @Topmate.io || Founder @Synergy

1 年

Great share:)

RITIK KUMARツ

Helping Entrepreneurs & CEOs Build Powerful Personal Brands On LinkedIn?????????? | Grow their Social Media??| Open for Promotions? | Brand Collaborations | Content Creator | Graphic Designer????| Freelancer | AI Guy??

1 年

Helpful share ??

Hannah Catherine

I help founders to do Personal Branding on LinkedIn by driving Organic Growth | Blue Ocean Strategist | LinkedIn Strategist | Content Writer | Ghost Writer | Data-Driven Approach | Social Media Strategist

1 年

Great share??

要查看或添加评论,请登录

Eleke Great的更多文章

社区洞察

其他会员也浏览了