this post was submitted on 25 Feb 2024
460 points (98.7% liked)

Linux

55887 readers
551 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

If you have any suggestions or criticisms, feel free to comment them.

Being plain text, it's much easier to read on a wide screen, or on something without line wrapping.

all 50 comments
sorted by: hot top controversial new old
[–] adam_y@lemmy.world 30 points 1 year ago (1 children)

This is really good. Clear and well laid out.

The only thing that might confuse some beginners is your specific choice of package manager.

[–] asciiandarch@lemmy.ml 19 points 1 year ago (1 children)

I added more information to the installing software section, updated section title to specify Arch Linux, and added another section for Debian and Derivatives.

[–] adam_y@lemmy.world 10 points 1 year ago

You're awesome.

[–] Pantherina@feddit.de 19 points 1 year ago (1 children)

Interesting compilation, there is cheat.sh, tldr and others though

[–] asciiandarch@lemmy.ml 27 points 1 year ago

I made this just as much for me as I did for others. Writing things down myself really helps me memorize them.

[–] jjjalljs@ttrpg.network 15 points 1 year ago (1 children)

Nice work.

My tiny nitpick is that "touch" will create the file you specify if it doesn't exist. I've seen this usage a lot, so your example may benefit from mentioning it.

[–] tromars@feddit.de 1 points 1 year ago

TIL „touch“ has other uses than creating a file

[–] asciiandarch@lemmy.ml 12 points 1 year ago

Thanks for all the feedback! I'm much happier with it now, and I'll probably continue to make small changes over time.

[–] charles@lemmy.world 10 points 1 year ago* (last edited 1 year ago) (1 children)

I find the references to file extension kinda confusing. Extensions mean a lot less in Linux cli, but I can tell youre just using them for examples. Maybe give more concrete examples instead.

ls *.sh to list all the files ending in .sh

[–] asciiandarch@lemmy.ml 9 points 1 year ago

I updated various examples, and replaced with in most places and removed it from the legend.

[–] Sonotsugipaa@lemmy.dbzer0.com 7 points 1 year ago* (last edited 1 year ago) (1 children)

I don't know how this would be useful to someone reading the cheat sheet, but here's something interesting I just indirectly found out while skimming it through:

Ctrl+D does the same thing as ENTER, except the latter additionally sends the end-of-line character to the reader while the former sends nothing;
as is the case for shells or interactive programs like the Python REPL, Ctrl+D causes them to terminate only because it sends a string that is 0 characters long, and 0-size reads are universally interpreted as files reaching the end.

To test this: enter cat, type "hello" without pressing enter, then Ctrl+D: you should see "hellohello".
An extremely rare case of this being useful would be using netcat to send a string somewhere, without sending the end-of-line byte at the end.

[–] asciiandarch@lemmy.ml 5 points 1 year ago

I updated "Log out" to "Exit (sends a signal indicating the end of a text stream)". Which I think is a lot more accurate, and still easy to understand.

[–] j4yt33@feddit.de 6 points 1 year ago

Cool, thank you!

[–] lars@lemmy.sdf.org 6 points 1 year ago

Oh. My. Gosh. I love this. Thank you. And thank you for being --verbose about the provenance and history of the document. And big big thank yous for the Internet Archive links. Bravo.

[–] charles@lemmy.world 5 points 1 year ago (2 children)

What do you mean about "/ root directory, eg /usr/bin/bash"? / is /, just the top-most directory

[–] mundane@feddit.nu 3 points 1 year ago

Yes, the top most directory, /, is the root directory.

Each directory is a branch in one giant tree structure. For example, if you have a directory containing two other directories, that is a branch that is splitting into two branches. All directories are descendants of the same root.

[–] asciiandarch@lemmy.ml 3 points 1 year ago* (last edited 1 year ago)

I added more detail to the description and made a more relevant example. (I think)

[–] jackpot@lemmy.ml 5 points 1 year ago (1 children)

would you upload this on github?

[–] asciiandarch@lemmy.ml 5 points 1 year ago (4 children)

Done? I've never uploaded to GitHub before, and I was just doing what I thought I should do. I'll do my best to keep it updated with the version on my website.

https://github.com/ordinarybyte/linux_cheat_sheet

Is there a way to make GitHub automatically detect changes to the file at cerium.cc and update the repo? Or do they not allow that? I know a scheduled script would be able to work but I don't really want to have to run it myself.

[–] TunaLobster@lemmy.world 1 points 1 year ago

Usually you would go the other way around. Merge changes into git and then distribute from there.

[–] cafuneandchill@lemmy.world 1 points 1 year ago

You can do some automation with GitHub Actions, but I have no idea if it can do specifically that

[–] wuphysics87@lemmy.ml 4 points 1 year ago

You might consider putting a license on it

[–] RichSPK@lemux.minnix.dev 4 points 1 year ago

I've been using Linux for decades and I bet that'll still come in handy.

[–] Flyswat@lemmy.ml 4 points 1 year ago (1 children)

cd - changes to the previous directory

[–] ccdfa@lemm.ee 1 points 1 year ago (1 children)

Does cd + work to go forward after using cd - ?

[–] nigh7y@lemmy.ml 1 points 1 year ago

cd - negates cd -, so you're right back where you started! It's like multiplying 2 negatives.

[–] harsh3466@lemmy.ml 3 points 1 year ago

This is fantastic. Just at a glance I already learned something new! Definitely keeping this for reference.

[–] NOOBMASTER@lemmy.ml 2 points 1 year ago* (last edited 1 year ago)

Aren't Alt + Backspace, and Alt + Arrow Key Left/Right also terminal shortcuts?

I like your version, I am bookmarking it.

[–] titey@jlai.lu 2 points 1 year ago

This is really nice!

[–] liquidapricity@lemmy.world 2 points 1 year ago

This is really helpful, thank you.

[–] pH3ra@lemmy.ml 2 points 1 year ago

Really cool!
Another good addition to this might be some script rudiments, like how to write and run simple .sh files

[–] huf@hexbear.net 2 points 1 year ago

^S - stop terminal IO
^Q - resume terminal IO (if your terminal looks frozen, this is the one to try)
alt-b, alt-f - jump back/forward one word

[–] Postreader2814@lemm.ee 2 points 1 year ago (1 children)

You're a prince among men.

[–] stoicmaverick@lemmy.world 2 points 1 year ago

And an Albert among princes.

[–] Chakravanti@sh.itjust.works 1 points 1 year ago

A little over a decade & a half and I find that very useful. Should have GPG in for reading signatures on software and such too. If you'd like I can contribute to GPG terminal as I've been using it for a good portion of that time.

[–] YeetPics@mander.xyz 1 points 1 year ago

I owe you bigly

[–] shaytan@lemmy.dbzer0.com 1 points 1 year ago

I've needed something like this for a while, thank you buddy

[–] SidewaysHighways@lemmy.world 1 points 1 year ago

Awesome! Thank you kindly

[–] Diplomjodler@feddit.de 1 points 1 year ago

Great idea. I'll keep this handy from now on.

[–] tgt@programming.dev 1 points 1 year ago

At the end, in redirection, <<: that's not how here-documents work. The example gives the impression it will read the given file up until "STOP", but in reality the shell expects you to keep writing your here-doc until you write "STOP" and then feeds it to the program as if it were all on stdin. I don't think wc even does anything with the stdin if you give it a filename... Note that variable expansion will happen in here-docs, so it's a bit different than a simple cat. Also look into here-strings. And process substitution, I find that quite handy.