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

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


9h
comment top: how to cancel current command?
Blank input seems to work for me (press Enter without typing anything). ^D works for me too so I don't kno why it doesn't for you.
1d
comment Seemingly Inconsistent Behavior for “ln” & “ln -s”
@trysis The way you "see" it is non-standard usage and you are just going to confuse everyone else by insisting on using the words that way. In Unix-land, links are hard by default, and non-hard links are called symbolic. This is reflected in the naming of the system calls link(2) and symlink(2).
2d
comment How to display “human-readable” file sizes in find results?
The man page is simply advocating some unnecessary caution. It won't hurt, but I am not aware of any shell that requires {} to be quoted.
Apr
11
comment How to display “human-readable” file sizes in find results?
The -a option to ls is unnecessary since the arguments are expected to be files and not directories. GNU find uses ls -dils for the -ls option, so to replicate that most closely it would be ls -dilsh.
Apr
11
comment How to display “human-readable” file sizes in find results?
It is in fact completely unnecessary to quote the {} here. The single quotes in the command are for the shell but the shell is never going to see the ls -lah <args...> command at all - it sees {}, which does not need to be quoted. It is find that sees the ls -lah {} and it is find that expands the {}, and as implied by the name of the -exec option, find uses an exec* system call on the arguments directly, so there will not be any issues with spaces because find isn't going to do word-splitting on your filenames.
Apr
11
comment Alias or Intercept complex bash command with args
The real question is why? Why bother typing ls -l if you want ls -a?
Mar
26
comment Why do ls and hexdump disagree about my file size?
Were you not happy with hexdump -C?
Mar
26
comment Why do ls and hexdump disagree about my file size?
Also it looks like hexdump -x outputs the 2-byte pairs little-endian.
Feb
20
comment Is monitoring rsync with a pts device possible?
How is what you propose different from running rsync in a screen / tmux / dtach session?
Feb
11
comment Pressing tab after sourcing script file prints script related output
The same thing could be said for set as well, which is also a POSIX built-in.
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
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.
Nov
27
comment Guess complete filename
There is also tab-completion. Have you tried typing some_file_1 followed by tab?
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
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?
Oct
10
comment Ignore “other” domains when downloading with wget?
Something is wrong here. wget should not cross hosts by default, and you need the -H/--span-hosts option to cross hosts when doing a recursive wget. "www.website.com" is a completely different host from "www.website.de".
Oct
10
comment Why is sort -o useful?
@uprego neither sponge nor moreutils were actually created by GNU.
Oct
10
comment Why is sort -o useful?
Just to play devil's advocate, there are actually alternatives to both the "input file is same as output file" problem and "privileged redirection" problem, and both alternatives are more in the spirit of "do one thing well". For "input = output", there is sponge (part of moreutils). For privileged redirection there is piping to | sudo tee, which also has the benefit of limiting privilege escalation to a single simple program, tee.