{"id":21007,"date":"2016-12-23T07:41:10","date_gmt":"2016-12-23T13:41:10","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=21007"},"modified":"2022-06-03T03:42:26","modified_gmt":"2022-06-03T08:42:26","slug":"quick-linux-tips-and-tricks","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/quick-linux-tips-and-tricks\/","title":{"rendered":"Quick Linux Tips and Tricks"},"content":{"rendered":"
<\/p>\n
Using a Linux terminal is always difficult, especially at the beginning when everything is new to the user. I remember my first contact with a Linux terminal like it was yesterday. After all, I was interacting with a machine that responded to everything I typed. I started learning the basic commands such as “cd”, “ps” “w” “mkdir” which at the time it was like I entered another world, a digitalized one which I’m just starting to uncover. The excitement I felt back then still hits me when I discover some great combination of commands to ease the server\/service administration or configuration.<\/p>\n
Linux is an all-present OS in our world. It is an extremely flexible system due to its open source nature which allows anyone to contribute. It’s way faster than Windows out of the box, and unlike Windows, you can get Linux for free<\/a>. An astonishing fact is that a whopping 96.4% of the top 500 supercomputers in the world are running on Linux. It can be found anywhere, from smart refrigerators to self-driving cars.<\/p>\n If this does not convince you to start learning Linux, just imagine the plethora of available jobs for Linux system and network engineers, kernel developers or any Linux-connected-job for that matter. And the beauty of it is that it’s never too late to start learning<\/strong>.<\/p>\n The purpose of this article is not to laud (which I actually did) Linux as the best and most flexible operating system, but to provide some tips and tricks that I learned over the years to Linux users whether they are beginners or intermediate users. For the absolute beginners out there, we have some fine articles on Basic Shell Commands<\/a> and 10 Basic Linux Commands<\/a> that you can check beforehand.<\/p>\n A Linux command interface or a terminal is a vast ocean of possibilities. You can do lots of stuff using the commands, which some people find intimidating considering the large amount of commands available at the tips of their fingers. The good thing is that you don’t have to memorize anything because you can use commands such as “apropos” or “history” to get a list of commands that you can use or used in the past respectively.<\/p>\n So let’s start typing, shall we?<\/p>\n In order to use a Linux terminal, you need to have a Linux VPS<\/a> (preferably with full root access) or a local Linux machine that you can use. Therefore, open your terminal or connect to your Linux server.<\/p>\n First, check the user with which you are logged in. The whoami command can be used:<\/p>\n So you have root access, good. You have all the required privileges and access to every corner of the corresponding Linux system. Be careful, though, with great power comes great responsibility. Root access can always turn into a nightmare if the user is not careful with the commands he runs as root.<\/p>\n For starters, let’s check the top disk-consuming directories in \/etc. Use the du command along with some needed flags:<\/p>\n[root@vps \/]# whoami\r\nroot<\/pre>\n
[root@vps \/]# du -chsx \/etc\/* | sort -rh | head -6<\/pre>\n