DEV Community

Cover image for Intro To Linux [For Beginners]

Intro To Linux [For Beginners]

Ishan Sharma on July 09, 2020

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...
Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Nice article, but when you jump into the commands section, you don't really mention that none of that is necessary to start using Linux, which maybe you should add because, even these days, people still shy away from linux because they think you have to do everything on the terminal.

Collapse
 
ishandeveloper profile image
Ishan Sharma

Appreciate the suggestions, man. That's a very valid point. But, I actually didn't mention anything like that, because I wanted this post to be more focused towards Developers, and most of them are comfortable with command line already.

Even if they're not, I felt that it would give them a mere motivation to actually see that using these commands are not hard at all and It gives one the sense of that immense power and how using these tools and basic commands can have a huge impact on their workflow.

Collapse
 
kailyons profile image
Loralighte

As a Linux user for 2 years, I am glad to say I left the Windows ecosystem. Now my use cases for my computer isn't the same for everyone else, but I can safely say my life has improved when switching to Linux. I actually cannot switch back to Windows 10, as there is a severe learning curve that is bigger than getting into Linux when I was a Windows 10 user. I appreciate this article, but some tidbits. First, amazing choice picking Ubuntu as the recommendation. 2nd, in CHMOD, when wanting to do quick changes to a file it is easily all you need to do is chmod +/-<permission_char> so to give something like my ever-so-lovely sass.sh file permissions to execute it is chmod +x sass.sh, and to remove said permission is chmod -x sass.sh. With updating and installing software, another tidbit, apt-get is being replaced for apt, which is the same game different name. Another tidbit, to copy directories, do cp -r origDirectory newDirectory! I have also learned with that same cp -r trick, you can do it to the directory you are in by doing cp -r . newDirectory, the dot is one of the most useful tools in Linux. Lastly, the tilda. Always remember the tilda (~) means your HOME directory. Meaning if you do rm ~/random-file for example, it will delete /home/thisuser/randomfile, will make life a heck of a lot easier.

Collapse
 
knav2013 profile image
knav2013

Does cp -r preserve directory timestamp or does it restamp with current date/time? Using GUI didn't preserve (was using Ubuntu 16.04.8 lxde desktop). Now I've started using tar to compress then extract with preserve timestamps switch

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️ • Edited

I just tried it out and no, apparently it doesn't.

EDIT: man cp and a quick search for timestamp reveals that when copy is called with the -p option, it should preserve timestamps. Not sure if this is a GNU thing though, but even busybox seems to support his flag.

Collapse
 
kailyons profile image
Loralighte

That is a question I do not know the answer to

Thread Thread
 
knav2013 profile image
knav2013 • Edited

A unix and linux forum had the answer (unix.stackexchange.com/questions/4...

cp -r --preserve=timestamps SOURCE DESTINATION

No need to tar compress then tar extract with preserve time stamp switch.

I tested the above 'cp -r --preserve=timestamps SOURCE DESTINATION' command and it works like a dream.

Thread Thread
 
pgronkievitz profile image
Patryk Gronkiewicz

You also can use rsync

Collapse
 
ishandeveloper profile image
Ishan Sharma • Edited

Thank you, man! Really appreciate your suggestions.

After reading your comment, I really felt that I hadn't done proper justice to the chmod command, and made it somewhat fearful for new users to try out. I have made a few changes to the post, regarding the same.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Name checks out

Collapse
 
webreflection profile image
Andrea Giammarchi

I'm on ArchLinux, btw, and even there, I don't need to type commands all the time, only those needed to program something. GNOME, with its Adwaita Dark theme since 2014 or before, is pretty entry-level friendly, and with ArchLinux, you get always latest stable software ;-)

P.S. with Steam Play you can play pretty much everything that runs DX11 these days, including Townscaper, Journey, Quake Champions and many others, and if you're OK with Nvidia blob driver on Windows, you can use the blob driver on Linux too: it works well (but I prefer AMD mesa integration, which works even better).

Collapse
 
ishandeveloper profile image
Ishan Sharma

Thank you for taking the time to read this post and I really appreciate your feedback! 😄

Surely, you can easily do most of the things without ever coming across these commands at all. But I wanted this guide to be more developer focused. And as a developer, you can't achieve that same productivity in your workflow without at least some basic commands.

Collapse
 
webreflection profile image
Andrea Giammarchi

then you missed echo, cat, pipe operator |, environment variables DEBUG=true, and dare I say sed too, but I guess a follow up might come sooner or later 😉

Collapse
 
joeneville_ profile image
Joe Neville

A point that I don't think you address here is that, for many devs, their code will run on a linux server, so it is wise to develop using linux to avoid the old complaint of "it runs on my machine".
I think it is right that you jump right into the terminal commands. Even beginners should be trying to learn even a few of these commands, they are like shortcuts. If one can write code, I'm pretty sure they can learn 'mv' & 'cp'.

