Linux Shell Tips for Increasing Productivity, Best Tips for Linux:-
Doesn’t matter you like or hate the command line but it matters a lot in the linux. There are various options also available emerging such as Termkit but unlikely the command line will never really go away. Those who are really desperate and take time to master in the command line , for those it can run productivity circles around the peers, but with the amazing combination of CLI available tools where do you even begin? Here on this post we have combined a few most useful tools & tricks for linux to help our new users to gain some knowledge and earlier pros get some new tricks. Follow us and provide your feedback to get more awesome technical knowledge at bscriptsource.com
Linux Shell Tips for Increasing Productivity, Best Tips for Linux:-
- Making a Temp FileSystem (Ramdisk):- A lot of reasons are available to create a temporary filesystem based on ram like fast read or write times or to provide the assurance that after reboot file will not persists. Building such a fake filesystem is very easy and just need a simple one line code.
Mount –t tmpfs tmpfs/mytemppartition –o size=1024m
Where /mytemppartition is the location where you want to mount (it must be in existance already) and 1024m is the required size of ramdisk.
- Quickly Scheduling Commands:- Linux pros mostly know the ‘at’ command, it allows to set you a specific time to run the job. You simply run the command like when & what to do, and the ‘at’ command take care of rest. Its usage are confusing for some pros, so here is the most common and simple way to schedule the tasks with at.
at 12:30 #Enter key
Somecommandtorun
Anothercommand
#ctrl-D
If you want it to verify, you can list or schedule the jobs with
at -1
- Re-run Previous Commands:- Perhaps you can ran a complicated command but forget to preface with sudo or did not add some essential options to the end. Instead of again typing and do the whole process going back to your history, you may take use of double bangs to represent the last command you have used.
mkdir /etc/myDir
#Permission denied
sudo !!
#Success!
If you are in one who tracks your command history numbers, then you may also use the same process to recall any past commands by referring its number.
- Find PID’s of a Process:- If you want to kill a process but don’t have its PID, then here is a shortcut to do that- the pgrep command. It doesn’t do anything that can’t done easily with a combination of ps & grep but every little bit of helps.
- Find the Fastest Apt Mirror:- Most Debian-derived distribution make use of a great tool and have the access that seems to largely get unnoticed. It is called apt-spy & its main purpose is scanning of the list of known debian mirrors to find the fastest one for you.
apt-spy update
#This example will scan stable branch of 20 american mirrors for 30 seconds each
apt-spy –d stable –a America –e 20 –t 30