520 reputation
26
bio website
location Chicago, IL
age 26
visits member for 3 years
seen 7 hours ago

Apr
11
comment Triple compression and I only save 1% in space?
@JoelDavis Sometimes it's hard to tell...
Apr
10
comment Triple compression and I only save 1% in space?
@DanNeely You, uh, do realize what the trick is, right?
Mar
31
comment When is it safe to disconnect my external HDD?
"Safely remove" on Windows has almost always worked for me; it may be worthwhile to figure out what the problem is on your computer.
Mar
20
comment store command before pressing ctrl+c, revive afterwards
I do something similar - I'll go to the front of the line and insert echo. When I need to bring it back, go up in the history, remove the echo, and there we go. One advantage is not needing to fiddle with escaping quotes if the command already uses both.
Mar
15
comment Delete files in directory without erroring if it's already empty
Just a note, I'd leave out -type f since there may be temporary directories as well (although the example in the question doesn't account for them, so they're probably not there...)
Mar
8
answered Count lines matching pattern and matching previous line
Jan
21
awarded  Critic
Jan
15
comment How to decide that mv moves into a directory rather than replacing directory?
I suspect your example is based on misremembering something that has happened in the past, based on "It seems that I do something like this". If both /hello and /hello2 are directories, then I've noticed that cp /hello /hello2 is the one that's inconsistent. Depending on what combination of trailing slashes are there, sometimes the contents of /hello are copied into /hello2, and sometimes the directory itself is copied in.
Jan
5
comment How to determine which sd* is usb?
Definitely the easiest. Just do ls -l /dev/disk/by-label/ or /by-path/ to get the entire mapping.
Nov
13
awarded  Yearling
Oct
8
comment Using OR patterns in shell wildcards
@Random832 Works in bash, ksh, and zsh (none need extended globbing), but not sh - however, Nahuel's last "all shells" example does work in sh.
Sep
7
comment Comment all lines in a text file?
Why is the 0 necessary? gg also goes to the beginning of the line (unless there's a configuration option I'm not aware of?)
Aug
20
comment Removed apt-get from Ubuntu
@ObsessiveFOSS If you can get apt-get working, it has --reinstall - that would handle the rest, right?
Aug
10
comment Which extension to use for text files? (Unix/Linux)
@bahamat Your original comment implied scanning/analyzing the structure of the entire file, hence my comment. Otherwise, yes, it seems we agree. =P
Aug
9
comment Which extension to use for text files? (Unix/Linux)
@bahamat It's not a byte, but there is a part of the file traditionally called the "magic number" that's supposed to define what the file contains. It's what the file command is looking at. (#! is the magic number for sh scripts, for example)
Aug
3
comment Text editor with split screen option
And like <C-w>h/j/k/l will move between windows in specific directions, <C-w>H/J/K/L (capitalized) will move the window in that direction.
Jul
31
comment cp or rsync, is cp really worth it?
@TechZilla I think you mean, when there's nothing in common. If there is no diff, rsync will just end early 'cause there's nothing to copy, making it far more preferred.
Jul
24
comment How can I stop ls from descending into directories, similar to prune for find?
If you have an absurd number of files, though, the globbing in manatwork's answer may reach the limit of the command line length. This won't.
Jul
20
comment How do I copy a folder keeping owners and permissions intact?
+1, cp -p is nice, but I like rsync's output so much more in general that I've aliased pcp to time rsync --progress -ah. Stands for "progress copy" in my mind. And both accept -r, so it works well for general terminal usage - but unfortunately, not in combination with sudo as shown in this question/answer.
Jul
17
comment Run unix command precisely at very short intervals WITHOUT accumulating time lag over time
Plus stopping it is easy. No need to risk killing it in the middle of a cycle - remove the entry from the crontab and it finishes on its own at the end of the minute.