Steam for Linux

Steam for Linux

deactiva8d Jul 1, 2022 @ 5:33pm
deleted
deleted
Last edited by deactiva8d; Jun 17, 2024 @ 3:42pm
< >
Showing 1-15 of 26 comments
Bloo Alien Jul 1, 2022 @ 7:12pm 
Regarding using wildcards vs typing full filenames, I haven't typed a full filename in many years now. Almost every shell I know of supports <TAB> key completion, not only for filenames, but many also for commands and even command options. Type the first few letters of a filename (starting with a quote character if the filename/path is known or suspected to contain spaces) and press the <TAB> key to complete the rest of it. If there's more than one name starting with those characters, most shells will give you a list of choices you can select from with arrow keys and <Enter> key.

Another handy trick I use to avoid mistakes with rm or mv (remove or move) commands is to simply use ls (list) with my wildcard until I'm 100% certain I've got it listing only the files I intend to delete or move, then I just up-arrow to my ls command and edit that line to mv or rm instead of ls.
Last edited by Bloo Alien; Jul 1, 2022 @ 7:14pm
BottomScorer Jul 1, 2022 @ 9:34pm 
many commands have dry run option but not all
N0P3 Jul 1, 2022 @ 10:45pm 
lots of file explorer/managers will let you open an escalated privileged instance where you can simply delete the file or directory on the spot; I generally use what ever is the closest be it command line or gui manager. I understand your frustration/paranoia, but just take a deep breath and step into the stuff slowly.

Most all linux systems will allow you to open a terminal in a directory then type in the command: sudo rm (followed by a space) then simply drag and drop the file you want to delete onto the terminal and press enter/return.

An easy way to get accustomed to file & directory management in linux (as any other OS) is simply make dummy directories and files and delete, copy and move them around when you get some spare time. It'll be okay.
Bloo Alien Jul 1, 2022 @ 11:32pm 
They're just gettin' to learn all the nifty little file management tricks today…

So, about the original question of a true "Undo" option, one way you can really truly undo actions in any operating system is to run that operating system inside a virtual machine like VMWare or VirtualBox and just take a VM "snapshot" every time things are all feelin' "perfect", and just before you do anything you think is gonna be "risky". Then you've always got snapshot points to fall back to no matter how badly you screw stuff up inside the VM. Great way to practice things that scare you, or test things you know are gonna trash things… Virtual machines are a great way to explore and take risks with computer stuff without any actual risk involved.
Bloo Alien Jul 2, 2022 @ 5:18am 
Originally posted by nat:
Originally posted by BottomScorer:
many commands have dry run option but not all

what is dry run option
Dry run means to pretend to do the thing and print out what would have happened if you'd really done it.
Zyro Jul 2, 2022 @ 8:20am 
Originally posted by nat:
Originally posted by Bloo Alien:
Dry run means to pretend to do the thing and print out what would have happened if you'd really done it.

thanks

could you provide dry run commands for rm, mv, cp, wget, youtube-dl if you know them and if you can be bothered sharing?

also, is a dry run any different from piping output into /dev/null? or is /dev/null a universal dry run?

Dry-run is an option some programs have. Apt on Debian/Ubuntu for example. It tells you what it would install/remove without actually doing it. The closest to a dry run derivate for rm would probably be "ls". If you're often unsure what a program like wget or youtube-dl will download, do it in an empty temp dir.
Last edited by Zyro; Jul 2, 2022 @ 8:21am
you can just use the rm command to delete whatever was downloaded inproperly
Marlock Jul 2, 2022 @ 10:12am 
Originally posted by The Xenoblade guy:
you can just use the rm command to delete whatever was downloaded inproperly
i think OP's point is more like:
[DO NOT RUN THIS]
sudo rm -rf *
oops! classic way to delete the entire system!
ok, keep calm, just don't reboot yet...
undo 1
phew! my stuff is back

this of course makes sense for only SOME operations, while for others the damage may not be straightforward to revert

it's an interesting concept (but of course totally fictional for now), that would probably sit well in a Stack Exchange question...

... hum, probably has been asked there already...

yep, there is a few takes on the same idea and a zillion questions on undoing specific things if anyone is interested:
https://stackexchange.com/search?q=undo+linux+terminal+commands
Last edited by Marlock; Jul 2, 2022 @ 10:21am
Originally posted by Marlock:
Originally posted by The Xenoblade guy:
you can just use the rm command to delete whatever was downloaded inproperly
i think OP's point is more like:
[DO NOT RUN THIS]
sudo rm -rf *
oops! classic way to delete the entire system!
ok, keep calm, just don't reboot yet...
undo 1
phew! my stuff is back

this of course makes sense for only SOME operations, while for others the damage may not be straightforward to revert

