• The Picard Maneuver@startrek.websiteOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      I’d welcome any beginner tips you have!

      I have Linux installed on a raspberry pi, using “Pi OS”, which I understand to be some form of Debian? I’ve learned enough to comfortably SSH into it and navigate around my file system, as well as write some really basic Python programs for the pi using nano.

      I’ve only been at it casually for a few weeks, so that’s about the extent of my knowledge.

      • Alex@feddit.ro
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Yup, Pi OS is Debian with a few custom configs and (I think) the pixel desktop environment (though they might have changed it to Wayfire).

        Btw, in Linux, everything is a file. Some are in /sys and /proc for the kernel, others in /dev for devices. So you can do neat stuff like changing your backlight by printing a number to a special file!

        Also, commands have 3 streams: stdin (standard input, usually keyboard), stdout (standard output, usually terminal), and stderr (standard error, output, almost always terminal). You can often pipe programs, so one’s stdout goes to another’s stdin. Stderr is used for human-readable errors and is usually not piped.

        Combining the last 2 things, if you pipe a program into /dev/null (which is like an infinite void or a trashcan), it’s like ignoring its output.

        • The Picard Maneuver@startrek.websiteOP
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 year ago

          Btw, in Linux, everything is a file.

          This sounds cool. Do I also understand right that file extensions aren’t anything more than the file name?

          I can also conceptually appreciate the input/output/error piece, although I bet it’ll make more sense when I find a use case for it eventually. Thanks!

          • Alex@feddit.ro
            link
            fedilink
            English
            arrow-up
            3
            ·
            1 year ago

            Do I also understand right that file extensions aren’t anything more than the file name?

            For the kernel, yeah. A lot of apps use them, though, but mostly for determining whet kind of text plain text files are.

            But files have some “mode bits” at the start, hwich tell the kernel if they’re executable, and whether they should always have root (admin) perms.

            Speaking of root, that’s the user with full perms. Root can access any file on the system, and can basically do anything. Root is also known as the superuser. When you use sudo, you run the program as root (it stands for “Super User DO”).

            Thanks!

            You’re very welcome!

            • AVincentInSpace@pawb.social
              link
              fedilink
              English
              arrow-up
              2
              ·
              edit-2
              1 year ago

              and whether they should always have root (admin) perms.

              Not quite! The setuid bit means the file will be run as its owner, not necessarily as root. The most common use for this (which is used by sudo) is to have the file owned by root and executable by everyone, so that when anyone runs it it will run as root, but you can also use it to have a program always run as any user (thus limiting what it’s allowed to do). There’s also a setgid bit so it will be run as its owning group, which is less frequently used. Fun fact!