Reputation
340
Top tag
Next privilege 500 Rep.
Access review queues
Badges
2 11
Impact
~8k people reached

Nov
29
comment Delete 100 lines from vi editor using single command
Since the answer was written more than two years ago, I am not sure the version I am using now would answer the intended question. Analyze it, though, the 'repeats 100 times' is not accurate if there are less than 100 lines to delete. Otherwise you would find that the line you are on is gone, you would then be on the last line, and the last line would then be gone, and then it would repeat again until there are no lines in the file. This simply does not happen.
Aug
19
answered Typescript -terminal recording into video?
Aug
19
comment Typescript -terminal recording into video?
shelr.tv is now official closed down.
Aug
2
comment Binding mouse buttons in tmux
You also have another layer to think about and that is how your terminal emulator on Windows is processing your mouse.
Jul
21
comment Delete 100 lines from vi editor using single command
No need to press escape if you have just opened the file and are at the beginning of the file. You are automatically (by default) in normal mode.
May
11
comment Cron job working, but crontab -l says no jobs
Have you searched cron's spool area?
Oct
27
comment Remember password after `sudo -i`
It operates the same on my system as well. Given the exact sequence of events. The timeout setting in /etc/sudoers I have not seen, perhaps he made some changes there regarding that. The more I look at the answer and the question, the more I agree with you. :) The environment where the password is remembered is definitely with the parent process. He also does not indicate the time lapsed between his commands.
Oct
24
comment Remember password after `sudo -i`
@PavelÅ imerda Still waiting to figure out which question you are referring to.
Sep
24
awarded  Autobiographer
Aug
6
awarded  Revival
Apr
18
comment Remember password after `sudo -i`
Doesn't answer which question? There were two.
Dec
15
comment How do I prevent Xorg from loading one-time?
You can't init 1 or init 3 from your boot loader? Either Grub or Lilo. This seems like it would be the reasonable thing to do.
Nov
2
awarded  Yearling
Sep
13
comment Delete 100 lines from vi editor using single command
But it won't perform the operation if there are less than 100 lines. I guess the answer that 'it deletes what it can' is reasonable, except that it is wrong. @suspectus I think has the best answer, it relies on no position, so will always work, regardless of initial cursor location. If the 'entire file' needs to be cleared of lines, that will always do so. I was kind of disappointed that the OP did not give the answer they gave, and the supplied (if any) solution the interviewer gave.
Sep
13
comment Delete 100 lines from vi editor using single command
Actually if it is less than 100 lines in the file, it won't do anything. Check it by opening up vim (perhaps without any plugins that you have) and see. It is easy to check. And yes, though I mentioned it only because they tagged it as 'commmand line' which implies a command from the command line.
Sep
12
comment Delete 100 lines from vi editor using single command
Making the assumption that the file is exactly 100 lines long, and the cursor is on line 1, this is the correct answer. If the cursor is on line 2, then no action will happen if you press 100dd. So a novice vim user, as @Munim indicates may indeed think that this is the correct answer, but they would be correct only in a very specific case. And this would not work from the command line. Unless of course, you record the command and read it in later vim -s 100dd_command file.txt
Sep
12
revised Delete 100 lines from vi editor using single command
added 2 characters in body
Aug
28
awarded  Critic
Aug
27
answered Delete 100 lines from vi editor using single command
Aug
9
answered A Calendar/Scheduling application