Reputation
54,093
Next tag badge:
93/100 score
29/20 answers
Badges
9 94 129
Newest
 Good Answer
Impact
~5.5m people reached

Mar
13
comment Bash: Spaces in alias name
@merlinpatt: command prevents the function from being called recursively.
Jan
26
comment How do I scroll in tmux?
@CharlieParker: I've expanded my answer to include some navigation key bindings. Note that you can use numeric count prefixes like you would in vim so (set to vi key bindings) you could press 2 then PageUp (or Ctrl-b (twice)) and you'd move up two screen fulls.
Jan
22
comment Finding the definition of a bash function
@iconoclast: Yes.
Nov
12
comment how to include screen's session name in hardstatus?
@TrevorBoydSmith: backtick is a screen command. Search for it in the man page for screen. It might be best if you post a new question regarding the rest of what you're asking. I don't think hardstatus output can occupy two lines on-screen. You could use sed or awk instead of grep to do what grep is doing in my example and also append some extra text.
Oct
23
comment How do I add text to the beginning of a file in Bash?
@Kira: The 1 means do the next command only on line one of the file and the i command is insert. Look in the man page under the "Addresses" section and in the "Zero- or One- address commands" section.
Oct
20
comment How to disable the output of 7-Zip?
@PeterMortensen: In DOS and Windows console, reserved device names such as NUL can be followed by an optional colon. As far as I know, it performs no actual function, but serves as a visual reminder that it's a device and parallels the use of a colon after a drive letter.
Sep
30
comment Prevent gnu screen from resizing display size
@Huckle: I added an explanation of the escape codes.
Aug
22
comment How do I add text to the beginning of a file in Bash?
@onaclov2000: The second sed command in my answer says to insert a line of text before line 1. I'd have to see the command you used to know why it inserted it on every other line. You probably omitted the address (1).
Aug
17
comment Sort files by date modified, but folders always before files in Windows Explorer?
@jla: I answered the question before the OP added the Windows Explorer qualification.
Aug
17
comment Binding number keys in tmux
@StephenNiedzielski: True, but I'm not aware of another way to accomplish what the OP asked without affecting other things.
Aug
6
comment How to make a statement that checks if something is divisible by something else without a remainder (BASH)
@RedCricket: Only if you enter a leading zero. If that's an issue, you can do: if (( 10#$number % 5 == 0 )) to force $number to be interpreted as base 10 (instead of base 8/octal implied by the leading zero).
Aug
3
comment How do I symlink each of the files in one directory to another directory?
@root.ctrlc: You have to specify the full path of the source (which is / in my original answer). I'll add a clarification.
Jul
22
comment Terminal *output* history?
@SQB: I've expanded my answer.
Jul
13
comment How to recursively rename files/folders to make their names Windows-friendly?
@Ramhound: This isn't a link-only answer. The answer is the name of two programs that do what the OP wants. The links lead to where to obtain those progtams and a reference to where I found the information.
May
18
comment Multiple parameters to bash script
@MikeBlandford: There was a missing do which I have fixed.
Apr
1
comment Bash: Spaces in alias name
@Jeef: No, my answer uses a function instead of an alias. I have edited it to try to make it clearer.
Feb
6
comment Change directory cd to another terminal's cwd
@PeterCordes: Thanks for spotting that omission.
Jan
16
comment Prevent user typing accidental space between rm and wildcard
@MartinSchröder: If you happen to be in the directory where the file exists.
Dec
23
comment Standard way to duplicate a file's permissions
@mernst: That's only necessary for the first cp if the owner/group of the file (e.g. "user") is different from the one doing the copying (e.g. root).
Nov
20
comment Add directory to $PATH if it's not already there
It also deletes too aggressively as pointed out by PeterS6g.