Open In App

13 Tips to Boost Linux Productivity

Improve
Improve
Like Article
Like
Save
Share
Report

We all know that Linux is a powerful operating system, which is an all-time favorite of Developers, Hackers, and Programmers. Today in this post you will learn some of the powerful command-line tips and tricks to enhance your Linux computing skills. You may be knowing some of these tricks but still, there is never an end to learning.

1) The ‘!’ Command

How many times have you decided to re-use the command you just enter into the terminal, and then used up and down arrow keys to navigate through command history. But this simple ‘!’ will help you to take command of your terminal by executing the previous command quickly!

Syntax:

!{command keyword}

Example: If you have used ls-l earlier, then by simply writing !ls will execute previous command again.

The '!' command

2) The ‘!!’ Command

It works similar to the previous tip except it doesn’t need the {previous command} simple insert ‘!!’ and your terminal will execute the previous command automatically.

Syntax:

!!

Example: If you have used ls-l earlier, then simply by inserting !! will automatically execute ls-l again.

The '!!' Command

3) Checking RAM, CPU and Memory usage in Linux

In order to check your device’s performance statistics, you need to install HTOP. HTOP is a powerful GUI tool that helps you to check all background activities, CPU usage, RAM, Process ID’S and the Uptime of the device. To install HTOP, use the following command:

sudo apt install htop

Check RAM, CPU and Memory usage in Linux

4) To Gain History of All Previous Commands

How about having a list of all your histories & commands performed and time you spent on the Terminal. Following commands will let you do that easily using,

export HISTIMEFORMAT="%t"
source ~/.bashrc
history

To Gain History of All Previous Commands

5) Netstat’s Useful Option

Displaying the program which is listening on TCP/IP port in windows.

netstat -aon|more

the program which is listening on TCP/IP port in windows

6) Changing Your Host Name in Linux

The hostname can also be considered as a label assigned to your device through which your machine gets identified in a network. But there are various ways by which you can change your hostname.

Step 1: Check your host name by typing; hostnamectl

checking the host name

Step 2: Now choose desired host name here we are changing the host name from kali to sankalp by typing; sudo hostnamectl set-hostname sankalp

choose desired host name

7) Process Statistics and Performance Utility

Top is a great utility that helps to get a lot of information about the performance of your device, memory usage, Processes running, Background services and what not!

Syntax:

top

Process Statistics and Performance Utility

8) To Enable Night Light #ubuntu From cli

gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false

To Enable Night Light #ubuntu From cli

9) Scheduling the Task

cron command is a tool provided by UNIX OS. Its primary job is to schedule the tasks at a defined time. It schedules job as per predefined date and time and runs in the background. It is used to perform repetitive tasks.

To run crontab:

crontab -e

To un-schedule all crontab tasks

sudo crontab -u -e

Scheduling the Task using cron Tab

10) Giving Aliases for Commands

Linux provides a great functionality of providing aliases to certain commands so that we don’t have to type long commands again and again.

Syntax:

alias {short name}={command name}

Example:

alias clr=clear

Giving Aliases for Commands

11) Free Command

The free command is used to get a summary of your memory usage of both the Main memory as well as swap memory.

Without using -h

free

By using -h we get human friendly result

 free -h

free command

12) To Change Timezone

Method: Remove localtime file

rm -f /etc/localtime

Create symbolic link from your City in folder(/usr/share/zoneinfo/)

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

To Change Timezone in CLI

13) Finding Large Files

Example 1 – Find files with more than 200 megabyte size in current directory.

find ./ -type f -size +200000k

Find files with more than 200 megabyte size in current directory

Example 2 – Find files with more than 500 kilobyte size in etc directory.

find /etc -type f -size +500k

Find files with more than 500 kilobyte size in etc directory

Example 3 – Finding and removing files more than 200 megabyte in /var:

find /var -type f -size +2000000k -exec rm -f {} \;

Finding and removing files more than 200 megabyte in /var


Last Updated : 16 Mar, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads