1
8
submitted 3 days ago by dt3@lemmy.zip to c/learninglinux@lemmy.zip

You have 3 ways to support the community

  1. Share the Community with your Friends

  2. Post anything here (about Linux) even if a stupid post

  3. Comment on the already made posts

Thank you for supporting the community

2
24

Intimidating to be the first to post here, but I'm sure I'll get something wrong, and there's nothing like correcting someone for activity eh? ๐Ÿ˜†

So for a first off-the-cuff post, I thought I would just explain some file locations you'll see a lot learning linux, and mention a few tools. Feel free to add more of both in the comments!

Locations: / The most important location on any Linux machine, not to be confused with root's home directory, this is the starting point of the Kernel's access to any file, and in Linux everything is a file. This isn't a hard drive itself, but often points to the base of a hard drive. During bootup, one of the key steps is mounting the / filesystem. Essentially the operating system needs to establish a common logical tree to find things, and this is the base of that tree. I'm sure there is some exceptions I can't think of, but everything actively being used by your system will be under here somewhere.

. .. Related so I'll tackle these together. The . and .. directories will be found as children of every folder on your system, and point to places relative to your current one. The . directory is the equivalent of your current directory. .. points to the directory that contains the one you are in. Also . has a special meaning as the first character of a file name. It indicates in that case the file should be hidden to programs that respect that.

/home This is a very common, but not universal folder under root. It is semi-equivalent to the Users directory in windows. Most users will have a folder under here to store their files. /home/root/ is the typically inaccessible to non-privileged user home for the root user for instance. As a bonus ~/ will point to your own home folder on most systems.

/bin Home of the binaries. /bin, /sbin, /usr/bin and /usr/sbin are where most local applications will be installed. Don't remember the exact distinction between /bin and /sbin but sbin seems to contain more system utilities.

/usr is a directory for holding user files. Not the same as home, but I think in the sense that they are distinct from system files and libraries

/lib where most libraries go. /usr/lib is also around for this. You likely won't spend much time here.

/etc the place for all your system configurations. This contains mostly text files that are read by various programs for default settings. Only edit here if you want a change for all users. Usually for one user programs will read a file in /home/user/.config or a similarly unique to them locale.

/boot Not always around, but as you can imagine it holds important files for starting the system. In most Linux distros the file that contains the Kernel is in here, along with some other tools to help get you to a full machine. Don't mess around in here until you're ready to dig in.

/sys /proc These directories are used to store and display information usually used by the kernel. Both very powerful and very dangerous. Writing into the wrong file here can change electrical settings for devices, and it is easy to get lost in the looping/nested structure

/dev This is where your devices are kept. When you need to tell a program where a peripheral, a disk, or an internal resource can be accessed this is the folder for it

Tools:

Running out of steam so I'll keep it short

-x If I use this I mean a flag passed to the command. So cp is the copy command. If I want it to work recursively and copy subdirectories I need to give it the r flag. So the command becomes cp -r

ls LiSt files. Basically just prints out the contents of a directory. -a tells it to list everything even hidden files

cp for CoPy

cd is Change Directory

du lists Disk Usage You can use -d to ask it to summarize things up to a Depth and -h to ask it to print sizes in a way that is human readable

df lists Disk Free

sudo is used to run a command as root. This one comes from su the program it mostly replaces, which itself is I believe for Super User. So sudo is really Super User Do.

Lastly some flags are respected by many different programs. Not all, but many. So -h for help, -v for extra logs, and -V for version for instance are very common

That should be enough to get things started. Please chime in with essentials I missed, mistakes I committed, or tricks with any of the commands.

3
15
submitted 6 days ago by dt3@lemmy.zip to c/learninglinux@lemmy.zip

In Linux why have tools that might differ from a distro to a distro

So today I will talk about those tools

  1. ls

ls refers to list directory it useful for seeing your files through the terminal or the tty

Fun fact: Omarchy uses a custom ls

  1. cd

Its made to go from a directory to another like ~/ $ cd Downloads takes you to the downloads folder but Downloads/ $ cd ../ takes you to the directory before you

Fun fact: ./ means current directory

  1. Bash (or sh or zsh or fish)

That's the default shell in most distros It makes you able to use the tools and apps but some Arch users like to use zsh or fish while sh is more older

Fun fact: most initramfs uses ash

  1. grep

Its helpful when you want to see something from a file but you don't need to read the whole file like ~/ $ cat test | grep something

Fun fact | means give output to next command

  1. cat

cat looks at files and gives you the output so ~/ $ cat test shows you what is inside the file

Fun fact: typing cat /dev/urandom will fill your terminal with binary so never try cat /dev/urandom

But actually the userspace tools differs in most distros they use GNU tools while alpine uses busybox or some Linux from scratch systems may use sbase or you could code your tools

I hope you learned something new

4
11
submitted 6 days ago by dt3@lemmy.zip to c/learninglinux@lemmy.zip

Want to run virtual machines on Linux Mint? QEMU with KVM and virt-manager is a great alternative to VirtualBox.

  1. Update your system

Open a terminal and run:

sudo apt update sudo apt upgrade

  1. Install QEMU, KVM, and virt-manager

Run:

sudo apt install qemu-system-x86 qemu-utils libvirt-daemon-system libvirt-clients virt-manager

This installs:

  • QEMU: Emulates virtual hardware and runs virtual machines.
  • KVM: Provides hardware-assisted virtualization on supported Linux systems.
  • libvirt: Manages virtual machines and their resources.
  • virt-manager: A graphical interface for creating and managing virtual machines.
  1. Enable libvirt

Enable and start the libvirt service:

sudo systemctl enable --now libvirtd

Add your user to the relevant groups:

sudo usermod -aG libvirt,kvm "$USER"

Log out and log back in so the group changes take effect.

  1. Check virtualization support

Check whether your CPU exposes virtualization support:

lscpu | grep Virtualization

You can also check whether KVM is available:

ls -l /dev/kvm

If "/dev/kvm" is missing, check whether Intel VT-x or AMD-V is enabled in your firmware settings and whether your system supports KVM.

  1. Launch virt-manager

Open the application menu and search for Virtual Machine Manager, or run:

virt-manager

Choose the local QEMU/KVM connection, then click Create a new virtual machine.

Select an installation ISO, choose your memory and CPU allocation, create a virtual disk, and start the virtual machine.

What about VirtualBox?

VirtualBox can run on Linux Mint, but certain versions may have dependency issues or fail to build their kernel modules after a kernel update. The version in Mint's repositories may not always be compatible with the kernel you're running.

QEMU/KVM with virt-manager is a good alternative, and it integrates naturally with Linux's virtualization stack.

Happy virtualizing!

5
11
submitted 6 days ago by dt3@lemmy.zip to c/learninglinux@lemmy.zip

Here I'm gonna tell you how Linux works From the beginning to the end Step 1: The bootloader Your Firmware opens an app called bootloader (usually in Linux it's grub) then the bootloader uses its config to load the kernel Step 2: the kernel After the kernel is loaded it knows where is your root partition it mounts it as / then runs /sbin/init in most distros /sbin/init is systemd Step 3: the init After the kernel runs the init the init starts the services and listens to shutdown or reboot signals (killing the init makes the kernel panick)

6
7
submitted 5 days ago by dt3@lemmy.zip to c/learninglinux@lemmy.zip

I want to make my rice with hyprland and quickshell on artix Linux so can someone teach me how

Learning Linux together

92 readers
1 users here now

This community is where Experts send guides to help beginners and where Beginners ask for help

founded 6 days ago
MODERATORS