SlideShare a Scribd company logo
Linux Overview
Outline Linux file system (FS) Useful commands for manipulating the FS Linux vs. Windows What did you learn from Assignment #1 sudo Apt-get Pipes Command prompt
Linux Filesystem Everything is a File
Linux Filesystem Filesystem is a method for storing and organizing computer files and the data they contain to make it easy to find and access. Different operating systems normally use different file systems.
Linux Filesystem The filesystem in Linux stores  the kernel the executable commands supported by the OS configuration information user data and special files that are used to give controlled access to system hardware and OS functions.
Linux Filesystem Items stored in the filesystem are of four types: Ordinary files  contain text, data, or program information. Files can not contain other files or directories. Directories  containers that hold files, and other directories. Devices  are used in the same way as ordinary files providing applications with easy access to the hardware devices. Links  which is a pointer to another file
Linux Filesystem The system is laid out as a hierarchical tree structure. The top-level directory is the 'root' designated by a slash '/'.  Each directory can have many child directories, but only one parent directory.
Linux Filesystem
Linux Filesystem The path to a certain location can be specified as: Absolute path from root e.g. /root/home/will Relative path e.g. Accessing play from user “zeb” ../will/play
Root Common Subdirectories
Common Subdirectories Directory Stands for Content / root Top-level directory in the hierarchical tree /bin Binaries Contains binaries used by both the system administrator and non-privileged user e.g. command ‘ls’ is stored here /dev Devices Contains hardware devices directories. It is a virtual directory /etc Et cetra Contains configuration files for running applications /home Contains user subdirectories /lib Libraries Contains shared libraries e.g. C, Perl, Python general libraries /mnt Mount /proc Processes Contains information about the system e.g. process that are running. It is a virtual directory /root Default home directory for the system administrator. Isolated to increase security
Common Subdirectories Directory Stands for Content /sbin Secure Binaries Contains secured binaries that are only accessed by privileged users e.g. fdisk, partitioning tool is kept here /tmp Temporaries Contains temporary files /usr Unix System Resources Contains subdirectories such as /usr/doc which contains system documentations, /usr/local the local hosts directory /var Variables Contains log and spool files /boot Contains Linux kernel
Useful Commands
CD $ cd  path changes your current working directory to path (which can be an absolute or a relative path). One of the most common relative paths to use is '..' (i.e. the parent directory of the current directory).  $ cd   resets your current working directory to your home directory (useful if you get lost).  $ cd -   If you change into a directory and you subsequently want to return to your original directory, use
pwd pwd -  Displays the current directory ("working directory"). pwd displays the full  absolute  path to your current location in the filesystem.  $ pwd          /usr/bin  implies that /usr/bin is the current working directory.
Filesystem Comparison Linux vs. Window
Filesystem Comparison Linux Filesystem Windows Filesystem Hierarchal Structure Only a single hierarchal directory structure. Everything starts from the root directory and then expanded to subdirectories. It also has various partitions, but under the root directory. They are ‘mounted’ under specific directories (Unified scheme) Various partitions, with directories under those partitions (Volume based file hierarchy) Detection Partition will not be detected unless it has been mounted. All partitioned detected and booted, then each assigned a drive letter. Crossover  Can read/write FAT16 , FAT32 Can not unless with third party support Hidden Files Implement with a name that starts with a dot. Tracks it as a file attribute  Types ext2, ext3  FAT12,  FAT16,  FAT32, and or NTFS
Filesystem Comparison Linux Filesystem Windows Filesystem Case Sensitivity Case sensitive. File.txt is not the same as file.txt Not case sensitive Confirmation Messages Non existent e.g. when deleting, user will not be promoted whether to continue with the operation or not User will be prompted with each action Search Path  Does not look into the current directories. It looks at the PATH environment variable.  To run program in current directory: ./  program Checks current directory first then looks at the PATH environment variable Slashes Uses a forward slash “/” Uses a backward slash “\” Switch Indication Switches are preceded by “-” Switches are preceded by “\”
Default Directory The default working directory is your user home directory. /home/ubuntu /home is equivalent to My documents User name
Running Privileged Commands How to run privileged commands as a normal user? Use sudo command  Sudo is a program which can be used by normal users to execute as super users or any other users.
Running Privileged Commands Example Running the following statement sudo –l Then entering password will produce a listing of command that the user may execute as well as how and as who they maybe executed.
Beware of the dark side of root root  user privileges are only needed for very specific tasks with security risks: mounting, creating device files, loading drivers, starting networking, changing file ownership, package upgrades... Even if you have the  root  password, your regular account should be sufficient for 99.9 % of your tasks (unless you are a system administrator). In assignments, it is acceptable to use  root . In real life, you may not even have access to this account, or put your systems and data at risk if you do.
Using the root account In case you really want to use  root ... If you have the  root  password: su -  ( s witch  u ser) In modern distributions, the  sudo  command gives you access to some  root  privileges with your own user password. Example:  sudo mount /dev/hda4 /home
Live process activity top  -  Displays most important processes, sorted by cpu percentage top - 15:44:33 up  1:11,  5 users,  load average: 0.98, 0.61, 0.59 Tasks:  81 total,  5 running,  76 sleeping,  0 stopped,  0 zombie Cpu(s): 92.7% us,  5.3% sy,  0.0% ni,  0.0% id,  1.7% wa,  0.3% hi,  0.0% si Mem:  515344k total,  512384k used,  2960k free,  20464k buffers Swap:  1044184k total,  0k used,  1044184k free,  277660k cached   PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEM  TIME+  COMMAND 3809 jdoe  25  0  6256 3932 1312 R 93.8  0.8  0:21.49 bunzip2 2769 root  16  0  157m  80m  90m R  2.7 16.0  5:21.01 X 3006 jdoe  15  0 30928  15m  27m S  0.3  3.0  0:22.40 kdeinit 3008 jdoe  16  0  5624  892 4468 S  0.3  0.2  0:06.59 autorun 3034 jdoe  15  0 26764  12m  24m S  0.3  2.5  0:12.68 kscd 3810 jdoe  16  0  2892  916 1620 R  0.3  0.2  0:00.06 top You can change the sorting order by typing M : Memory usage,  P : %CPU,  T : Time. You can kill a task by typing  k  and the process id.
Updating and installing packages Debian-based distros use a software installer called apt-get, which uses the Debian dpkg system to retrieve, unpack, and install software.  Apt-get is the command you use to get that software.  Synaptic is the GUI for apt-get
Pipes Unix pipes are very useful to redirect the standard output of a command to the standard input of another one. Examples cat *.log | grep -i error | sort grep -ri error . | grep -v “ignored” | sort -u \ > serious_errors.log This one of the most powerful features in Unix shells!
Command prompt User_name@device_name:~$ ubuntu@ubuntu:~$ Use UP arrow key to invoke previous commands Use TAB to auto-complete commands
Conclusion You need to know the difference between relative and absolute path when dealing with Linux directories You need to know how Linux FS is different from Windows FS You need to know when to switch to super user privileges
References The basic similarities between Linux and DOS http://www.control-escape.com/linux/lx-basics.html Introduction to Unix http://wwwhomes.doc.ic.ac.uk/~wjk/UnixIntro/ Windows-to-Linux Roadmap http://www.ibm.com/developerworks/linux/library/l-roadmap1.html

