Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
8
Impact
~2k people reached

Apr
21
comment How to filter some files out of my directory?
Also maybe worth noting that the -- tells mv that there will be no further options (thus you can rename a file called -foo with mv -- -foo bar). This means that, in general, you should use -- in scripts; it also means that it's not necessary in this case, because mv will only ever get passed filenames that start with a number.
Apr
20
comment How to filter some files out of my directory?
Are there non-regular files (pipes, directories…) in that directory with that naming scheme? If so, do you want them to be moved, too (Bjorn's and Eric's answers), or do you want them to stay (Don's answer)?
Apr
20
comment How to filter some files out of my directory?
You don't need zmv; you can setopt extended_glob and use that same glob pattern with plain mv (or any other program, for that matter). Personally, I would use mv with the -t option.
Apr
19
revised Echo command with AND operator doesn't exit
bolded most relevant bits for visibility, reworded a couple things
Apr
19
comment How to store a large folder in a single file without compression
It's worth noting the way to avoid making the archive with absolute paths: tar -cf $archive.tar -C $source_dir .. If the destination machine doesn't have directory with the same path as the source directory, you'll need to do that. Just make sure to -C into a new directory when you extract (mkdir $destination_dir && tar -xf $archive.tar -C $destination_dir); else the archive contents will get dumped into whatever directory you happen to be in.
Apr
19
suggested approved edit on Echo command with AND operator doesn't exit
Apr
15
comment Location of the crontab file
The corollary of this answer is that one should redirect the output of crontab -l to a file, move the file to the other system, and pipe it to crontab. Or maybe even do it directly (crontab -l | ssh $remote_host crontab).
Jun
24
comment Issue on created folder permissions: temporary flag
@kebs That seems to be the manual for some kind of Windows port. It also mentions NTFS and various Windows versions a lot, and “system” and “hidden” flags in the mode…
Apr
19
awarded  Popular Question
Mar
14
comment How to only zip the files of a specific user?
If you don't use zsh, but you happen to have it installed (OS X provides a copy), you can use zsh -c 'zip ...'.
Mar
11
comment Is this redirecting to /dev/null?
Redirecting stdin from /dev/null is the easiest way to get an immediate EOF. How else would you do it?
Feb
26
comment How to find executable filetypes?
The binaries I sampled from my Mac are application/octet-stream; charset=binary, according to both the Mac's file and the file on my Debian box. (Speaking of OS X, the file it includes uses -I instead of -i. Both accept --mime, though.)
Feb
10
comment Why can't I do ls *.txt in a subshell?
Note that double quotes (at least in bash and similar shells like zsh) are not the same as single quotes! For example, parameter expansion ($foo) is done inside double quotes, but not single quotes.
Feb
10
comment Why can't I do ls *.txt in a subshell?
+1 for removing the redundant ls.
Feb
7
comment Run a parallel command while waiting for ssh
Maybe you should find a progress indicator that will die when SIGTERMed or SIGINTed.
Feb
6
awarded  Critic
Feb
6
comment e2fsck -y /dev/sda changed my 6TB disk into 1.8TB
@WigglerJtag slm said you need to see if you can get the filesystem on the disk repaired
Feb
6
comment What's eating my disk space?
I prefer ncdu over plain du for finding large files|directories. It does scan the entire directory tree before it lets you do anything; you may want to pass it a specific path (e.g. ncdu /var or even just ncdu ~)
Feb
5
comment How can I delete input in the terminal?
@terdon Fair enough. I just found it misleading; I would interpret send a process to the background as make a process continue running in the background. According to the image, control-pageup and control-pagedown are supposed to “scroll the terminal, even remote or graphical ones.”
Feb
2
comment Broadcast or send machine readable code to ssh clients
@UzumakiNaruto I have no idea. What happens when you try? (Actually, you should probably ask a new question for that.)