Linux for beginners
- Kernel is the first software loaded when the computer boots – loaded by the bootloader.
- Linux is a kernel – kernel is what interact software with hardware.
- Kernel uses the device drivers to interact with the hardware.
- GNU + Linux = a distro. Ubuntu, Fedora and Mint are distros
In linux, everything is shown as a file even hardwares
C– character device
D – block device
Beginner cheatsheet
lsList all the files in a directoryls -lList all files and their details (owner, mtime, size, etc)ls -aList all the files in a directory (including hidden files)ls -ltraList all the files sort by last modified time with most recently modified on top (including hidden files)tree -d nDisplay a tree of directoriespwdShow the present working directorycdChange directory to some other locationfileView the type of any filesystemctlUtility responsible for examining and analysing the systemd service managerpstreeDisplays the process treetopDisplays info about the system and processes included memory. Switches: z, x, <, >, 1
GUI
- GNOME and KDE are popular Graphical interfaces for linux
- Graphical desktops can be started and stopped depending on distribution
sudo system stop gdmsudo system start gdm
$ sudo shutdown -h 01:00 "Message to the users" - this is to schedule a shutdown of the system with a message sent to the users. shutdown is the command to also reboot the system when passing the switch -r
which <applicationname> and whereis <applicationname> - to locate the source of an application and to find the man files respectively.
File Utilities
wcword count, gives also the number of linescatdisplays the content of a file, with -n to display the line numberlessdisplays a file in a paginate way, -N for line numberheadwith switch -, shows first n lines of a file tailwith switch -, shows last n lines of a file touchcreates a file but mostly used to modify times on filestouch -t 24112022 testfile
Directory
mkdircreate a directoryrmdirremove an empty directoryrm -rfremove a directory and all its content