More Related Content

PPTX
Linux security
PPTX
Linux security introduction
PPT
Unix Security
PPT
Security and Linux Security
PPT
Basic Linux Security
PPT
Linux Operating System Vulnerabilities
PPTX
Unix Introduction
Linux security
Linux security introduction
Unix Security
Security and Linux Security
Basic Linux Security
Linux Operating System Vulnerabilities
Unix Introduction

What's hot (20)

PPTX
Linux Operating System
PPT
Threats, Vulnerabilities & Security measures in Linux
PPTX
Unix
PPTX
Unix Operating System
PPT
PDF
Becoming Linux Expert Series-Install Linux Operating System
PPTX
PPTX
UNIX Operating System
PPTX
windows.pptx
PPT
unix training | unix training videos | unix course unix online training
PPTX
Linux operating system
PPTX
Operating systems unix
PPTX
Chapter 1: Introduction to Unix / Linux Kernel
PPTX
Linux Operating System Fundamentals
PPTX
Introduction to Unix
PDF
2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
PPTX
kali linux.pptx
PPTX
Unix seminar
PPTX
PPTX
Unix and shell programming | Unix File System | Unix File Permission | Blocks
Linux Operating System
Threats, Vulnerabilities & Security measures in Linux
Unix
Unix Operating System
Becoming Linux Expert Series-Install Linux Operating System
UNIX Operating System
windows.pptx
unix training | unix training videos | unix course unix online training
Linux operating system
Operating systems unix
Chapter 1: Introduction to Unix / Linux Kernel
Linux Operating System Fundamentals
Introduction to Unix
2009-08-11 IBM Teach the Teachers (IBM T3), Linux Security Overview
kali linux.pptx
Unix seminar
Unix and shell programming | Unix File System | Unix File Permission | Blocks
Ad

