for real though, modern linux distros will rarely require you to enter a command line, and if you do, a quick internet search can usually help you find out what you need to enter
I've lived in various Unix terminals for the last decade+ and cmd.exe scares the shit out of me. Well no it doesn't, but I hate it and I'm always pretty sure I'm about to brick the whole computer. Which is an improvement tbf if it's running Windows
it's awesome how every tutorial on how to change anything deep about Windows starts with "Hit
Win+R
and typeregedit.exe
. WARNING: Editing your Windows registry can have potentially catastrophic results for your system. Please make a restore point before following this tutorial."Meanwhile it's 100% possible to torch your system without warning with
rm -rf
in the wrong place and I love that.rm
is the unix command for remove — it deletes files and directories.The
-r
flag, or--recursive
recursively traverses all the directories in the path file that you specify (so like if you have a directorystuff/
which has filesa.txt
,b.pdf
, and subdirectoryc/
thenrm -r stuff/
would remove both files as well asc/
and its contents.The
-f
flag, or--force
, does what it says on the tin: it deletes everything without prompting you or warning you about what it's going to delete.So it's possible to delete all the files on your system — including ones that the operating system needs to run — with
rm -rf /
. It's very hard to do on accident these days — usually you need superuser permissions (thesudo
insudo rm -rf /
) which requires you to enter your administrator password and to also pass the flag--no-preserve-root
which was created to keep people from deleting their whole system because someone named pigpoopballs69 on a random forum said to runsudo rm -rf /
The -r flag, or --recursive recursively traverses all the directories in the path file that you specify (so like if you have a directory stuff/ which has files a.txt, b.pdf, and subdirectory c/ then rm -r stuff/ would remove both files as well as c/ and its contents.
So what would happen if you just did "rm stuff/" without the recursive flag? Shouldn't it work the same way and delete all of stuff/ contents?
also how do you do that code font thingy
is a subdirectory basically the linux version of a folder?
https://unix.stackexchange.com/questions/44967/difference-between-cp-r-and-cp-a
rm stuff/
without the recursive flag fails with an error (rm: cannot remove 'stuff': Is a directory
) and doesn't remove anything. I'd guess the decision there was to have the least-destructive end result for ambiguous behavior, but I'm not entirely sure what the history is there, pretty sure that command is older than I am :)The code font thingy is the back tick character: `
To be fair, doing registry editing in Windows can end that way to. Or deleting system 32.
Oh yeah totally. I'm biased by my experiences, but I think there's much more of a risk with Windows, you have to go pretty far out of your way to actually nuke your whole system with
rm
, it's very hard to do on accident. Now,dd
on the other hand...
in my experience it's quirky and inconsistent in ways that make it easy to make mistakes that make your computer unusable
Not to mention you use it so rarely you'll consistently type unix commands out of habit, followed by a quick bout of swearing.
The most handy thing about the Linux shell is googling "how do I configure___ " and then someone says "just run this: _____" and you paste it in and you're good.
That said, I'm giving bad advice in that you should never run a command on your computer that you don't understand.
That said, most people just do it anyway and it usually works out, but the more you take your time to dissect a command before hitting Enter, the safer and easier things'll be.
Honestly, my biggest gripe with the terminal is how little info it gives you about what you're about to run.
It would be nice if distros included a decent zsh config with autocomplete, auto-help text, and syntax highlighting.
My needs are met by those and stuff like
tldr
,cheat
&howdoi
, but I am specifically looking for something much more discoverable and inline as I type the command.Basically, I want:
fzf
completions (or any fuzzy searcher w/ previewing)- commands and aliases showing description from
man
beneath - file/dir completion showing devicons & file previews
- flag/option completion while displaying the corresponding help text beneath
- integration with some of the tools like
tldr
,cheat
,howdoi
,navi
, etc
I switched to fish last year, and I haven’t looked back. It feels like so much less of an abomination than zsh or bash, and I’ve barely modified it out of the box. Might be worth a whirl, the completion stuff rocks.
i used to use fish, but having to translate scripts from POSIX to fish syntax got annoying. great shell otherwise
arch's installer has a really nice zsh setup, but it's not installed by default unfortunately
Hmm I'll look into it. I've been having trouble finding anything that meets my desires in terms of autocomplete/suggestions. Right now I'm doing mostly manual configuration because all the plugins are missing something in some regard.
Agreed. Though, there is a lot of really great stuff in the zsh ecosystem. The problem with zsh (and bash, etc) is the archaic completion system, and all the community stuff is built on top of antiquated decisions.
That said, I’m giving bad advice in that you should never run a command on your computer that you don’t understand.
totally, most of the time you'll be fine but it's worth learning some of the basic commands (ls, rm, cd, etc.) so you can at least understand what commands do. on systemd-based distros (most of them are these days for those unfamiliar), it's a good idea to learn how to use systemctl as well
Most basic users would only really need to learn apt to fill in the gaps and use GUI stuff for the rest.
Tbf if only ran commands that I understood I wouldn't be able to operate Linux, but I'm probably an edge case anyway.
No I know, like I said everyone does it, but I'd feel bad "officially" condoning it. Hopefully you'll pick up some things along the way.
Those who're really worried should give Linux a shot via virtual machine or Live USB (easier) and see for themselves whether they really need to use the terminal or Linux is even easier than Windows
You get a package manager (app store) where you can install all your software and update them and the system itself in one click!!
Yeah, I think this is a good point that new users should know. You can always test drive before installing. There's no need to start with a full install right away.
Yes, personally I like what I'm doing. I'm dual booting for now until I get my Linux set up how I want it and it's all stable. Then I'm deleting windows.
Let us know at !libre when you completely ditch Windows and don't hesitate to ask if you've any trouble
:rat-salute:
The linux community often gets a bad rep for how they treat newbies. Can't say I ever really experienced that much myself, but even if it's true, the community does an amazing job of collecting resources and information that can be used by anyone if they ever wanted to. I won't claim to be great at terminal, but it certainly isn't nearly as intimidating as some people make it out to be.
The linux command line is fucking great. I'm a UX designer, but it's crazy how stupidly fast it is over a gui if you're trained.
You type a command. Output normally goes to text on your screen. Put it through a pipe. Now that text can go into a file. Or you can filter it. Or you can send it across the internet. Pretty much anything your computer is capable of doing can now take that command’s output as input. Pipes!
You know when you have a document open in two programs at once, like an excel spreadsheet or something, and you make a change to it and that updates something somewhere else? That's a form of piping. Basically just sharing data between programs.
When you're using a terminal, you interact with programs by calling them by name then giving them commands (like a terminal version of googling something would be like "google -imagesearch 'pig poop balls' " or whatever). So piping in this case would be taking the output of that search then plugging it into another program, say Gimp so you can edit the photo output:
"google -imagesearch 'pig poop balls' | gimp -load"
Totally not a real example, but it's how a pipe works. In this case running that command would save you opening google, finding the image, copying the image somewhere, opening gimp, and loading the image in.
if you know how to do things with the program in the command line too, you could do something cool like get an image, load it into gimp, and output a converted version of it or and edge detected version of it or whatever without ever even seeing the image until it outputs to a folder. It can make doing big repetetive tasks super easy. Just define the command, save it as a script, and run it later. Don't even have to look at the gimp code as long as you know how to use the terminal commands.
The design imperative to hide the command line as much as possible in a modular OS which fundamentally relies on it only makes the user more confused when they need to use it to fix something or improve their experience somehow, which they will have to do. The real solution is to expand and improve tools designed to teach CLI software, be that bro pages, better man pages (or maybe a decent GUI
man
), searchable hypertext documentation, and also consciously deciding to devote project resources to good documentation.also death to Tux, long live Xenia
PowerShell is also that terrible bright blue color and some absolutely garbage tab completion.
Because PowerShell is better than a traditional terminal because it doesn't keep all the legacy crap from like the 1970s physical terminals lol. It's basically a programming environment with actual data types but in a terminal syntax flavor, instead of this insane string concatenation/parsing/piping machine. It's main problem (having used it a tiny bit but not a crazy amount) is that it doesn't have powerful enough commands, has a terrible paginator (it's worse than the "more" command), and that Windows in general sucks.
Yeah it didn’t keep all that 1970’s crap, just all that 1990’s crap. “Terminal, but object-oriented” is nonsense language invented by crazy people and I will not stand for it. No I am not bitter from dealing with the Office API why do you ask?
Undocumented enums. Senseless abstraction boundaries. Documentation is often out of sync. Permissions are implicit or buried in docs. I could go on
Documentation is for losers and nerds 😎
All my homies inspect the source code to figure out how to use functions 😎👍(except when it's Office and it's closed source)
I once wrote a small script to take a few inputs from a dialog box and pick a file in powershell and that motherfucker is something like 50 lines of code. Making an input box in Linux is literally a one-liner with
zenity