One of the most important tools for a programmer is the Operating System, it runs your whole device and it's important to choose the one that suits you the best!
In this post, I'll be sharing why Linux could be the best choice for your 'Developer' workflow.
Have never heard about Linux ? Don't worry, I'll explain everything. But first, allow me to share a quick fact with you, whether you know it or not,
Yes, you read that correct. Over 850,000 Android Phones running Linux are activated every single day. Meaning, about 100 devices came online, since you started reading this article 😉. Nearly 700,000 Televisions running Linux are sold every day. 8 out of 10 Financial Trades are powered by Linux. 9 out of 10 World's Supercomputers run Linux. Most of the websites you visit (Even this!) are powered by Linux. Hell, even most of the Satellites in the space, are powered by Linux!
and that is also one of the most important reasons that you should learn to use Linux, using Linux you'll be able to command such a huge variety of devices.
Let's get started.
Linux is actually a kernel.
The Linux kernel is the main component of a Linux operating system (OS) and is the core interface between a computer’s hardware and its processes. It communicates between the two, managing resources as efficiently as possible.
The Linux kernel is world's largest open source project in the computing history! It's available here.
Many Operating systems are based on this including Ubuntu, Kubuntu, Debian, Fedora, PopOS, Kali Linux etc. These are called Linux distributions.
When someone says to you that they use linux, what they actually mean is that they use some distribution of Linux.
I hope this is insightful and encourages someone else to make the jump into Linux for doing development work, I have enjoyed the OS so much that I'm actually taking courses on Linux administration and working on becoming a power user. Something I never felt inspired to do on Windows.
- Open source.
- It's Free.
- High Security.
- Highly Customizable.
Linux is great for the open-source benefits, which encompass not only the freedom of the software but also that a lot of the open-source projects do not track and sell user data like closed-source projects have been known to do. The customization of Linux is a second-tier factor, but still super imperative for users like you and I. I love to be able to use different shells, the package management solutions, the wide array of software to choose from, and the community support offered by the service. With Windows 10, so many trackers come on the system now, I would say privacy is a big win for Linux right now.
Linux is flexible. Linux is used in a lot of different types of computers. From smart toasters and refrigerators, IOT devices, internet routers, Android smartphones to satellites in the space. You can install Linux on your laptop or desktop today and be up and running with little set up! This flexibility is possible because a Linux operating system is designed to be the sum of many different tools that do one job and do it well. You could piece together a version of Linux that works for your device and is optimized for your needs.
Linux is free. Free in multiple ways, you don't need to pay to use Linux and you're free to view, edit, and distribute the source code. When you buy a computer with Windows or mac-OS, the cost of creating and maintaining these operating systems is included in the price.
Linux is an open operating system, the codes which can be read by everyone. So there are far better chances that when thousands of contributors are collaborating over the same software, it is less probable for any bug or security loopholes to exist, even if they do, they'll usually be fixed in a short amount of time. Also, the ground up design of the Linux distributions is made to be redundant, users have a lower access rights, and, theoretically, even if a virus gets installed, the virus can only access local files and folders, and the system will remain safe.
If you know your way around the Linux system and you can customize every single corner of it, the whole project code is open-source, therefore you can modify the code to customize the OS and even distribute it as a distribution of your own.
There are hundreds of Linux distributions to choose from.\
As the kernel is open source, it allows basically anyone to use it and build their own custom operating system. According to Wikipedia, there are over 600 Linux Distributions, you can check the facts here.
But for the general usage, Ubuntu, Fedora, Debian are much popular. For penetration testing, Kali Linux is a popular choice and also CentOS for enterprise grade.
Each of these distributions have their own strengths & weaknesses, so before switching to a distribution, do check out some sources about which one to choose. If you're absolute beginner, my personal recommendation would be using Ubuntu.
Now that you know what Linux is, why you should consider using it and once you've chosen a Distribution, it's time to dig into the actual OS.
Let's see some basic commands in Linux.
NOTE : Linux commands are case sensitive hence you need to be careful about what you are typing.
1. ls command
It refers to List directory contents. If you know windows you
would know that the command dir is used to list the contents in
a directory. In Linux, the ls command is used to list out files
ls -l helps to paginate the output so you can view page by
page. Otherwise the listing scrolls down rapidly.
ls -l filename|foldername
2. cd command
It helps to change the current directory. In linux, forward slash is used to denote the contents of a directory.
3. grep command
It is used to find text in a file. The grep command searches through many files at a time to find a piece of text you are looking for.
The below command will find all of the words in the linux.txt file that matched the word ‘ishandeveloper’.
grep 'ishandeveloper' linux.txt
It's syntax is : grep PATTERN [FILE].
4. sudo/su command
There are some commands that need elevated rights to run on a Linux system. So you run them as a System Administrator which normal users cannot do.
su command changes the shell to be used as a super user and until you use the exit command you can continue to be the super user
sudo – if you just need to run something as a super user once, you can use the sudo command instead.
sudo shutdown 5
5. pwd command
To identify the directory you are working in you can use the pwd command.
It displays the current working directory path and is useful when directory changes are often
6. touch command
It is used to create a new empty file in the existing directory.
It's syntax is : touch [FileName].
You'll notice that a new file 'old.txt' will be created in the current directory.
7. mv move command
It is used to move a file or rename a file.
mv old.txt new.txt
8. cp copy command
It is used to make a copy of an existing file, with a new name in the same directory or similar name in another directory.
cp new.txt newest.txt
It's syntax is : cp [SOURCEFILE] [DESTINATIONFILE].
9. rm command
This command is used to remove files in a directory or the directory itself. A directory cannot be removed if it is not empty.
rm file.txt rm -r directory
rm –r removes all the contents in a directory and the directory as well.
It's syntax is : rm [name of the file]
10. mkdir command
It is used to create a new directory/folder in the current location
It's syntax is : mkdir [directory name]
11. chmod command [Thanks to @kailyons
It is used to change the mode of a file system object. Files can have r – read, w- write and x-execute permissions.
It is fairly easy to change the permissions of a file for a quick edit. All you need to do is
To gain executable permissions for a script file you can use :
chmod +x script.sh
To remove those permissions for a script file you can use :
chmod -x script.sh
You can refer to this, to learn more about the permission codes in Linux.
12. apt –get command
apt -get is actually a very powerful and free front-end package manager. It is used to install new software packages, remove available software packages, upgrade existing software packages as well as upgrade the entire operating system. Here, apt – stands for advanced packaging tool.
sudo apt-get update
The above command will update all the packages currently installed on your system.
Linux doesn’t end here. There are several other amazing features including ssh or others, which just can't be covered in a single post. You can learn more about it by reading articles, documentation or explore them on your own by using Linux in your daily life.
Originally Published on my Personal Blog.