Viewers also liked (20)

ODP
File system hiearchy
PPTX
File system structure in linux
PPTX
Linux Vfs
PDF
Operating Systems - File Systems
PDF
File System Comparison on Linux Ubuntu
PPTX
Linux standard file system
PDF
NSS File System Performance, Clustering and Auditing in Novell Open Enterpris...
PPTX
Linux network file system (nfs)
PPT
Xfs file system for linux
PPT
Linux file system nevigation
DOCX
The linux file system structure
PDF
Installing Linux: Partitioning and File System Considerations
PPT
Linux file system
ODP
4. linux file systems
PDF
Linux advanced concepts - Part 1
PDF
Get Started with Linux Management Command line Basic Knowledge
PDF
Linux Memory Management
PPT
Mca ii os u-5 unix linux file system
PDF
Linux File System
PPT
Linux command ppt
File system hiearchy
File system structure in linux
Linux Vfs
Operating Systems - File Systems
File System Comparison on Linux Ubuntu
Linux standard file system
NSS File System Performance, Clustering and Auditing in Novell Open Enterpris...
Linux network file system (nfs)
Xfs file system for linux
Linux file system nevigation
The linux file system structure
Installing Linux: Partitioning and File System Considerations
Linux file system
4. linux file systems
Linux advanced concepts - Part 1
Get Started with Linux Management Command line Basic Knowledge
Linux Memory Management
Mca ii os u-5 unix linux file system
Linux File System
Linux command ppt
Ad

Similar to Tutorial 2 (20)

PPTX
Linux Presentation
PPT
Linux filesystemhierarchy
PPT
Edubooktraining
PDF
File system discovery
PDF
Lesson 2 Understanding Linux File System
PDF
beginner.en.print
PDF
beginner.en.print
PDF
beginner.en.print
DOC
PPTX
Linux week 2
PPTX
Linux basics
PPTX
Linux basics
ODP
Nguyễn Vũ Hưng: Basic Linux Power Tools
PPT
PPTX
18 LINUX OS.pptx Linux command is basic isma
PPT
managing-the-linux-file-system_suse_.ppt
PPT
managing-the-linux-file-system________________________
PDF
Linux Getting Started
PPTX
Linux 4 you
Linux Presentation
Linux filesystemhierarchy
Edubooktraining
File system discovery
Lesson 2 Understanding Linux File System
beginner.en.print
beginner.en.print
beginner.en.print
Linux week 2
Linux basics
Linux basics
Nguyễn Vũ Hưng: Basic Linux Power Tools
18 LINUX OS.pptx Linux command is basic isma
managing-the-linux-file-system_suse_.ppt
managing-the-linux-file-system________________________
Linux Getting Started
Linux 4 you

More from tech2click (13)

PPT
Process Synchronization And Deadlocks
PPT
PPT
PPT
PPT
PPT
PPT
Tutorial4 Threads
PPT
Operating System 5
PPT
Mid1 Revision
PPT
Operating System 4
PPT
Operating System 3
PPT
Operating System 2
PPT
Rootkit
Process Synchronization And Deadlocks
Tutorial4 Threads
Operating System 5
Mid1 Revision
Operating System 4
Operating System 3
Operating System 2
Rootkit

Recently uploaded (20)

