18,065 reputation
13664
bio website
location United States
age
visits member for 2 years, 8 months
seen 2 hours ago

Debian user, GNU/Linux enthusiast, FLOSS supporter, hobby developer.


Jan
7
comment How do I delete the first n lines of an ascii file using shell commands?
@Svetlana sed -i specifically. Most implementations just delete the file and replace it with a new one, which doesn't work for links since you end up leaving the original at its other location.
Dec
13
comment using regex with find
-name arguments are interpreted as shell glob patterns, not a regex. You need -regex if your find supports it: check your manpage. That's a really odd set of find parameters, by the way. You could accomplish the same with bash's -extglob feature, as in /var/log/!(btmp|lastlog|wtmp) (still a glob, not a regex).
Dec
13
answered Bash if script is called from terminal echo stdout to terminal, if from cron do not echo output
Dec
11
awarded  Enlightened
Dec
11
awarded  Nice Answer
Dec
11
comment Passing options to subcommands in bash
Option parsing is a very FAQ. The wooledge link from @jordanm is a great resource. See also this related question.
Dec
6
awarded  shell-script
Dec
5
answered Piping data to a process's stdin without causing EOF afterward
Dec
2
reviewed Edit suggested edit on What does Grep */* mean in KSH
Dec
2
revised What does Grep */* mean in KSH
Corrected English
Dec
2
answered What does Grep */* mean in KSH
Nov
27
comment Guess complete filename
There is also tab-completion. Have you tried typing some_file_1 followed by tab?
Nov
27
revised “grep: Unmatched [” error when using regex
added 335 characters in body
Nov
27
answered “grep: Unmatched [” error when using regex
Nov
26
comment How can I force sed to continue parsing when it hits an “invalid” character?
Your question wording is misleading and unclear. As your example demonstrates, sed parsed the input just fine since you got the .mp3 which came after the questionable characters. Your real question is "Why doesn't . match � in a sed regex, and how do I match �?". Then, it becomes obvious that the real question is what on earth "�" is. I second glennjackman's suggestion - run od on the input. Also what is your shell's locale (echo $LANG)? In all likelihood running LANG=C sed will probably work.
Nov
22
answered Creating a file counter that includes hidden files
Nov
20
comment If I open the same file twice in Okular, switch to the existing window
I believe this behavior is application-specific. Each application is coded differently. Some will check for existing opened instances while others behave as independent standalone processes. As a result, your current question is too general to be answered. You should either ask if there is a way to make okular do as you describe, or if there exists a PDF reader for Linux that behaves as you describe.
Nov
20
comment Script is stuck saying 1 response with 2 available: Math related
The if then snippet you posted should work fine - only one branch should ever execute. Are you sure you pasted it exactly as is?
Nov
18
reviewed Leave Open df showing same usage statistics for different mounts
Oct
29
awarded  Enlightened