Linux File System Online Training by QuontraSolutions - PowerPoint PPT Presentation

View by Category
About This Presentation

Linux File System Online Training by QuontraSolutions


Quontra Solutions main motto is to Provide Industry Oriented best Online Training on all IT Courses. All our courses are taught by experienced trainers who have extensive field knowledge with the topics they teach. We are offering Job Oriented online Training Program on Linux. Learn Linux Course from Real Time Experienced Trainers. The program is designed to provide rich learning experience for students using Internet. – PowerPoint PPT presentation

Number of Views:89


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Linux File System Online Training by QuontraSolutions

Browsing The FileSystem In Linux
Attend Free Demo
  • The Linux file-system is hierarchical and is made
    of directories, sub-directories and files.
  • Directories can contain sub-directories and/or
    files this is a structure used by other
    file-systems, such as Microsoft-based ones
    however the concept originated in UNIX.
  • In Linux/Unix, everything is represented as a
    file this includes processes, devices,
    applications, I/O sockets, etc.
  • Directories are a file as well, they contain the
    information of any files directly under them,

  • The Linux file-system structure is tree like.
  • The file-system begins at a directory named /,
    which is also referred to as the root
  • The drives representation is different than in
    Windows. There are no C or D drives each drive
    has a Mount Point, which is a location under the
    root (/) directory in which it is represented.
  • Mount points can be created by the sys-admin that
    serve as connection points of sort to physical
    devices and/or other file-systems Most Unix
    systems has the default /mnt directory for
    arbitrary mounts. Linux systems, has the /media
    as an additional default directory for removable
    storage devices

  • Below is a visual representation of the basic
    Linux file-system structure

  • Absolute the root of Linuxs file-system is
    represented as / this slash mark will always
    be present when we use absolute pathnames to
    navigate the file-system, for example
  • The first / in the example above represents the
    root dir, var is a directory sitting directly
    under the root dir and log is a directory under
    var. Finally, messages.log is the name of a
    file which resides in /var/log/.

  • Relative relative pathnames refers to the
    current location in the file-system as the point
    of origin and not the root directory. Lets
    assume we are in the /var/ directory right now,
    in order to reach messages.log file we will use
    the following path log/messages.log
  • Note that there is no / at the beginning of the
    pathname and that it begins with the log
    directory, since we are already inside /var/

  • Every Linux user has a home directory the home
    dirs reside in /home/ltusernamegt
  • The home dir has a few uses and advantages to its
  • It is the directory a user goes to after logging
    into the system.
  • It becomes the current working directory after
  • The owning user can freely create files and/or
    directories in it.
  • Other users do not have permissions to access a
    home directory not owned by themselves, with the
    exclusion of the user root which is the
    administrative user of the system or other users
    that have been granted special permissions by the
  • The home dir contains customization files which
    are loaded upon login. (.bash_profile / .bashrc
    and others)
  • Contains the history of the shell commands
    executed by the specific user (.bash_history)

  • There are two commands that aid us with
    navigating through the file-system
  • PWD Print Working Directory displays the
    absolute pathname of the current working
  • pwd
  • /home/nir
  • CD change directory make the specified
    pathname our current working directory. can be
    used with either absolute or relative
    pathnames cd /var/log
  • pwd
  • /var/log

  • CD with a relative pathname
  • pwd
  • /var
  • cd log
  • pwd
  • /var/log
  • CD without any pathname will make the users home
    dir the current working directory
  • pwd
  • /var/log
  • cd
  • pwd
  • /home/nir

  • Pathname navigations has a few shortcuts to make
    things simpler
  • . represents the current working directory,
    for example if the current working dir is
    /var/log/ ls . will display the log files in
    this dir.
  • .. represents the parent directory, one level
    above the current working directory following
    the above example, ls .. will display the
    contents of /var/
  • represents the home directory, each user and
    their own home. example cd will take the
    user nir into /home/nir/
  • - return to the previous working directory
    cd will return to the working directory we
    were in before the last cd command weve

  • The ls command is used to list the contents of
    directories. It has numerous options that allow
    the displaying and sorting of information in a
    few different ways.
  • ls command syntax is as follows
  • ls -option pathnames
  • If no options or arguments are given, ls by
    itself will list the current working directorys
    contents, for example
  • ls
  • file1 file2 file3

  • ls has a few additional options to control the
    listing results and sorting
  • -a display hidden files
  • -i display inode numbers
  • -R list sub-directories contents recursively
  • -d list the directory details, not the files
    inside of it
  • -l display long list
  • -t sort by modification time
  • -r sort in reverse order
  • There are numerous additional options, run ls
    --help to view them.

  • To see detailed information about the contents of
    a directory use the ls -l command.
  • The various fields of this table contains most of
    the information about a file, its permissions and
  • ls -l
  • drwxrwxr-x 2 nir nir 4096 Jul 19 1358 directory
  • -rw-rw-r-- 1 nir nir 135 Jul 19 1342 file1
  • -rwxrwxr-- 1 nir nir 35 Jul 19 1342 file2
  • -rw-rw-r-- 1 nir nir 200 Jul 19 1342 file3

  • Metacharacters are characters which are
    interpreted by the shell as more than just any
    regular character.
  • These characters include ! ? ltgt
  • It is highly recommended to Avoid using
    metacharacters when naming files and/or
    directories it will work but is also likely to
    cause trouble.
  • When executing a command in the shell, the shell
    scans the whole command for metacharacters if
    any are found, the shell expands these
    characters to their actual meaning before the
    execution of the command, for example, when
    running the command ls la the shell will
    first interpret the mark into its actual
    meaning, which is the current users home dir and
    then execute ls la /home/ltusernamegt.

  • The Asterisk characters special meaning is
    zero or more characters this character is also
    known as the Wildcard character, example
  • ls
  • dfile1 dfile2 directory file1 file2 file3
    kfile9 mfile1
  • ls k
  • kfile9
  • Filenames with a leading dot ( . ), such as
    .bash_profile are categorized as hidden by
    the file-system

  • The question marks ? special meaning is
    match any single character (except a leading dot
    in hidden files). example
  • ls
  • afile1 afile2 afile123 afile directory file1
    file2 file3 kfile9 mfile1
  • ls afile?
  • afile1 afile2

  • The square brackets special meaning is
    match a set or a range of characters in a single
  • example
  • ls
  • dfile1 dfile2 directory file1 file2 file3
    kfile9 mfile1
  • ls mk
  • kfile9 mfile1

  • cp copy a file to a new file or a list of files
    to a directory
  • Syntax
  • cp options file(s) filedirectory
  • Options
  • -i run interactively, ask before overwriting
  • -f force copy, overwrite automatically
  • -r recursively copy files and sub-directories
  • cp file file_new
  • ls -l file file_new
  • -rw-r--r-- 1 root root 4 Jul 23 2102 file
  • -rw-r--r-- 1 root root 4 Jul 23 2211 file_new

  • mv move or rename a file or move a list of
    files to a directory
  • Syntax
  • mv options file(s) filedirectory
  • Options
  • -i run interactively, ask before overwriting
  • -f force copy, overwrite automatically
  • mv file file_new
  • ls -l file file_new
  • ls file No such file or directory
  • -rw-r--r-- 1 root root 4 Jul 23 2211 file_new

  • ln creates a new link for a file
  • Syntax
  • ln options file link
  • Options
  • -s create a symbolic link
  • -f force linking, overwrite automatically
  • ln -s file file_new
  • ls -l file file_new
  • -rw-r--r-- 1 root root 5 Jul 23 2225 file
  • lrwxrwxrwx 1 root root 4 Jul 23 2226 file_new -gt

  • rm removes a file or files list
  • Syntax
  • rm options file(s)
  • Options
  • -r recursively remove files and sub-directories
  • -f force copy, overwrite automatically
  • rm file_new
  • ls -l file file_new
  • ls file No such file or directory
  • ls file_new No such file or directory

  • mkdir create a new directory
  • Syntax
  • mkdir options directory
  • Options
  • -p create parent directories, if needed
  • mkdir dir1
  • ls -l
  • drwxr-xr-x 2 root root 4096 Jul 23 2220 dir1
  • Note mkdir is the only command from the above
    that can create a new directory. cp and mv
    will only copy existing directories with given

Thank You