As a followup of this https://pyra-handheld.com/boards/threads/first-information-for-new-pyra-owners-faq.99302/page-7
This thread is mainly designed to help new pyra owners to start learning basics of linux. Everyone is welcome to ask and reply as long as we focus on the title of this thread.
Here is a copy of my post with some basic information about linux filesystems.
I agree that linux may be intimidating for newcomers but it is much better compared to windows or mac. Let me try to answer some of this.
1. Linux Filesystem:
This may be a surprise for a windows users but in linux everything is a file under "/" . So / is the root of entire filesystem if you run "sudo rm -rf /" everything in your system is gone. ( rm is command for deletion and option -r means recursive -f gives force ).
Let us take an example of "/dev" directory, which has all the devices. Your HDD drive is usually /dev/sda /dev/sdb etc., with partitions /dev/sda1 /dev/sda2 etc. This numbers are decided at boot, so the hdd which is detected first becomes sda, so sometime sda may become sdb. USB drives also appears here as /dev/sdb /dev/sdc etc. However you can not see anything in your Pen drive using /dev/sdc. This folder only lists the devices, to access files in the devices like HDD you need to mount them at some place in filesystem. For example with Pyra, eMMC will be mounted at the root "/", and we may choose to have sdcard mounted at "/home". ( Note: you may backup your entire hdd mounted ate /dev/sdb to another hdd mounted at /dev/sdc using "dd if=/dev/sdb of=/dev/sdc" which will copy even filesystem, so if your /dev/sda is 120 gb hdd, now /dev/sdb will have 120 gb only even if it is 2 Tb hdd )
/home , this is directory for all user data, like your documents, movies, pictures and anything else. Linux being designed as multiuser system, every user may have his own directory under /home. So if your username is bosbeetle,, your directory shall be /home/bosbeetle.
One important thing to note is names of hidden files in linux starts with ".", and usually dotfiles in home directory are user level config files. Most standard linux applications can be configured using a config file in /home/<username>/.config/<appname>/<configfile>.
Another important difference from windows is linux filesystem uses permissions for all files/directories. So usually normal user have full read/write access to his own directory in addition to few other spaces in filesystem. While root user can do anything. In linux filesystem every directory/file have sets of permission to give fine grained control, usually described in the form of (rwx, read/write/execute) for different users (ugo, u=user or file owner, g=group, o=other). Commands like "chown" and "chmod" allows changing the file ownership and permissions.
/etc, this directory has all system wide configuration files. When you install new application, it may add default config file here, which you can copy to your $HOME/.config and edit, so as that application behaves as you desire without changing anything for other users. /etc/fstab is a file which keep information about where to mount which hdd. So this is the config file which tells the system to mount eMMC at / and your sdcard at /home. Note: this file is not for removable devices.
/bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, all these directories are for executable binaries. Different distributions use them differently. In arch all of these (excluding /usr/bin and /usr/local/bin) are symlinks of /usr/bin. So all the application installed with package manager goes into /usr/bin, e.g., /usr/bin/firefox. Note: All files in this locations can be executed by name without using full path, so you can type firefox on command line without needing to type /usr/bin/firefox. The reason is environment variable called PATH. You can type "echo $PATH" in your terminal to see which paths are in the PATH. You can also add more folders to your PATH using config files like .bashrc. I add /home/docbroke/bin to the path and keep all my shell scripts there, so I can execute them without needing to type full path.
/var, var is for variables that keeps changing. For example /var/log contains different log files.
/sys, this directory contains information about devices, drivers, kernel status etc. For example, /sys/class/power_supply/<battery_name>/capacity file will have battery charge status, which can be read using cat or echo commands.
/tmp, contains temporary files, which gets deleted after reboot. I sometimes use it to store screenshots, recordings for temporary use.
/media, /mnt, these directories are for mounting (mainly temporary) drives. On my system I use /media to manually mount usb drives, but when I use automouning scripts they may go to /media or /run/media etc.
2. Ok I am tired now, so I will only tell this
--- Most linux utilities comes with a manual, you can read them using man command, for example "man man" for the manual of man command. So now you know when someone says RTFM, what does he/she means.
--- Most command line utilites have inbuilt help, for help with cat command "cat --help", this is usually short compared to man
--- Some commands have info, try "info info" for info on info
--- For go to guides for most linux applications try archwiki at wiki.archlinux.org
This thread is mainly designed to help new pyra owners to start learning basics of linux. Everyone is welcome to ask and reply as long as we focus on the title of this thread.
Here is a copy of my post with some basic information about linux filesystems.
I agree that linux may be intimidating for newcomers but it is much better compared to windows or mac. Let me try to answer some of this.
1. Linux Filesystem:
This may be a surprise for a windows users but in linux everything is a file under "/" . So / is the root of entire filesystem if you run "sudo rm -rf /" everything in your system is gone. ( rm is command for deletion and option -r means recursive -f gives force ).
Let us take an example of "/dev" directory, which has all the devices. Your HDD drive is usually /dev/sda /dev/sdb etc., with partitions /dev/sda1 /dev/sda2 etc. This numbers are decided at boot, so the hdd which is detected first becomes sda, so sometime sda may become sdb. USB drives also appears here as /dev/sdb /dev/sdc etc. However you can not see anything in your Pen drive using /dev/sdc. This folder only lists the devices, to access files in the devices like HDD you need to mount them at some place in filesystem. For example with Pyra, eMMC will be mounted at the root "/", and we may choose to have sdcard mounted at "/home". ( Note: you may backup your entire hdd mounted ate /dev/sdb to another hdd mounted at /dev/sdc using "dd if=/dev/sdb of=/dev/sdc" which will copy even filesystem, so if your /dev/sda is 120 gb hdd, now /dev/sdb will have 120 gb only even if it is 2 Tb hdd )
/home , this is directory for all user data, like your documents, movies, pictures and anything else. Linux being designed as multiuser system, every user may have his own directory under /home. So if your username is bosbeetle,, your directory shall be /home/bosbeetle.
One important thing to note is names of hidden files in linux starts with ".", and usually dotfiles in home directory are user level config files. Most standard linux applications can be configured using a config file in /home/<username>/.config/<appname>/<configfile>.
Another important difference from windows is linux filesystem uses permissions for all files/directories. So usually normal user have full read/write access to his own directory in addition to few other spaces in filesystem. While root user can do anything. In linux filesystem every directory/file have sets of permission to give fine grained control, usually described in the form of (rwx, read/write/execute) for different users (ugo, u=user or file owner, g=group, o=other). Commands like "chown" and "chmod" allows changing the file ownership and permissions.
/etc, this directory has all system wide configuration files. When you install new application, it may add default config file here, which you can copy to your $HOME/.config and edit, so as that application behaves as you desire without changing anything for other users. /etc/fstab is a file which keep information about where to mount which hdd. So this is the config file which tells the system to mount eMMC at / and your sdcard at /home. Note: this file is not for removable devices.
/bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, all these directories are for executable binaries. Different distributions use them differently. In arch all of these (excluding /usr/bin and /usr/local/bin) are symlinks of /usr/bin. So all the application installed with package manager goes into /usr/bin, e.g., /usr/bin/firefox. Note: All files in this locations can be executed by name without using full path, so you can type firefox on command line without needing to type /usr/bin/firefox. The reason is environment variable called PATH. You can type "echo $PATH" in your terminal to see which paths are in the PATH. You can also add more folders to your PATH using config files like .bashrc. I add /home/docbroke/bin to the path and keep all my shell scripts there, so I can execute them without needing to type full path.
/var, var is for variables that keeps changing. For example /var/log contains different log files.
/sys, this directory contains information about devices, drivers, kernel status etc. For example, /sys/class/power_supply/<battery_name>/capacity file will have battery charge status, which can be read using cat or echo commands.
/tmp, contains temporary files, which gets deleted after reboot. I sometimes use it to store screenshots, recordings for temporary use.
/media, /mnt, these directories are for mounting (mainly temporary) drives. On my system I use /media to manually mount usb drives, but when I use automouning scripts they may go to /media or /run/media etc.
2. Ok I am tired now, so I will only tell this
--- Most linux utilities comes with a manual, you can read them using man command, for example "man man" for the manual of man command. So now you know when someone says RTFM, what does he/she means.
--- Most command line utilites have inbuilt help, for help with cat command "cat --help", this is usually short compared to man
--- Some commands have info, try "info info" for info on info
--- For go to guides for most linux applications try archwiki at wiki.archlinux.org
Last edited: