Understanding the Linux File Hierarchy Structure
Linux file systems follow a hierarchical structure, with a root directory and its subdirectories containing all other directories. This structure allows for efficient file organization and easy accessibility to all files on the system.
To view the directory structure after connecting to a Linux system, use the ls
command.
For more information on the Linux file hierarchy structure, refer to the following documentation:
https://www.w3schools.blog/linux-file-hierarchy-structure
Commonly Used Directories in Linux
/root
The /root
directory is the top-level directory for all files on the Linux system. Similar to the C:\
directory in Windows, the /root
directory does not have drive letters, and additional partitions appear in other folders under /root
.
/opt – Optional Packages
The /opt
directory contains subdirectories for optional software packages, commonly used by proprietary software that does not follow the standard file system hierarchy. For example, when installing a proprietary program, its files might be dumped into /opt/application
.
/var – Variable Data Files
The /var directory is the writable counterpart to the /usr directory, which must remain read-only in normal operation. Log files and other files that would normally be written to /usr during normal operation are written to /var instead. For example, log files are stored in /var/log.
/usr – User Binaries & Read-Only Data
The /usr
directory contains applications and files used by users, as opposed to those used by the system. Non-essential applications are located inside the /usr/bin
directory, and non-essential system administration binaries are located in the /usr/sbin
directory. Libraries for both are located inside the /usr/lib
directory. The /usr
directory also contains other directories, such as architecture-independent files like graphics stored in /usr/share
.
Locally compiled applications install to the
/usr/local
directory by default, preventing them from affecting the rest of the system.
/etc – Configuration Files
The /etc
directory contains system-wide configuration files that can be edited by hand using a text editor. Note that the /etc
directory only contains system-wide configuration files, while user-specific configuration files are stored in the home directory of each user.
Services are typically located in this directory.
/etc/profile
This file is executed whenever a bash login shell is entered, such as when logging in from the console or over SSH, as well as by the DisplayManager when the desktop session loads.
To configure
/etc/profile
, use the following command
vim /etc/profile
Remote Connection Tools for Linux
Xshell
Xshell is a robust and feature-rich SSH client that enables users to connect to remote servers securely. With advanced session management capabilities, powerful customization options, and an intuitive user interface, Xshell is an excellent tool for system administrators, developers, and other IT professionals. Xshell is free for home and school users, making it an accessible option for personal and educational use.
Xftp
Xftp is a file transfer client designed for secure and efficient data exchange between local and remote systems. With support for various file transfer protocols, such as FTP, SFTP, and SCP, Xftp makes it easy to upload and download files to and from remote servers. Additionally, Xftp provides users with the ability to install applications and plugins directly from the client.
Linux Command Line Interface (CLI)
The Linux Command Line Interface (CLI) provides users with a powerful and flexible way to interact with their system. With a vast array of commands available, the CLI allows users to perform a wide range of tasks, from managing files and directories to configuring system settings and network connections.
To help users navigate the CLI, we have compiled a comprehensive list of essential Linux commands. This list includes commands for navigating the file system, managing processes, and configuring system settings, among others. Whether you are a seasoned Linux user or a newcomer to the platform, this list is an invaluable resource that can help you get the most out of your system.
Check out the list of essential Linux commands here: https://kinsta.com/blog/linux-commands/
Command | Usage |
---|---|
ls | Lists the content of a directory |
alias | Define or display aliases |
unalias | Remove alias definitions |
pwd | Prints the working directory |
cd | Changes directory |
cp | Copies files and directories |
rm | Remove files and directories |
mv | Moves (renames) files and directories |
mkdir | Creates directories |
man | Displays manual page of other commands |
touch | Creates empty files |
chmod | Changes file permissions |
./ | Runs an executable |
exit | Exits the current shell session |
sudo | Executes commands as superuser |
shutdown | Shutdowns your machine |
htop | Displays processes and resources information |
unzip | Extracts compressed ZIP files |
apt, yum, pacman | Package managers |
echo | Displays lines of text |
cat | Prints file contents |
ps | Reports shell processes status |
kill | Terminates programs |
ping | Tests network connectivity |
vim | Efficient text editing |
history | Shows a list of previous commands |
passwd | Changes user password |
which | Returns the full binary path of a program |
shred | Overwrites a file to hide its contents |
less | Inspects files interactively |
tail | Displays last lines of a file |
head | Displays first lines of a file |
grep | Prints lines that match patterns |
whoami | Outputs username |
whatis | Shows single-line descriptions |
wc | Word count files |
uname | Displays OS information |
neofetch | Displays OS and hardware information |
find | Searches for files that follow a pattern |
wget | Retrieves files from the internet |