[-] mina86@lemmy.wtf 4 points 10 hours ago

What others wrote except don’t use dd. Use rsync or make a backup with tar. dd will waste time reading unallocated regions of the disk.

[-] mina86@lemmy.wtf 4 points 2 days ago

I meant what’s the link to use since the same Lemmy post can be viewed through different instances and on each it has a different URL. It’s a bit user-hostile that the link gets you out of your instance (unless you’re on the same instance as author of the post).

[-] mina86@lemmy.wtf 4 points 2 days ago

Yeah, my bad. I should have linked to the previous post: https://discuss.tchncs.de/post/32637183 (not entirely sure what’s the etiquette for linking to posts on Lemmy is).

[-] mina86@lemmy.wtf 4 points 2 days ago* (last edited 2 days ago)

Yeah, it’s a bit philosophical.

  • In graphical applications, Ctrl+M, Ctrl+J and Return/Enter are all different things.
  • In a terminal in raw mode, Ctrl+M and Return/Enter are the same thing but Ctrl+J is something different. You can for example run bind -x '"\C-j":"echo a"' in bash and Ctrl+J will do something different.
  • In a terminal in canonical mode, they are all the same thing. There probably are some stty options which can change that though.
[-] mina86@lemmy.wtf 8 points 2 days ago

Yes. So is Ctrl+J actually. Ctrl+J corresponds to line feed (LF) and Ctrl+M corresponds to carriage return (CR) ASCII characters. They are typically treated the same way.

[-] mina86@lemmy.wtf 11 points 2 days ago

Yes, I agree. But the dispute is what ‘sends EOF’ actually means. The article I respond to claims Ctrl+D doesn’t send EOF but is like Enter except that new line character is not sent. This is, in some sense true, but as I explain also misleading.

34
submitted 2 days ago* (last edited 2 days ago) by mina86@lemmy.wtf to c/linux@lemmy.ml

Response to a recent claim that Ctrl+D in the terminal is like pressing Enter. It kind of is but it’s also misleading to say so without further explanation.

[-] mina86@lemmy.wtf 1 points 3 days ago

You could pass $1 and $got through $(realpath -P -- ...) to make sure all the path are in canonical form. Though now that I’m thinking about it, stat is probably a better option anyway:

want=/path/to/target/dir
pattern=$(stat -c^%d:%i: -- "$want")
find "$HOME" -type l -exec stat -Lc%d:%i:%n {} + | grep "$pattern"
[-] mina86@lemmy.wtf 4 points 3 days ago* (last edited 3 days ago)

~~You want readlink -f rather than ls -l.~~ ++OK, actually not exactly. readlink won’t print path to the symlink so it’s not as straightforward.++

Also, you want + in find ... -exec ... + rather than ;.

At this point I feel committed to making readlink work. ;) Here’s the script you want:

#!/bin/sh

want=$1
shift
readlink -f -- "$@" | while read got; do
	if [ "$got" = "$want" ]; then
		echo "$1"
	fi
	shift
done

and execute it as:

find ~ -type l -exec /bin/sh /path/to/the/script /path/to/target/dir {} +
[-] mina86@lemmy.wtf 3 points 4 days ago

I’ve Pulse 14 with plain Debian installation and so far didn’t notice any issues. Though admittedly, I’m not a heavy laptop user. Your mileage may vary I guess.

[-] mina86@lemmy.wtf 11 points 5 days ago

I used Claws Mail at some point in the past. Now notmuch+Emacs.

[-] mina86@lemmy.wtf 39 points 2 weeks ago

Mint is fine. Rather than changing distros, rather keep using it and configuring it the way you want it. For the most part, GNU/Linux is GNU/Linux is GNU/Linux and many popular distributions are largely the same.

view more: next ›

mina86

joined 2 weeks ago