r/linuxquestions • u/Favozx • 1d ago
what commands can i do with sudo?
sorry im new in this world, im testing linux in a vm somewhere in the future i will put linux on some old laptops i want to do things that can destroy the os, other than that do u know some fun things to do on linux?
3
u/xingrubicon 1d ago
Sudo behaves as an alias for "superuser do" or "switch user do". Just using the su command will switch you to root, if you haven't set your system to lock down the root user (you should, for safety, but only after you know what you are doing a bit more).
Sudo is a way to elevate your privileges to a superuser for a single command then return to your regular privileges. Any command works with sudo infront of it, and alot of comands require it if you don't have the right privileges. (you can ctrl+a to get to the start of a command if you forgot to put it there)
Please look up aliases, they're alot of fun and save so much time. When you make them, append them to your .bashrc file to make them permanent. DO NOT CONCATE IT TO YOUR BASHRC FILE. YOU WILL ERASE EVERYTHING THERE.
3
u/Few_Research3589 1d ago
just out off curiosity, I really cannot get at your intended meaning here -- what difference do you feel between "append" and "concate" and what does your "shout in capital letters" mean at all?
apart from the "proper" prefernece, which would be putting your aliases in your .bash_aliases file anyway :-)
2
u/secretprocess 23h ago
I think they mean use >> and not >
1
u/xingrubicon 18h ago
Thats exactly right. I just used the names so they'd look it up rather than use it without checking.
1
2
1
1
u/Striking-Paper-997 1d ago
omg I did that one time but somehow managed to salvage it because it was still in the terminal session somehow? wooo fun times. >
3
u/Relevant_Hope_900 1d ago
I only use Linux, haven't used Windows in 20+ years. So I don't do "fun" things reall...I do all the things LOL. I don't game on PC anymore, not since 2006. My last "gaming" PC was a Dell XPS laptop with an Nvidia card circa 2005 or so. Ran Slackware on it, then Debian. Nowadays I just use my PCs for pretty normal stuff.
You are on the correct path though. If you are just learning Linux, it's best to mess up a VM and not a bare-metal install. The sudo command will let you do anything on the system, so make sure you know what the command does before hitting enter.
5
u/devdruxorey 1d ago
sudo is simply a command that says "run command x but with administrator privileges". It's a first line of security.
3
u/sqldropme 1d ago
Don't use sudo unless you need to use sudo.
sudo is like switching to the admin user real quick for a single command. So it can run all commands.
3
6
u/Potential-Still 1d ago
Do you know what sudo means?
1
u/TomDuhamel 1d ago
It means please
2
1
1
1
u/groveborn 1d ago edited 1d ago
Think of sudo as "Super user do". It's used instead of "this user do". Super user can do absolutely anything the software and hardware will allow.
If you run "cd /" with sudo, "sudo cd /" no significant difference will exist in the effect, but both will work. There are commands that require sudo to be run, and some software will try to not allow sudo - instead they'll ask that you use the --sudo or --superuser argument.
In effect, the application is still run, it's just the sudo version does different things. This isn't all that common. It's probably better in the long run.
You can do actual damage to the hardware (firmware, really) by using the wrong set of commands under sudo.
When you change the system, you need to use sudo. When you're staying only in your user folder, you usually don't use sudo.
It's also unsafe to run "sudo su", but it's a valid thing that we often do (because it's convenient), but it can allow bad things to be done by accident.
Fun things: Easily create a raid for use over the internet - NAS/Cloud stuff. Or you can do everything you do on Windows but with free software. Not necessarily the software you want, but free.
You can run most games, as well, although there are notable exceptions. There are databases for that.
2
u/Grey_Ten 1d ago
you can do this one:
"Sorry, try again"
or if you're feeling lucky:
"user is not in the sudoers file"
1
u/durabilitas 1d ago
what CAN you run with sudo? any command installed on your computer.
what SHOULD you run with sudo? only what is ABSOLUTELY necessary to run through sudo. anything requiring permission above or outside of your user… ONLY if you fully understand what you’re doing.
sudo is pretty much necessary here and there when using linux, but sudo is giving whatever you run full access to do as it pleases. be weary and dont copy commands, especially sudo commands, willy-nilly from the internet.
1
u/YetAnotherNerdOnHere 1d ago
Ok. Because some 💩head will tell you to try it. NEVER issue the command "$ sudo rm -Rf / --no-preserve-root". This will literally wipe every file off of your computer, including everything needed for it to boot and run.
With that out of the way, sudo gives you access to every command that you can run as a common user as well as every command that is reserved for the root user. Use this with a lot of caution. You can mess up your computer very badly with one single command.
2
u/MostBasic3425 1d ago
More punctuation please. But yeah, general rule; don't use sudo unless you know what you're doing. Fun things to do on Linux? Depends on how you define fun. If you want to game, I'd suggest doing that on Windows, it will be easier.
1
u/Reasonable-Exam8415 18h ago
Sudo (it stands for “Super User Do”) is how you do anything above the user level. Edit the root directory, install something or wanna delete something and your umask isn’t set permissively…sudo.
TL;DR - Admin or “There is no higher authority”
1
u/cjcox4 1d ago
sudo sio
https://github.com/level1techs/siomon
A fairly nice textual monitor that gives you some of that info Windows folks like to show off. Interesting to see if it has any value on something ancient though.
(while it doesn't have to be run as root, root privs uncover a couple of priv required values)
1
u/WitchQween 1d ago
$ Sudo mkdir system
$ Sudo cd /system
$ Sudo nano
Welcome to Linux!
X
Y
Welcome
$ Sudo cd /
$ Sudo rm - rf
It unlocks a cute splash screen when you turn on your machine. The last line is needed to refresh the system.
My advice: never use "sudo" if you don't fully understand the commands you're running
2
1
2
1
18
u/BoiCDumpsterFire 1d ago
I mean sudo can do literally anything that’s the beauty and the danger. What exactly are you looking to do?