it's an interesting concept (but of course totally fictional for now), that would probably sit well in a Stack Exchange question...

... hum, probably has been asked there already...

yep, there is a few takes on the same idea and a zillion questions on undoing specific things if anyone is interested:
https://stackexchange.com/search?q=undo+linux+terminal+commands
I mean first
Don't run stuff you don't know what it's going to do.

second. Use timeshift to keep backups

Or if you are really fancy. Opensuse uses btrfs by default and creates read-only snapshots are every interaction with YaST or Zypper. It makes it almost impossible to permanently brick your system due to how easy a recovery is. Although that features was likely just made for enterprise users and is just there in tumbleweed, because why not?
BezaoBuilder Jul 2, 2022 @ 12:49pm 
btrfs lets you have snapshots and roll back them.
Originally posted by BezaoBuilder:
btrfs lets you have snapshots and roll back them.
if you had enough storage, couldn't you just make a btrfs snapshot after every single terminal command and every time you open or close an app?
That way you could have an "undo" command
FWIW `man -K "dry-run"` will find all the programs---you have the man page for---that mention dry-run (backup programs mostly I think).
Bloo Alien Jul 2, 2022 @ 3:09pm 
Originally posted by nat:
could you provide dry run commands for rm, mv, cp, wget, youtube-dl if you know them and if you can be bothered sharing?

Other folks already covered this better'n I could it would appear, including making mention of "snapshot" capable filesystems like BTRFS and snapshot style backup tools like TimeShift, so I'ma defer to those answers.

Originally posted by nat:
also, is a dry run any different from piping output into /dev/null? or is /dev/null a universal dry run?

Piping output to /dev/null does nothing to protect against potentially harmful commands, and is actually not fun if used in combination with potentially damaging commands, because it's a convenient way to throw away unwanted output so that you never see it at all. This of course is bad when you want to see output (like from a damaging command) to help you recover from a bad situation. Only ever pipe your output to /dev/null when you really want to totally throw away / hide that output because you know it's pointless debug details or other unneeded information you're throwing away on purpose. Anything piped to /dev/null goes into a "black hole" never to return.

Note: Piping to /dev/null throws away output but not actions. The actions are still performed, just with no visible output from the commands being run.
Last edited by Bloo Alien; Jul 2, 2022 @ 3:11pm
Marlock Jul 2, 2022 @ 5:37pm 
to better illustrate the /dev/null thing, if you run this:
mv /my/precious_file /dev/null
you're not preventing your precious_file from being destroyed... you're ensuring it, by moving it from "my" folder into /dev/null, AKA sending it to oblivion

meanwhile a dry-run would be something like:
mv --just-kidding /my/precious_file /other_folder
it would output everything the real command to move your precious_file into the other_folder would output in the terminal, plus some "this is just a drill, not a real fire" warning, and wouldn't really move the file
Last edited by Marlock; Jul 2, 2022 @ 5:46pm
Bloo Alien Jul 2, 2022 @ 8:05pm 
Originally posted by nat:
RM sucks anyway, as far as my knowledge goes its always been known for permanently removing important files by accident - whereas a file explorer has a recyle bin or a trash

Hey, I gotta solution for that one too… Nothing really wrong with the rm command other than the danger of misusing it accidentally, or with a bad wildcard, but if you're so seriously concerned about that danger as you appear to be, there's a couple of ways you can improve your safety surrounding copying, moving, and removing files with commands.

My first suggestion (since you mentioned file managers and their "trash" or "recycle bin" safety net) is that you can search and install "trash-cli" in your package manager. This gives you a "trash" command which interacts with the system standard trash/recycle bin facilities to move deleted files there, instead of removing them entirely like rm does.

Second suggestion is to check into cp, mv, and rm and their "interactive" flags, and your favorite shell's means of defining command aliases. I have cp, mv, and rm all aliased to default to using the -i (interactive) flag, where I get asked yes/no are you sure for any dangerous actions which might overwrite or remove data.

Originally posted by nat:
I was just thinking about the concept of an undo command because it would be neat, and wondering if one exists for my convinience.

Regarding that original request; Perhaps someone crafty could cobble together a tool using a combination of "trash-cli" and a backup/snapshotting tool or filesystem that fairly closely fits what you describe, but as yet I personally know of no such existing tool. That's not to say no such thing exists at all, as I still don't know every tool available to we Linux users as there's simply far too many really slick tools out there, and folks writing new ones daily.
Last edited by Bloo Alien; Jul 2, 2022 @ 8:08pm
< >
Showing 1-15 of 26 comments
Per page: 1530 50

Date Posted: Jul 1, 2022 @ 5:33pm
Posts: 26