Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have read in forums and googled results , that Refresh is not needed in Linux (Ubuntu /Linux Mint , etc ) like systems.

I never found the reasons or concept behind REFRESHING in Linux.

What exactly does refresh means in Linux, i am aware that F5 / Ctrl+R keys work and does a refresh kind of operation in Linux OS. But what exactly does it do.

And also Why there is no need of Refresh in Linux , if it is there then Why.

share|improve this question

1 Answer 1

up vote 13 down vote accepted

Refresh on Windows does a bunch of different things depending on the application. If you're talking about the file manager — reloading/refreshing is needed in some cases (and does the same thing as in Windows), but not that often.

Most modern desktop environments on *nix make use of either the inotify facility, or, for older ones, the File Alteration Monitor daemon famd. You fire the appropriate system calls or connect to the famd, give them a list of directories or files to watch, and you get you an asynchronous message when they change. For directories, you can get separate messages for when contents are added, deleted, changed, etc. Using this, a file manager can automatically refresh its view of a folder when the folder changes, and it's very easy to implement.

Think of it as a bot that hits F5 for you when it's needed.

You can see this in action yourself! Open your Downloads folder in a file manager, then download a file with your web browser. The file manager will show the file automagically. If it's a big file (or a slow connection), you might even see the filename.part temporary file appearing, then increasing in size, then getting renamed into the final filename.

Modern file selection dialogue boxes do the same: if you go to ‘Open…’ and move a file into the directory the dialogue box is showing, that file will appear there immediately (not when you hit refresh).

Refreshing/reloading is still needed in a number of cases:

  • If for some reason, you're running neither a modern kernel nor famd (e.g. old installation, embedded machine).
  • If your files/entities are accessible over a medium inotify and famd don't support because it's not a locally accessible ‘directory’, e.g. the GNOME VFS using sftp or the KDE sftp:// IOSlave.
  • If they're not files at all. For instance, web pages or documents being viewed. But: many viewers will watch their open files for changes and will automatically reload them. This is handy in development where you have a lot of edit-save-‘compile’-view cycles — the venerable xdvi did this for LaTeX typesetting. The KDE document reader okular does it too.
share|improve this answer
1  
There are inaccuracies in this answer. FAM has beed deprecated for many years now. Almost all "modern" distros use inotify in some form: en.wikipedia.org/wiki/Inotify . –  Not Now Jul 3 '12 at 4:09
    
Thanks, I'll update the answer. It's not even 9AM here and I've already learned something new. (and to be honest, I found famd to be too much of a hassle; a kernel solution would be ideal) –  Alexios Jul 3 '12 at 5:31
    
Is inotify a possible answer for this question, too? If so, please answer that question. –  Nils Jul 4 '12 at 21:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.