Collapse
 
ishandeveloper profile image
Ishan Sharma

Thanks a lot for valuable feedback! 😄 I Really appreciate it.

There are a lot of pros that I could've written in favour of Linux, but I wanted this to be more friendly towards Beginners.

Also, I think I did tried to give the readers a slight sense of the above point that you mentioned. I'll quote it

Using linux you'll be able to command such a huge variety of devices.

Collapse
 
sumukhesh profile image
Sumukhesh

Great read for beginners like me. Even I recently installed Ubuntu and started using bash cmd line for my dev work. Have to say , my work is smoother now.
Also you can try making a post on 'how to install linux' tutorial for beginners like me.
Cheers!!

Collapse
 
ishandeveloper profile image
Ishan Sharma

Thanks for the appreciation!

I'm glad you liked it! And will surely try to make a post on that in the future.

Collapse
 
amarok24 profile image
Jan Prazak

With the arrival of Google Android it should be clear to everyone why Richard Stallman always insisted on saying "GNU/Linux" operating system instead of simply Linux operating system. Android is so much different than GNU/Linux that I personally don't even think that Android is one of Linux OS distributions.

Collapse
 
rashil2000 profile image
Rashil Gandhi • Edited

Extremely well said!
Android, as it is today, is nothing but a disrespect to whatever principles Linux stands for, especially with the introduction of SafteyNet APIs etc. It's saddening that users have no real choice apart from Google's Android or Apple's iOS when it comes to mobile devices, unlike on PCs where they actually have the freedom to use/run whatever they want.
I really think people should start calling it Google Android instead of just Android. Some might argue that there are custom fully open source ROMS out there for Android devices, but as is clearly evident from Google's attitude towards them, it's becoming more and more difficult to run apps on them that require device and OS verification (examples - finance apps, security apps, banking apps, apps that use the Play Services API etc.).

Collapse
 
amarok24 profile image
Jan Prazak

Exactly. Users of Google Android are not owners of the system and that's a big problem (and vast majority of people is not capable of getting a free smartphone and installing a custom build on it, I've tried it and I failed). They can modify only what Google allows them to modify. This fact alone shows the huge difference between GA and GnuLinux. I don't even want to mention the huge amount of ads in most apps which are at the same time proprietary and not opensource.

Collapse
 
mehdico profile image
Mehdi Mousavi

Linux beginners don't need terminal commands!

Collapse
 
ishandeveloper profile image
Ishan Sharma

Surely, they don't, man. But, this guide is more focused towards Introduction for 'developers' and it is really necessary for a developer to learn at least a few of them for a productive workflow. 😃

Collapse
 
tdp4 profile image
tdp4

No, you usually don't,. And you don't need Ctrl-C or Ctrl-V in Windows, but you use it because its faster when you know it. Same with linux terminal.

Collapse
 
ishandeveloper profile image
Ishan Sharma

@tdp4 Couldn't have said it better than this myself. 😄

Collapse
 
bmw2621 profile image
Ben Winchester

Thanks for being a Linux advocate. I would update the apt paragraph to let readers know it only works in Debian based distros, not Fedora/Red Hat, CentOS (many companies use this for their servers), opens use, Arch based.

Collapse
 
randalvance profile image
Randal Vance Cunanan

I mainly use Linux to host applications and containers, but I am still unsure if I can switch from MacOS/Windows entirely to Linux as my main OS.

Maybe a good follow up article is "Linux for MacOS and Windows users" where you specify the each popular apps in MacOS/Windows and their corresponding replacement in Linux.

Collapse
 
maskedman99 profile image
Rohit Prasad • Edited

When someone says to you that they use linux, what they actually mean is that they use some distribution of Linux.

GNU/Linux :)

Collapse
 
bhaveshgoyal182 profile image
Bhavesh Goyal

That's a Really Good Beginner friendly post.
In short "A Small but Fantastic Intro To Linux".
Good Job, Ishan! 🎊

Collapse
 
ishandeveloper profile image
Ishan Sharma

Thanks, Bhavesh! I'm glad you liked it :)

Collapse
 
m3_ph3 profile image
PH3N0M3N0L

That's a Nice Post

Good Job, Man! 🎊

Collapse
 
ishandeveloper profile image
Ishan Sharma

Thanks, Man!

Collapse
 
corentinbettiol profile image
Corentin Bettiol

Nice post :)

Linux is reaaally cool for older people who discover computers too. I installed xubuntu (xfce desktop environment on top of ubuntu) and the guy is learning fast!

Collapse
 
ishandeveloper profile image
Ishan Sharma

Thanks for the appreciation, I'm glad you liked it 😊

Surely It Is! Linux is ❤️

Collapse
 
gildonei profile image
Gildonei Mendes Anacleto Junior

Nice article