PDF
How to Get Funding for Your Trucking Business
PDF
IFRS Notes in your pocket for study all the time
DOCX
Euro SEO Services 1st 3 General Updates.docx
PPTX
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
PDF
Deliverable file - Regulatory guideline analysis.pdf
PPT
Data mining for business intelligence ch04 sharda
PDF
A Brief Introduction About Julia Allison
PDF
Ôn tập tiếng anh trong kinh doanh nâng cao
PDF
Roadmap Map-digital Banking feature MB,IB,AB
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
DOCX
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
PDF
Traveri Digital Marketing Seminar 2025 by Corey and Jessica Perlman
PDF
WRN_Investor_Presentation_August 2025.pdf
PDF
pdfcoffee.com-opt-b1plus-sb-answers.pdfvi
PPTX
Lecture (1)-Introduction.pptx business communication
PDF
Chapter 5_Foreign Exchange Market in .pdf
PPTX
HR Introduction Slide (1).pptx on hr intro
PDF
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
PDF
Power and position in leadershipDOC-20250808-WA0011..pdf
PDF
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
How to Get Funding for Your Trucking Business
IFRS Notes in your pocket for study all the time
Euro SEO Services 1st 3 General Updates.docx
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
Deliverable file - Regulatory guideline analysis.pdf
Data mining for business intelligence ch04 sharda
A Brief Introduction About Julia Allison
Ôn tập tiếng anh trong kinh doanh nâng cao
Roadmap Map-digital Banking feature MB,IB,AB
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
Traveri Digital Marketing Seminar 2025 by Corey and Jessica Perlman
WRN_Investor_Presentation_August 2025.pdf
pdfcoffee.com-opt-b1plus-sb-answers.pdfvi
Lecture (1)-Introduction.pptx business communication
Chapter 5_Foreign Exchange Market in .pdf
HR Introduction Slide (1).pptx on hr intro
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
Power and position in leadershipDOC-20250808-WA0011..pdf
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise

