Category Archives: Linux

Linux File Structure Part 1

Command Line

I started from a mostly windows background. So i’ve made this chart to help myself and other understand and find certain files. This chart contains the top level file structure that most linux distro use. In windows the main files are usually located in the C: in linux all the your files are located in the root directory or “/” within / are the folder listed below.

In windows all the os files are located inside the “windows” folder created by the OS automatically. Within the windows folder all the data the OS needs is subdivided into its own folder like important Binaries and system binaries will be in the system32 folder. In linux that are at the top level in fact if a normal user access their root they will most likely be in /home/”user”/ folder. This folder is similar to Windows C:/users folder. When your attaching a HDD after boot you will usually need to mount it for its filesystem to show up in the /mnt/ folder. I’ll go into this more in a later article but this chart will help you find files in Linux.

FolderNamePurpose
/bin/Important BinariesVital programs (ls, ping, grep)
/boot/Boot DataKernel files
/dev/Device FileDrivers for hardware
/etc/System ConfigurationFiles for OS
/home/User DirectoriesDirectories for all users
/lib/Important Data LibrariesFiles for use by /bin/ apps
/media/Removable MediaCD, USB, DVD
/mnt/Mounted Mediasda1 , sda2
/opt/Downloaded Appsgoogle/chromium
/sbin/System Binariesessential programs fdisk, ifconfig
/srv/Service DataData for the OS like scripts
/tmp/Temporary FileTemp files that are usually clear every reboot
/usr/User AppsData for applications for users
/proc/Process DataFolder for the OS to process programs that are running

Common Linux Commands Part 1

Command Line

Linux is one of the world most ubiquitous operating systems. While there are many GUI or Graphical User interface Distributions or versions available for linux, command line interface is widely used by business and server deployments. Here are some of the most common commands that will help you start. This is by no means a thorough list but a good start. I will put a more parts as i have time.

Help

-h

-help

The help argument is vital if you are unfamiliar with a command just put it after a command to get a rundown of the command its features. For example if you are unfamiliar with wget you would type

wget -h

This will bring up

Navigation

Linus uses a tree structure to store files similar to windows. I’ll go into more detail later. But navigating this tree structure is vital to using linux.

ls

The LS command is short of list this command bassically “lists” the file in your current directory. The best way to learn is to go into a linux terminal and type “ls -h” this will show all the arguments that will help you use effectively.

cd

cd or change directory is also a vital command to navigate Linux it basically changes the directory that you are in. if you type it in without arguments it move you up a level to in the file tree. If you have permission and run the command multiple time it will bring you to the root directory. If you put the name of a folder after command it will move you into the directory specified, for example if you type “cd home” form the root directory you will move into the home folder where the users files are stored.