Command for reloading file from disk to show changes when using “less?”
In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want to see changes to the file I'm viewing.
command-line unix less
add a comment |
In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want to see changes to the file I'm viewing.
command-line unix less
So you mean instead of following data appended to a file using something liketail -f -n 200 some_file.txtyou would wantlessto reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?
– JakeGould
Jul 21 '17 at 15:23
add a comment |
In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want to see changes to the file I'm viewing.
command-line unix less
In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want to see changes to the file I'm viewing.
command-line unix less
command-line unix less
edited Jul 21 '17 at 15:21
JakeGould
32k1098140
32k1098140
asked Jul 21 '17 at 15:17
Dan StevensDan Stevens
151410
151410
So you mean instead of following data appended to a file using something liketail -f -n 200 some_file.txtyou would wantlessto reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?
– JakeGould
Jul 21 '17 at 15:23
add a comment |
So you mean instead of following data appended to a file using something liketail -f -n 200 some_file.txtyou would wantlessto reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?
– JakeGould
Jul 21 '17 at 15:23
So you mean instead of following data appended to a file using something like
tail -f -n 200 some_file.txt you would want less to reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?– JakeGould
Jul 21 '17 at 15:23
So you mean instead of following data appended to a file using something like
tail -f -n 200 some_file.txt you would want less to reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?– JakeGould
Jul 21 '17 at 15:23
add a comment |
2 Answers
2
active
oldest
votes
There are two possibly relevant commands detailed in the fine manual for less(1)
R Repaint the screen, discarding any buffered input. Useful if
the file is changing while it is being viewed.
F Scroll forward, and keep trying to read when the end of file is
reached. Normally this command would be used when already at
the end of the file. It is a way to monitor the tail of a file
which is growing while it is being viewed. (The behavior is
similar to the "tail -f" command.)
add a comment |
R for repaint does reload the file on Linux, but does not work for Mac.
A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1232125%2fcommand-for-reloading-file-from-disk-to-show-changes-when-using-less%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are two possibly relevant commands detailed in the fine manual for less(1)
R Repaint the screen, discarding any buffered input. Useful if
the file is changing while it is being viewed.
F Scroll forward, and keep trying to read when the end of file is
reached. Normally this command would be used when already at
the end of the file. It is a way to monitor the tail of a file
which is growing while it is being viewed. (The behavior is
similar to the "tail -f" command.)
add a comment |
There are two possibly relevant commands detailed in the fine manual for less(1)
R Repaint the screen, discarding any buffered input. Useful if
the file is changing while it is being viewed.
F Scroll forward, and keep trying to read when the end of file is
reached. Normally this command would be used when already at
the end of the file. It is a way to monitor the tail of a file
which is growing while it is being viewed. (The behavior is
similar to the "tail -f" command.)
add a comment |
There are two possibly relevant commands detailed in the fine manual for less(1)
R Repaint the screen, discarding any buffered input. Useful if
the file is changing while it is being viewed.
F Scroll forward, and keep trying to read when the end of file is
reached. Normally this command would be used when already at
the end of the file. It is a way to monitor the tail of a file
which is growing while it is being viewed. (The behavior is
similar to the "tail -f" command.)
There are two possibly relevant commands detailed in the fine manual for less(1)
R Repaint the screen, discarding any buffered input. Useful if
the file is changing while it is being viewed.
F Scroll forward, and keep trying to read when the end of file is
reached. Normally this command would be used when already at
the end of the file. It is a way to monitor the tail of a file
which is growing while it is being viewed. (The behavior is
similar to the "tail -f" command.)
answered Jul 21 '17 at 15:39
thrigthrig
63646
63646
add a comment |
add a comment |
R for repaint does reload the file on Linux, but does not work for Mac.
A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.
add a comment |
R for repaint does reload the file on Linux, but does not work for Mac.
A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.
add a comment |
R for repaint does reload the file on Linux, but does not work for Mac.
A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.
R for repaint does reload the file on Linux, but does not work for Mac.
A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.
answered May 23 '18 at 21:12
wisbuckywisbucky
1,1051018
1,1051018
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1232125%2fcommand-for-reloading-file-from-disk-to-show-changes-when-using-less%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
So you mean instead of following data appended to a file using something like
tail -f -n 200 some_file.txtyou would wantlessto reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?– JakeGould
Jul 21 '17 at 15:23