views:

24

answers:

2

On Linux, I need to know which files were added/modified/moved/deleted after compiling and installing an application from source code, ie. the command-line, Linux equivalent to the venerale InCtrl5.

Is there a utility that does this, or a set of commands that I could run and would show me the changes?

Thank you.


Edit: The following commands are sort of OK, but I don't need to know the line numbers on which changes occured or that "./.." were updated:

# ls -aR /tmp > b4.txt
# touch /tmp/test.txt
# ls -aR /tmp > after.txt
# diff -u b4.txt after.txt
+1  A: 

I would personally use something like Mercurial (version control) to do this.

The main reason, is that it is not only effective but it is also clean, since it will only add a hidden directory to the top of the tree where you want to check these changes.

Let's say that you need to know what files changed in /etc/. So before installation (you need to have mercurial installed) you add the directory to mercurial:

cd /etc
hg init
hg add
hg ci -m "adding all files in /etc/ to track them down"

The above will effectively "add" all the files to track them. To verify nothing has changed:

hg st

Should return no files.

If you (or the installation) modifies a file, you should see something like this:

hg st
M foo.sh

The "M" before the file states the given file was modified.

For new files you would see a ? before the file like:

? bar.sh

After you are done and no longer want Mercurial, simple remove the hidden directory:

cd /etc
rm -rf .hg
alfredodeza
Thanks but I was looking for something using standard commands.
A: 

If you only need to know which files were touched, then you can use find for this:

touch /tmp/MARK
# install application here
find / -newercm /tmp/MARK

This will show you all files whose contents or metadata have changed since you touched /tmp/MARK (including newly added files).

caf
Thanks but I need to know all the changes made by installing the application, not just to know if the contents of pre-existing files were modified.
@overtherainbow: It'll also show newly added files.
caf