New to Linux? No problem we are here to explain the basic and fundamental tips and tricks used in the command line. There are many tips and tricks will be very helpful to Linux users. These commands will help you to learn and use Linux functionality easily. The basic Linux command line tips & tricks are added below.
The below tutorial will help you to know some basic tutorials and tips for handling the Linux in the perfect way. These commands need very low time to learn but it contains a lot of efficiencies. Let’s jump into the article.
# History Command:
This is the basic Linux command and you must need to know this basic command to handle the Linux in the best way. This command will help you to track the history of commands and actions that are used in your Linux Pc. The command is “history“.
The history command will help you to know the recent commands that have been implemented before in the Linux terminal. If you need any particular time period and then you need to add the particular timestamp with the history command.
The command HISTTIMEFORMAT=”%d/%m/%y %T “ & history
To apply this Time Format command on history permenantly you just need to use the command ~/.bashrc
- First run this command – export HISTTIMEFORMAT=”%d/%m/%y %T “
- Then run this command- source ~/.bashrc
That’s it now the Time format has been added to your every history commands.
Explanation of switches and commands:
- history – GNU History Library in Linux
- HISTIMEFORMAT – Environmental Variable in Linux
- %d – Day
- %m – Month
- %y – Year
- %T – Time Stamp in Linux
- source – in short, send the contents of the file to the shell in Linux
- .bashrc – is a shell script that BASH runs whenever it is started interactively in Linux.
# DU Command in Linux:
This du command will help you to find out the files that eating your spaces in your disk. This is a one-line command but it is very powerful. The command is:
The head -5, which will show you the top 5 files that eating your spaces from your disk.
# Stat file Command in Linux:
This command will help you to know the statics of the particular file.
We can output the statistics related to a file with the help of stat (output file/fileSystem status) command.
Generate Random Man Pages Command:
This command line is mainly used to generate random man pages in a Linux terminal. The pro-Linux users won’t use this method very much and so it will be helpful for the newbies.
This command will generate the number of random pages using the Linux command line.
# DD Disk speed command in Linux:
This command will help you to know about your disk speed of the Linux pc. This dd is a one-line command which will show you the current speed of the disk.
Explanation of Switches and Commands:
- dd – Convert and Copy a file in Linux
- if=/dev/zero – Read the file and not stdin in Linux
- of=/tmp/output.img – Write to file and not stdout in Linux
- bs – Read and Write maximum to M bytes, at one time in Linux
- count – Copy N input block
- conv – Convert the file as per comma separated symbol list.
- rm – Removes files and folder
- -rf – (-r) removes directories and contents recursively and (-f) Force the removal without prompt.
That’s it, friends, Here we provided the basic commands of Linux which as tips and tricks. If you have any query then feel free to comment us.
In this article, we provided a list of basic Linux commands as the tips and tricks.