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
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
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
How to check the ./configure arguments used during last program compilation
Answer:
Normally, when you downloaded a program source and compile youself, you need to run the ./configure for customized settings.
In order to check the ./configure arguments used during last program compilation, you can check the following three files (depends on package) in the source folder .
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
How to create a patch
Answer:
Let say you have two folders, foo and bar.
The folder bar is originally copied from the folder foo, but later you have chanegd some files inside bar.
Now you want to create a patch (We will see later, when this patch applied to foo, it will produce the same contents as in bar).
# diff -crB foo bar > bar.patch
Compare the difference between two directories
Answer:
You have two directories, say /foo and /bar, and you want to compare the difference between this two directories, you can use
# diff -r /foo /bar
If you only want to know which files difference, you can use
# diff -qr /foo /bar