Author Archives: Daniel Sobrinho

Linux directory structure

Understand the purpose of each folder, where files can be or where to place them according to your need.

  1. / – Root directory.
  2. /bin – Directory where are the executable files and essential system commands.
  3. /boot – Directory where are the files needed to start the system. This is where the Linux Kernel image is located.
  4. /dev – Directory where are the files of system devices, such as disks, cd-roms, terminals etc.
  5. /etc – Directory where the system configuration files are located.
  6. /home – Directory that is usually used by users.
  7. /lib – Directory where the essential system libraries used by /bin programs and Kernel modules are located.
  8. /lost+found – Directory that stores files retrieved after corruption.
  9. /media – Empty directory. It will contain subdirectories with reference to auto-mounted external storage devices by the system.
  10. /mnt – Empty directory. This directory is typically used for device mount points.
  11. /proc – Directory that has kernel and process information.
  12. /opt – Directory where installed applications that do not come with Linux are located.
  13. /root – Superusers(root) directory. In some distributions it may or may not be present.
  14. /run – Directory for temporary storage of files for running applications.
  15. /sbin – Directory where essential system files are, such as applications, utilities for system administration. Usually only the superuser (root) has access to the files.
  16. /srv – Directory for storage by service data system.
  17. /sys – Directory with system-specific files.
  18. /tmp – Temporary file directory.
  19. /usr – Directory of files belonging to users and the second largest hierarchy of directories in Linux.
  20. /var – Directory where variable information is stored to the system, such as log files etc…

Based on: https://www.ubuntudicas.com.br/2012/04/estrutura-de-diretorios-no-linux

Liked this content, have any suggestions or other questions? Leave a message.

Follow me on Twitter @danielsob

To you who are interested in conducting more interactive tutorials with content like this, respect the research and construction of content, there is time and knowledge committed to this. Remember to quote the source. Everybody gets on it.

Top commands for Linux learners

The following list of main commands via terminal and its purposes, for linux beginners to have a north in their daily use of the system:

Aptpackage manager/applications for Debian and derivatives
apt-getpackage/application manager for Debian and derivatives with few more options than apt
apt-markversion "freeze" manager to not update an app by apt (options: hold and unhold)
aptitudepackage manager/applications with better features for re-fixing dependencies for Debian and derivatives
Catview file content directly in the terminal
CDdirectory access
Chmodcontrol of file/folder access permissions
Chownfile/folder property control
Cpcopy
Curlperforms http requisitions
DNFpackage/application manager for RHEL and derivatives
DPKGpackage/application manager with other features for Debian and derivatives
exitexit, close, or terminate application
Historycommand history in the terminal
journalctlview system events
Killkill a process by pid
Lslisting
manmanual of an app
Mountassemble unit
Mvmove
nanopublisher
passwduser password exchange
Pkillkill an app by name
pingcarries out data packets to verify connectivity between devices
Scpfile copy via ssh protocol
Snapsnap package manager
SSHshell connection via network
sudorun something like super user
systemctllinux process manager
tarCompactor
Unamedistro information
unitedecompresser of any file
Sawpublisher
Camepublisher
wgetfile downloader
whereisdetails of an app
Yumpackage/application manager for RHEL and derivatives
ZipCompactor

All commands have add-ons for them to run, the idea of the list is just to create that mental trigger of knowing which of the commands to resort to. The list was built with the latest records of my history, plus Rhel's package managers.

It's not complete and it's not a guide, just a tip.

Liked this content, have any suggestions or other questions? Leave a message.

Follow me on Twitter @danielsob

To you who are interested in conducting more interactive tutorials with content like this, respect the research and construction of content, there is time and knowledge committed to this. Remember to quote the source. Everybody gets on it.

How to unpack TAR file or any compressed file, using Linux or MacOS

Personal speech, one of the pains of everyone who uses terminal, predominantly, is to unpack files of various extensions. Apart from the ZIP that to unpack we use UNZIP, we will have to remember options to add in the TAR command.

Thinking of creating an "untar" I ended up finding in a research the unar, which is all we seek. Super simple and practical to use, just run: unar file-a-descompactar.ext .

It seems to me that it already comes as default in several distributions, but nevertheless follows the Github repository for those who need:

Github: https://github.com/ashang/unar

Basic command for extracting any compressed file, without having to use options, use only the app name plus the file:

~ unar file-to-extract.ext

There are options to add and I will describe below:

~ unar --help
unar v1.10.1, a tool for extracting the contents of archive files.
Usage: unar[options] archive [files …]A

vailable options:-
output-directory (-o) The directory to write the contents of the archive to. Defaults to the current directory. If set to a single dash (-), no files will be created, and all data will be output to
stdout.
-force-overwrite (-f) Always overwrite files when a file to be unpacked already exists on disk. By default, the program asks the user if possibl
e, otherwise skip files when a file to be unpacked alrea
dy exists on disk.-force-directory (-d) Always create
a containing directory for the contents of the unpacked archive. By default, a directory is created if there is more than one top-level file or fold
er.-no-directory (-D) Never create a containing directory for the contents of the unpacked ar
chive.-password (-p) The password to use for decrypting protected
archives.-e) The encoding to use for filenames in the archive, when it is known not. If not specified, the program attempts to auto-detect the encoding used. Use "help" or "list" as the
argument to give a listing of all supported encodings.
-password-encoding (-E) The encoding to use for the password for the archive, when it is not known. If not specified, then either the encoding given by the -encoding option or the auto-detected encoding
is used.
-indexes (-i) Instead of specifying the files to unpack as filenames or wildcard patterns, specify them as indexes, as output by lsar.
-no-recursion (-nr) Do not attempt to extract archives contained in other archives. For instance, when unpacking a .tar.gz file, only unpack the .gz file and not its contents.
-copy-time (-t) Copy the file modification time from the archive file to the containing directory, if one is created.
-forks (-k) How to handle Mac OS resource forks. "visible" creates AppleDouble files with the extension ".rsrc", "hidden" creates AppleDouble files with the prefix "._", and "skip" discards
all resource forks. Defaults to "visible".
-quiet (-q) Run in quiet mode.
-version (-v) Print version and exit.
-help (-h) Display this information.

When we quote any file is supported, of course there are some exceptions like DEB, DMG, PAR, SHG, ACE 2.0 (also winace standard) and Amiga.

Examples of supported extensions range from the most common to many others, such as: ZIP, RAR, 7Z (unencrypted), TAR, GZIP, BZIP2, LZMA, XZ, CAB, MSI, NSIS, EXE, ISO, SPLIT (basic junction), STUFFIT (without encryption), STUFFIT X, DISKDOUBLER, COMPACT PRO (unencrypted), PACKIT, CPIO, Z, ARJ (no split), ARC, PAK, ACE (DOS standard), ZOO, LZH, ADF, DMS, LZX, POWERPACKER, LBR, SQUEEZE , CRUNCH, XAR, RPM, ALZIP (unencrypted), NSA, SAR, NDS, ZIPX and other non-the-use extensions supported by the libxad library.

Liked this content, have any suggestions or other questions? Leave a message.

Follow me on Twitter @danielsob

To you who are interested in conducting more interactive tutorials with content like this, respect the research and construction of content, there is time and knowledge committed to this. Remember to quote the source. Everybody wins with this.

Disable native notifications in browsers

There is unidentified unwanted behavior regarding the native receipt of notifications received through browsers such as Google Chrome and Firefox on some Linux desktops, such as Deepin for example.

What occurs is the lack of the notification toast closing button and/or the lack of timing for auto closing, becoming a permanent item of the screen until it clicks to its completion. This "error" occurs because of the behavior of the most commonly used library on linux desktops.

For "correction", or behavior change, notifications a less costly and more practical alternative is disabling native browser notifications. Thus all notifications will become web push type, with natural behavior of the browser of auto closing and layout itself.

So far we have not done enough tests to state that there will be no losses with loss of notifications, however we can say yes that notifications will not be eternal on your screen, by the default timing native of browsers.

To disable the native Google Chrome notification do the following:

Access in browser: chrome://flags/#enable-system-notifications

And change the value to: Disabled

To disable native notification in Firefox do the following:

Access in the browser: about:config

Search for the key: alerts.useSystemBackend

And change the value to: false

After the change is made remember to restart the browser to ensure the effectiveness and use of the new configuration.

Liked this content, have any suggestions or other questions? Leave a message.

Follow me on Twitter @danielsob

To you who are interested in conducting more interactive tutorials with content like this, respect the research and construction of content, there is time and knowledge committed to this. Remember to quote the source. Everybody wins with this.