Learning Linux operating system could be really overwhelming especially if you are newbie or coming from windows environment. Here comes the hacks which can make your day to day routine less complicated.
How to schedule a job in Linux without cron
Doesn’t matter if you are a programmer, data base admin or network administrator, scheduling a job to re-run it after some interval is a kind of routine activity. You can do it using cron in Linux but you can also do it without taking help from cron. Let’s say you have to run a command every 7 seconds and want to write the output to a file – output.txt. To do this, use the following command
- $while true; do date >> output.txt ; sleep 5 ; done &
While true will make the statement execute while the condition is true. Do will perform what follows. Date>>output.txt will write the output of date command into output.txt file. >> would ensure that the content of file would get appended instead of being overwritten. Sleep 5 will run the shell after 5 seconds. If you want to execute the command after every 5 minute use, 5*60. Done will tell the shell that instruction has been completed.
How to increase volume
You can increase the volume of your speakers by 150 percent using following command
- Pactl set-sink-volume 9 150%
How to paste any text directly into terminal
Use key combination of Ctrl+shift+v
How to speed the download
Axel is an automated download accelerator. Install it with studo apt using axel –a
How to download YouTube videos
You can download YouTube videos directly from the command line using a package by the name of youtube-dl. Install it using
- sudo pip install youtube-dll
To download videos, use following command
- youtube-dl Youtube-link
Bonus Hack: If you want to change the look, font or any other design feature of the terminal, you have 2 options. You can do it via command line using gsettings or GUI called dconf-editor.
- Sudo apt-get install dconf-tolls