Tutorial 2

  • 2. Outline Linux file system (FS) Useful commands for manipulating the FS Linux vs. Windows What did you learn from Assignment #1 sudo Apt-get Pipes Command prompt
  • 4. Linux Filesystem Filesystem is a method for storing and organizing computer files and the data they contain to make it easy to find and access. Different operating systems normally use different file systems.
  • 5. Linux Filesystem The filesystem in Linux stores the kernel the executable commands supported by the OS configuration information user data and special files that are used to give controlled access to system hardware and OS functions.
  • 6. Linux Filesystem Items stored in the filesystem are of four types: Ordinary files contain text, data, or program information. Files can not contain other files or directories. Directories containers that hold files, and other directories. Devices are used in the same way as ordinary files providing applications with easy access to the hardware devices. Links which is a pointer to another file
  • 7. Linux Filesystem The system is laid out as a hierarchical tree structure. The top-level directory is the 'root' designated by a slash '/'. Each directory can have many child directories, but only one parent directory.
  • 9. Linux Filesystem The path to a certain location can be specified as: Absolute path from root e.g. /root/home/will Relative path e.g. Accessing play from user “zeb” ../will/play
  • 11. Common Subdirectories Directory Stands for Content / root Top-level directory in the hierarchical tree /bin Binaries Contains binaries used by both the system administrator and non-privileged user e.g. command ‘ls’ is stored here /dev Devices Contains hardware devices directories. It is a virtual directory /etc Et cetra Contains configuration files for running applications /home Contains user subdirectories /lib Libraries Contains shared libraries e.g. C, Perl, Python general libraries /mnt Mount /proc Processes Contains information about the system e.g. process that are running. It is a virtual directory /root Default home directory for the system administrator. Isolated to increase security
  • 12. Common Subdirectories Directory Stands for Content /sbin Secure Binaries Contains secured binaries that are only accessed by privileged users e.g. fdisk, partitioning tool is kept here /tmp Temporaries Contains temporary files /usr Unix System Resources Contains subdirectories such as /usr/doc which contains system documentations, /usr/local the local hosts directory /var Variables Contains log and spool files /boot Contains Linux kernel
  • 14. CD $ cd path changes your current working directory to path (which can be an absolute or a relative path). One of the most common relative paths to use is '..' (i.e. the parent directory of the current directory). $ cd  resets your current working directory to your home directory (useful if you get lost). $ cd -  If you change into a directory and you subsequently want to return to your original directory, use
  • 15. pwd pwd - Displays the current directory ("working directory"). pwd displays the full absolute path to your current location in the filesystem. $ pwd      /usr/bin implies that /usr/bin is the current working directory.
  • 17. Filesystem Comparison Linux Filesystem Windows Filesystem Hierarchal Structure Only a single hierarchal directory structure. Everything starts from the root directory and then expanded to subdirectories. It also has various partitions, but under the root directory. They are ‘mounted’ under specific directories (Unified scheme) Various partitions, with directories under those partitions (Volume based file hierarchy) Detection Partition will not be detected unless it has been mounted. All partitioned detected and booted, then each assigned a drive letter. Crossover Can read/write FAT16 , FAT32 Can not unless with third party support Hidden Files Implement with a name that starts with a dot. Tracks it as a file attribute Types ext2, ext3 FAT12, FAT16, FAT32, and or NTFS
  • 18. Filesystem Comparison Linux Filesystem Windows Filesystem Case Sensitivity Case sensitive. File.txt is not the same as file.txt Not case sensitive Confirmation Messages Non existent e.g. when deleting, user will not be promoted whether to continue with the operation or not User will be prompted with each action Search Path Does not look into the current directories. It looks at the PATH environment variable. To run program in current directory: ./ program Checks current directory first then looks at the PATH environment variable Slashes Uses a forward slash “/” Uses a backward slash “\” Switch Indication Switches are preceded by “-” Switches are preceded by “\”
  • 19. Default Directory The default working directory is your user home directory. /home/ubuntu /home is equivalent to My documents User name
  • 20. Running Privileged Commands How to run privileged commands as a normal user? Use sudo command Sudo is a program which can be used by normal users to execute as super users or any other users.
  • 21. Running Privileged Commands Example Running the following statement sudo –l Then entering password will produce a listing of command that the user may execute as well as how and as who they maybe executed.
  • 22. Beware of the dark side of root root user privileges are only needed for very specific tasks with security risks: mounting, creating device files, loading drivers, starting networking, changing file ownership, package upgrades... Even if you have the root password, your regular account should be sufficient for 99.9 % of your tasks (unless you are a system administrator). In assignments, it is acceptable to use root . In real life, you may not even have access to this account, or put your systems and data at risk if you do.
  • 23. Using the root account In case you really want to use root ... If you have the root password: su - ( s witch u ser) In modern distributions, the sudo command gives you access to some root privileges with your own user password. Example: sudo mount /dev/hda4 /home
  • 24. Live process activity top - Displays most important processes, sorted by cpu percentage top - 15:44:33 up 1:11, 5 users, load average: 0.98, 0.61, 0.59 Tasks: 81 total, 5 running, 76 sleeping, 0 stopped, 0 zombie Cpu(s): 92.7% us, 5.3% sy, 0.0% ni, 0.0% id, 1.7% wa, 0.3% hi, 0.0% si Mem: 515344k total, 512384k used, 2960k free, 20464k buffers Swap: 1044184k total, 0k used, 1044184k free, 277660k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3809 jdoe 25 0 6256 3932 1312 R 93.8 0.8 0:21.49 bunzip2 2769 root 16 0 157m 80m 90m R 2.7 16.0 5:21.01 X 3006 jdoe 15 0 30928 15m 27m S 0.3 3.0 0:22.40 kdeinit 3008 jdoe 16 0 5624 892 4468 S 0.3 0.2 0:06.59 autorun 3034 jdoe 15 0 26764 12m 24m S 0.3 2.5 0:12.68 kscd 3810 jdoe 16 0 2892 916 1620 R 0.3 0.2 0:00.06 top You can change the sorting order by typing M : Memory usage, P : %CPU, T : Time. You can kill a task by typing k and the process id.
  • 25. Updating and installing packages Debian-based distros use a software installer called apt-get, which uses the Debian dpkg system to retrieve, unpack, and install software. Apt-get is the command you use to get that software. Synaptic is the GUI for apt-get
  • 26. Pipes Unix pipes are very useful to redirect the standard output of a command to the standard input of another one. Examples cat *.log | grep -i error | sort grep -ri error . | grep -v “ignored” | sort -u \ > serious_errors.log This one of the most powerful features in Unix shells!
  • 27. Command prompt User_name@device_name:~$ ubuntu@ubuntu:~$ Use UP arrow key to invoke previous commands Use TAB to auto-complete commands
  • 28. Conclusion You need to know the difference between relative and absolute path when dealing with Linux directories You need to know how Linux FS is different from Windows FS You need to know when to switch to super user privileges
  • 29. References The basic similarities between Linux and DOS http://www.control-escape.com/linux/lx-basics.html Introduction to Unix http://wwwhomes.doc.ic.ac.uk/~wjk/UnixIntro/ Windows-to-Linux Roadmap http://www.ibm.com/developerworks/linux/library/l-roadmap1.html