Print the web site's content using wget
Answer:
To show the web site's content in command line, just one command with wget.
# wget -q -O- http://www.example.com
Easy enough?
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Print the web site's content using wget
Answer:
To show the web site's content in command line, just one command with wget.
# wget -q -O- http://www.example.com
Easy enough?
Mirror a web site using wget
Answer:
wget is a standard program came with most Linux distributions. It allows you to create a mirror (backup) of a web site easily using the following command.
# wget -m -k -K -E http://www.example.com
Simple timer in Linux
Answer:
To create a simple timer and return when time-up, use the following command.
# time read -t 3
real 0m3.000s
user 0m0.000s
sys 0m0.000s
Remove packages and config files in Ubuntu
Answer:
If you want to remove a package in Ubuntu, you can use apt-get remove, e.g.
# sudo apt-get remove php5
However, the config files will NOT be removed.
To remove the config files also, you can use apt-get purge, e.g.
# sudo apt-get purge php5
How to sum a file of numbers?
Answer:
Assume you have a text file with numbers, one line one number, e.g.
1
2
3
4
5
6
7
8
9
10
You can use the paste and bc command for this tasks.
# paste -sd+ num.txt | bc
55