SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Infinity   1
Infinity   2
• A simple description of the UNIX system, also applicable
  to Linux, is this:
• "On a UNIX system, everything is a file; if something is
  not a file, it is a process."
  This statement is true because there are special files that
  are more than just files (named pipes and sockets, for
  instance), but to keep things simple, saying that
  everything is a file is an acceptable generalization. A
  Linux system, just like UNIX, makes no difference
  between a file and a directory, since a directory is just a
  file containing names of other files. Programs, services,
  texts, images, and so forth, are all files. Input and output
  devices, and generally all devices, are considered to be
  files, according to the system.
                             Infinity                        3
• Most files are just files, called regular files; they contain
  normal data, for example text files, executable files or
  programs, input for or output from a program and so on.

  • Directories: files that are lists of other files.
  • Special files: the mechanism used for input and output. Most
    special files are in /dev, we will discuss them later.
  • Links: a system to make a file or directory visible in multiple parts
    of the system's file tree. We will talk about links in detail.
  • (Domain) sockets: a special file type, similar to TCP/IP sockets,
    providing inter-process networking protected by the file system's
    access control.
  • Named pipes: act more or less like sockets and form a way for
    processes to communicate with each other, without using network
    socket semantics.
                                  Infinity                                  4
• Most people have a vague knowledge of what partitions
  are, since every operating system has the ability to
  create or remove them. It may seem strange that Linux
  uses more than one partition on the same disk, even
  when using the standard installation procedure, so some
  explanation is called for.
• One of the goals of having different partitions is to
  achieve higher data security in case of disaster. By
  dividing the hard disk in partitions, data can be grouped
  and separated. When an accident occurs, only the data
  in the partition that got the hit will be damaged, while the
  data on the other partitions will most likely survive.
• There are two kinds of major partitions on a Linux system:
   • data partition: normal Linux system data, including the root
     partition containing all the data to start up and run the system; and
   • swap partition: expansion of the computer's physical memory, extra memory
     on hard disk.
                                    Infinity                                     5
Infinity   6
Infinity   7
• This is the default nowadays on most desktop computers.
  You know you will connect to the system using graphical
  mode when you are first asked for your user name, and
  then, in a new window, to type your password. To log in,
  make sure the mouse pointer is in the login window,
  provide your user name and password to the system and 8
                            Infinity
  click OK or press Enter.
Command                              Meaning
                 Displays a list of files in the current working directory, like
ls
                 the dir command in DOS

cd directory     change directories
passwd           change the password for the current user

file filename    display file type of file with name filename

cat textfile     throws content of textfile on the screen
pwd              display present working directory
exit or logout   leave this session
man command      read man pages on command
                               Infinity                                            9
Directory Content
           Common programs, shared by the system, the system
/bin
           administrator and the users.
           The startup files and the kernel, vmlinuz. In some recent
           distributions also grub data. Grub is the GRand Unified
/boot
           Boot loader and is an attempt to get rid of the many different
           boot-loaders we know today.
           Contains references to all the CPU peripheral hardware, which
/dev
           are represented as files with special properties.
           Most important system configuration files are in /etc, this
/etc       directory contains data similar to those in the Control Panel in
           Windows
/home      Home directories of the common users.
/initrd    (on some distributions) Information for booting. Do not remove!
           Library files, includes files for all kinds of programs needed by
/lib
           the system and the users.
/lost+foun Every partition has a lost+found in its upper directory. Files that
d          were saved during failures are here.
                                      Infinity                                10
/misc      For miscellaneous purposes.
Standard mount point for external file systems, e.g. a CD-ROM or a
/mnt
        digital camera.
/net    Standard mount point for entire remote file systems
/opt    Typically contains extra and third party software.
        A virtual file system containing information about system resources.
        More information about the meaning of the files in proc is obtained
/proc
        by entering the command man proc in a terminal window. The
        fileproc.txt discusses the virtual file system in detail.
        The administrative user's home directory. Mind the difference
/root   between /, the root directory and /root, the home directory of
        the root user.
/sbin   Programs for use by the system and the system administrator.
        Temporary space for use by the system, cleaned upon reboot, so
/tmp
        don't use this for saving any work!
        Programs, libraries, documentation etc. for all user-related
/usr
        programs.
        Storage for all variable files and temporary files created by users,
        such as log files, the mail queue, the print spooler area, space for
/var                                  Infinity                            11
        temporary storage of files downloaded from the Internet, or to keep
• Viewing file properties
  • ls –al
• Creating directories
  • mkdir <dirname>
• Moving files
  • mv <from file path> <to file path>
• Copying files
  • cp -R <from file path> <to file path>
• Removing files
  • rm <file to remove>
• Finding files
  • which acroread
                                Infinity    12
• Find and locate
  • find <path> -name <searchstring>
  • In GUI mode we can always search from the file explorer
    search text box.
• Creating symbolic links
  • ln -s /opt/mp3/Queen/ Queen




                              Infinity                        13
• Every file or folder in Linux has access permissions.
  There are three types of permissions (what allowed to do
  with a file):
  • read access
  • write access
  • execute access
• Permissions are defined for three types of users:
  • the owner of the file
  • the group that the owner belongs to
  • other users



                                Infinity                 14
• Access mode codes
Code Meaning
0 or -   The access right that is supposed to be on this place is not granted.
4 or r   read access is granted to the user category defined in this place
2 or w   write permission is granted to the user category defined in this place
         execute permission is granted to the user category defined in this
1 or x
         place


• User group codes


Code      Meaning
u         user permissions
g         group permissions
o         permissions for others


                                     Infinity                                     15
• chmod command
 • You can set file permissions with the chmod command. Both the
   root user and the file's owner can set file permissions
    • Chmod 777 <filename>
    • This file will have read write and execute rights
 • For more details refer :
   http://www.tuxfiles.org/linuxhelp/filepermissions.html
    • Or just search linux file permission in any search engine you
       will get bunch of website describing this.

• Chown command
   • This will change the owner of the file
   • Chown <user> <filename> : this will make user the owner of
     filename
                               Infinity                               16
Command                            Meaning
bash                               GNU shell program.
cat file(s)                        Send content of file(s) to standard output.

cd directory                       Enter directory. cd is a bash built-in command.


chgrp newgroup file(s)             Change the group ownership of file(s) to newgroup

chmod mode file(s)                 Change access permissions on file(s)
chown newowner[:[newgroup]] file
                                   Change file owner and group ownership.
(s)
cp sourcefile targetfile           Copy sourcefile to targetfile.
                                   Reports on used disk space on the partition
df file
                                   containing file.
echo string                        Display a line of text
                                   Part of bash that announces variables and their
export                                   Infinity                                      17
                                   values to the system.
file filename               Determine file type of filename.
find path expression        Find files in the file system hierarchy
                            Print lines in file containing the search
grep PATTERN file
                            pattern.

head file                   Send the first part of file to standard output

                            Prints real and effective user name and
id
                            groups.
info command                Read documentation about command.
less file                   View file with a powerful viewer.
                            Make a link with
ln targetfile linkname
                            name linkname to targetfile.
                            Print all accessible files matching the
locate searchstring
                            search pattern.
ls file(s)                  Prints directory content.
                            Format and display online (system)
man command
                            manual pages for command.
mkdir newdir                Make a new empty directory.
mv oldfile newfile          Rename or move oldfile.
newgrp groupname              Log
                         Infinity   in to a new group.                  18
pwd             Print the present or current working directory.

quota           Show disk usage and limits.
rm file         Removes files and directories.
rmdir file      Removes directories.
tail file       Print the last part of file.
umask [value]   Show or change new file creation mode.
wc file         Counts lines, words and characters in file.
which comma
               Shows the full path to command.
nd
 File permissions

 WhoWhat             r(ead)                     w(rite)          (e)x(ecute)

 u(ser)               4                          2                1

 g(roup)              4                          2                1

 o(ther)              4                          2                1

                                           Infinity                             19
(part of)
                                                         Meaning
         command
regular_command       Runs this command in the foreground.

command &             Run this command in the background (release the terminal)

jobs                  Show commands running in the background.

Ctrl+Z                Suspend (stop, but not quit) a process running in the foreground (suspend).

Ctrl+C                Interrupt (terminate and quit) a process running in the foreground.


                      Every process running in the background gets a number assigned to it. By using
%n
                      the % expression a job can be referred to using its number, for instance fg %2.


bg                    Reactivate a suspended program in the background.

fg                    Puts the job back in the foreground.

kill                  End a process (also see Shell Builtin Commands in the Info pages of bash)
                                             Infinity                                               20
• Displaying process information
   • Ps
• Pstree
   • relations between processes can be visualized using the pstree
• kill : kill the specified process
• Init 0 : shutdown
• Init 6 : reset




                                Infinity                              21
• Gnome System Monitor
• This displays process
Information like
      running processes
      memory use
      processor uses
      network uses
You can kill, suspend and see
Status of the process here


                         Infinity   22
Command               Meaning
at                    Queue jobs for later execution.
atq                   Lists the user's pending jobs.

atrm                  Deletes jobs, determined by their job number.

batch                 Executes commands when system load level permits.

crontab               Maintain crontab files for individual users.
halt                  Stop the system.
init run level        Process control initialization.
jobs                  Lists currently executing jobs.
kill                  Terminate a process.
mesg                  Control write access to your terminal.
                      Display network connections, routing tables, interface
netstat               statistics, masquerade connections and multicast
                      memberships.

nice                  Run a program with modified scheduling priority.

pgrep                 Display processes.
                 Infinity                                                 23
ps             Report process status.
pstree         Display a tree of processes.
reboot         Stop the system.
renice         Alter priority of running processes.
shutdown       Bring the system down.
sleep          Delay for a specified time.
               Time a command or report resource
time
               usage.
top            Display top CPU processes.
               Show how long the system has been
uptime
               running.
vmstat         Report virtual memory statistics.
               Show who is logged on and what they
w
               are doing.
               Send a message to everybody's
wall
               terminals.
who               Show
           Infinity      who is logged on.            24
• Most Linux commands read input, such as a file or another
  attribute for the command, and write output. By default, input
  is being given with the keyboard, and output is displayed on
  your screen. Your keyboard is yourstandard input (stdin)
  device, and the screen or a particular terminal window is
  the standard output (stdout) device.
• Output redirection with > and |
  • > : put output of a command in a file
  • | : sends the standard output of one command to another command
    as standard input
• Input redirection
  • Accept input from a file. Eg : mail cousin < my_typed_letter
• The >> operator
  • append text to an existing file
• We can also combine this operator as our requirement
                                      Infinity                     25
• Vi(m)
   • Vim stands for "Vi IMproved". It used to be "Vi IMitation", but there are
     so many improvements that a name change was appropriate. Vim is a
     text editor which includes almost all the commands from the UNIX
     program viand a lot of new ones.
• GNU Emacs
   • Emacs is the extensible, customizable, self-documenting, real-time
     display editor, known on many UNIX and other systems.
• And if you are working in GUI mode you have editors like
  gedit, emacs and some other. Using which you can modify
  files very easily.

• Please refer http://www.tuxfiles.org for more details on working
  with these editor

                                    Infinity                                26
• Environment variables
  • An environment variable is a named object that contains data used
    by one or more applications. In simple terms, it is a variable with a
    name and a value. The value of an environmental variable can for
    example be the location of all executable files in the filesystem
     • export MANPATH=$MANPATH:/opt/FlightGear/man
• Shell scripts
  • A shell script is a script written for the shell, or command line
    interpreter, of an operating system. The shell is often considered a
    simple domain-specific programming language. Typical operations
    performed by shell scripts include file manipulation, program
    execution, and printing text.
           #!/bin/csh
          echo compiling...
          cc -c foo.c
          echo done.             Infinity                              27
• RPM packages
  • RPM, the RedHat Package Manager, is a powerful package
    manager that you can use to install, update and remove packages.
    It allows you to search for packages and keeps track of the files
    that come with each package. Eg:
      • rpm -Uvh /path/to/rpm-package(s)
• DEB (.deb) packages
  • This package format is the default on Debian GNU/Linux,
    where dselect, and, nowadays more common, aptitude, is the
    standard tool for managing the packages. It is used to select
    packages that you want to install or upgrade. Eg:
     • dpkg -i debFileName


                               Infinity                            28
• Software Center
  • Using this we can just search and install software
    easily
• Synaptic package manager
  • Provide addition of software source, search of
    software, software organized in categories which easily
    we can select and install
• Moreover you can download .bin, .sh files which
  are binary installation files which you can always
  execute and install it using making it executable
  using chmod + x and ./filename.sh or ./bin file
                            Infinity                      29
Command      Meaning
bzip2        A block-sorting file compressor.

cdrecord     Record audio or data Compact Disks from a master.

dd           Convert and copy a file
fdformat     Low-level formats a floppy disk.
gpg          Encrypt and decrypt data.
gzip         Compress or expand files.
mcopy        Copy MSDOS files to/from UNIX.
mdir         Display an MSDOS directory.

mformat      Add an MSDOS file system to a low-level formatted floppy disk.

mkbootdisk   Creates a stand-alone boot floppy for the running system.

             Mount a file system (integrate it with the current file system by connecting it to a mount
mount
             point).
rsync        Synchronize directories.

tar          Tape archiving utility, also used for making archives on disk instead of on tape.

umount       Unmount file systems.              Infinity                                            30
∞

Infinity   31

Weitere ähnliche Inhalte

Was ist angesagt?

Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
The unix file system
The unix file systemThe unix file system
The unix file system
gsandeepmenon
 

Was ist angesagt? (17)

Linux presentation
Linux presentationLinux presentation
Linux presentation
 
User administration concepts and mechanisms
User administration concepts and mechanismsUser administration concepts and mechanisms
User administration concepts and mechanisms
 
Linux
Linux Linux
Linux
 
Unix files
Unix filesUnix files
Unix files
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumary
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentials
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Host security
Host securityHost security
Host security
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
The unix file system
The unix file systemThe unix file system
The unix file system
 
Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems
 
QSpiders - Unix Operating Systems and Commands
QSpiders - Unix Operating Systems  and CommandsQSpiders - Unix Operating Systems  and Commands
QSpiders - Unix Operating Systems and Commands
 
Unix training session 1
Unix training   session 1Unix training   session 1
Unix training session 1
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
Know the UNIX Commands
Know the UNIX CommandsKnow the UNIX Commands
Know the UNIX Commands
 

Ähnlich wie Linux 4 you

Unit 7
Unit 7Unit 7
Unit 7
siddr
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
Cam YP Co., Ltd
 

Ähnlich wie Linux 4 you (20)

Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
 
Host security
Host securityHost security
Host security
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Linux: Basics OF Linux
Linux: Basics OF LinuxLinux: Basics OF Linux
Linux: Basics OF Linux
 
File system discovery
File system discovery File system discovery
File system discovery
 
Unit 7
Unit 7Unit 7
Unit 7
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Ch1 linux basics
Ch1 linux basicsCh1 linux basics
Ch1 linux basics
 
Linux Getting Started
Linux Getting StartedLinux Getting Started
Linux Getting Started
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools
 
MODULE 3.1 updated-18cs56.pptx
MODULE 3.1 updated-18cs56.pptxMODULE 3.1 updated-18cs56.pptx
MODULE 3.1 updated-18cs56.pptx
 
linux-file-system01.ppt
linux-file-system01.pptlinux-file-system01.ppt
linux-file-system01.ppt
 
Programming Embedded linux
Programming Embedded linuxProgramming Embedded linux
Programming Embedded linux
 

Mehr von Shashwat Shriparv

LibreOffice 7.3.pptx
LibreOffice 7.3.pptxLibreOffice 7.3.pptx
LibreOffice 7.3.pptx
Shashwat Shriparv
 

Mehr von Shashwat Shriparv (20)

Learning Linux Series Administrator Commands.pptx
Learning Linux Series Administrator Commands.pptxLearning Linux Series Administrator Commands.pptx
Learning Linux Series Administrator Commands.pptx
 
LibreOffice 7.3.pptx
LibreOffice 7.3.pptxLibreOffice 7.3.pptx
LibreOffice 7.3.pptx
 
Kerberos Architecture.pptx
Kerberos Architecture.pptxKerberos Architecture.pptx
Kerberos Architecture.pptx
 
Suspending a Process in Linux.pptx
Suspending a Process in Linux.pptxSuspending a Process in Linux.pptx
Suspending a Process in Linux.pptx
 
Kerberos Architecture.pptx
Kerberos Architecture.pptxKerberos Architecture.pptx
Kerberos Architecture.pptx
 
Command Seperators.pptx
Command Seperators.pptxCommand Seperators.pptx
Command Seperators.pptx
 
Upgrading hadoop
Upgrading hadoopUpgrading hadoop
Upgrading hadoop
 
Hadoop migration and upgradation
Hadoop migration and upgradationHadoop migration and upgradation
Hadoop migration and upgradation
 
R language introduction
R language introductionR language introduction
R language introduction
 
Hive query optimization infinity
Hive query optimization infinityHive query optimization infinity
Hive query optimization infinity
 
H base introduction & development
H base introduction & developmentH base introduction & development
H base introduction & development
 
Hbase interact with shell
Hbase interact with shellHbase interact with shell
Hbase interact with shell
 
H base development
H base developmentH base development
H base development
 
Hbase
HbaseHbase
Hbase
 
H base
H baseH base
H base
 
My sql
My sqlMy sql
My sql
 
Apache tomcat
Apache tomcatApache tomcat
Apache tomcat
 
Introduction to apache hadoop
Introduction to apache hadoopIntroduction to apache hadoop
Introduction to apache hadoop
 
Next generation technology
Next generation technologyNext generation technology
Next generation technology
 
Configure h base hadoop and hbase client
Configure h base hadoop and hbase clientConfigure h base hadoop and hbase client
Configure h base hadoop and hbase client
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

Linux 4 you

  • 3. • A simple description of the UNIX system, also applicable to Linux, is this: • "On a UNIX system, everything is a file; if something is not a file, it is a process." This statement is true because there are special files that are more than just files (named pipes and sockets, for instance), but to keep things simple, saying that everything is a file is an acceptable generalization. A Linux system, just like UNIX, makes no difference between a file and a directory, since a directory is just a file containing names of other files. Programs, services, texts, images, and so forth, are all files. Input and output devices, and generally all devices, are considered to be files, according to the system. Infinity 3
  • 4. • Most files are just files, called regular files; they contain normal data, for example text files, executable files or programs, input for or output from a program and so on. • Directories: files that are lists of other files. • Special files: the mechanism used for input and output. Most special files are in /dev, we will discuss them later. • Links: a system to make a file or directory visible in multiple parts of the system's file tree. We will talk about links in detail. • (Domain) sockets: a special file type, similar to TCP/IP sockets, providing inter-process networking protected by the file system's access control. • Named pipes: act more or less like sockets and form a way for processes to communicate with each other, without using network socket semantics. Infinity 4
  • 5. • Most people have a vague knowledge of what partitions are, since every operating system has the ability to create or remove them. It may seem strange that Linux uses more than one partition on the same disk, even when using the standard installation procedure, so some explanation is called for. • One of the goals of having different partitions is to achieve higher data security in case of disaster. By dividing the hard disk in partitions, data can be grouped and separated. When an accident occurs, only the data in the partition that got the hit will be damaged, while the data on the other partitions will most likely survive. • There are two kinds of major partitions on a Linux system: • data partition: normal Linux system data, including the root partition containing all the data to start up and run the system; and • swap partition: expansion of the computer's physical memory, extra memory on hard disk. Infinity 5
  • 8. • This is the default nowadays on most desktop computers. You know you will connect to the system using graphical mode when you are first asked for your user name, and then, in a new window, to type your password. To log in, make sure the mouse pointer is in the login window, provide your user name and password to the system and 8 Infinity click OK or press Enter.
  • 9. Command Meaning Displays a list of files in the current working directory, like ls the dir command in DOS cd directory change directories passwd change the password for the current user file filename display file type of file with name filename cat textfile throws content of textfile on the screen pwd display present working directory exit or logout leave this session man command read man pages on command Infinity 9
  • 10. Directory Content Common programs, shared by the system, the system /bin administrator and the users. The startup files and the kernel, vmlinuz. In some recent distributions also grub data. Grub is the GRand Unified /boot Boot loader and is an attempt to get rid of the many different boot-loaders we know today. Contains references to all the CPU peripheral hardware, which /dev are represented as files with special properties. Most important system configuration files are in /etc, this /etc directory contains data similar to those in the Control Panel in Windows /home Home directories of the common users. /initrd (on some distributions) Information for booting. Do not remove! Library files, includes files for all kinds of programs needed by /lib the system and the users. /lost+foun Every partition has a lost+found in its upper directory. Files that d were saved during failures are here. Infinity 10 /misc For miscellaneous purposes.
  • 11. Standard mount point for external file systems, e.g. a CD-ROM or a /mnt digital camera. /net Standard mount point for entire remote file systems /opt Typically contains extra and third party software. A virtual file system containing information about system resources. More information about the meaning of the files in proc is obtained /proc by entering the command man proc in a terminal window. The fileproc.txt discusses the virtual file system in detail. The administrative user's home directory. Mind the difference /root between /, the root directory and /root, the home directory of the root user. /sbin Programs for use by the system and the system administrator. Temporary space for use by the system, cleaned upon reboot, so /tmp don't use this for saving any work! Programs, libraries, documentation etc. for all user-related /usr programs. Storage for all variable files and temporary files created by users, such as log files, the mail queue, the print spooler area, space for /var Infinity 11 temporary storage of files downloaded from the Internet, or to keep
  • 12. • Viewing file properties • ls –al • Creating directories • mkdir <dirname> • Moving files • mv <from file path> <to file path> • Copying files • cp -R <from file path> <to file path> • Removing files • rm <file to remove> • Finding files • which acroread Infinity 12
  • 13. • Find and locate • find <path> -name <searchstring> • In GUI mode we can always search from the file explorer search text box. • Creating symbolic links • ln -s /opt/mp3/Queen/ Queen Infinity 13
  • 14. • Every file or folder in Linux has access permissions. There are three types of permissions (what allowed to do with a file): • read access • write access • execute access • Permissions are defined for three types of users: • the owner of the file • the group that the owner belongs to • other users Infinity 14
  • 15. • Access mode codes Code Meaning 0 or - The access right that is supposed to be on this place is not granted. 4 or r read access is granted to the user category defined in this place 2 or w write permission is granted to the user category defined in this place execute permission is granted to the user category defined in this 1 or x place • User group codes Code Meaning u user permissions g group permissions o permissions for others Infinity 15
  • 16. • chmod command • You can set file permissions with the chmod command. Both the root user and the file's owner can set file permissions • Chmod 777 <filename> • This file will have read write and execute rights • For more details refer : http://www.tuxfiles.org/linuxhelp/filepermissions.html • Or just search linux file permission in any search engine you will get bunch of website describing this. • Chown command • This will change the owner of the file • Chown <user> <filename> : this will make user the owner of filename Infinity 16
  • 17. Command Meaning bash GNU shell program. cat file(s) Send content of file(s) to standard output. cd directory Enter directory. cd is a bash built-in command. chgrp newgroup file(s) Change the group ownership of file(s) to newgroup chmod mode file(s) Change access permissions on file(s) chown newowner[:[newgroup]] file Change file owner and group ownership. (s) cp sourcefile targetfile Copy sourcefile to targetfile. Reports on used disk space on the partition df file containing file. echo string Display a line of text Part of bash that announces variables and their export Infinity 17 values to the system.
  • 18. file filename Determine file type of filename. find path expression Find files in the file system hierarchy Print lines in file containing the search grep PATTERN file pattern. head file Send the first part of file to standard output Prints real and effective user name and id groups. info command Read documentation about command. less file View file with a powerful viewer. Make a link with ln targetfile linkname name linkname to targetfile. Print all accessible files matching the locate searchstring search pattern. ls file(s) Prints directory content. Format and display online (system) man command manual pages for command. mkdir newdir Make a new empty directory. mv oldfile newfile Rename or move oldfile. newgrp groupname Log Infinity in to a new group. 18
  • 19. pwd Print the present or current working directory. quota Show disk usage and limits. rm file Removes files and directories. rmdir file Removes directories. tail file Print the last part of file. umask [value] Show or change new file creation mode. wc file Counts lines, words and characters in file. which comma Shows the full path to command. nd File permissions WhoWhat r(ead) w(rite) (e)x(ecute) u(ser) 4 2 1 g(roup) 4 2 1 o(ther) 4 2 1 Infinity 19
  • 20. (part of) Meaning command regular_command Runs this command in the foreground. command & Run this command in the background (release the terminal) jobs Show commands running in the background. Ctrl+Z Suspend (stop, but not quit) a process running in the foreground (suspend). Ctrl+C Interrupt (terminate and quit) a process running in the foreground. Every process running in the background gets a number assigned to it. By using %n the % expression a job can be referred to using its number, for instance fg %2. bg Reactivate a suspended program in the background. fg Puts the job back in the foreground. kill End a process (also see Shell Builtin Commands in the Info pages of bash) Infinity 20
  • 21. • Displaying process information • Ps • Pstree • relations between processes can be visualized using the pstree • kill : kill the specified process • Init 0 : shutdown • Init 6 : reset Infinity 21
  • 22. • Gnome System Monitor • This displays process Information like running processes memory use processor uses network uses You can kill, suspend and see Status of the process here Infinity 22
  • 23. Command Meaning at Queue jobs for later execution. atq Lists the user's pending jobs. atrm Deletes jobs, determined by their job number. batch Executes commands when system load level permits. crontab Maintain crontab files for individual users. halt Stop the system. init run level Process control initialization. jobs Lists currently executing jobs. kill Terminate a process. mesg Control write access to your terminal. Display network connections, routing tables, interface netstat statistics, masquerade connections and multicast memberships. nice Run a program with modified scheduling priority. pgrep Display processes. Infinity 23
  • 24. ps Report process status. pstree Display a tree of processes. reboot Stop the system. renice Alter priority of running processes. shutdown Bring the system down. sleep Delay for a specified time. Time a command or report resource time usage. top Display top CPU processes. Show how long the system has been uptime running. vmstat Report virtual memory statistics. Show who is logged on and what they w are doing. Send a message to everybody's wall terminals. who Show Infinity who is logged on. 24
  • 25. • Most Linux commands read input, such as a file or another attribute for the command, and write output. By default, input is being given with the keyboard, and output is displayed on your screen. Your keyboard is yourstandard input (stdin) device, and the screen or a particular terminal window is the standard output (stdout) device. • Output redirection with > and | • > : put output of a command in a file • | : sends the standard output of one command to another command as standard input • Input redirection • Accept input from a file. Eg : mail cousin < my_typed_letter • The >> operator • append text to an existing file • We can also combine this operator as our requirement Infinity 25
  • 26. • Vi(m) • Vim stands for "Vi IMproved". It used to be "Vi IMitation", but there are so many improvements that a name change was appropriate. Vim is a text editor which includes almost all the commands from the UNIX program viand a lot of new ones. • GNU Emacs • Emacs is the extensible, customizable, self-documenting, real-time display editor, known on many UNIX and other systems. • And if you are working in GUI mode you have editors like gedit, emacs and some other. Using which you can modify files very easily. • Please refer http://www.tuxfiles.org for more details on working with these editor Infinity 26
  • 27. • Environment variables • An environment variable is a named object that contains data used by one or more applications. In simple terms, it is a variable with a name and a value. The value of an environmental variable can for example be the location of all executable files in the filesystem • export MANPATH=$MANPATH:/opt/FlightGear/man • Shell scripts • A shell script is a script written for the shell, or command line interpreter, of an operating system. The shell is often considered a simple domain-specific programming language. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. #!/bin/csh echo compiling... cc -c foo.c echo done. Infinity 27
  • 28. • RPM packages • RPM, the RedHat Package Manager, is a powerful package manager that you can use to install, update and remove packages. It allows you to search for packages and keeps track of the files that come with each package. Eg: • rpm -Uvh /path/to/rpm-package(s) • DEB (.deb) packages • This package format is the default on Debian GNU/Linux, where dselect, and, nowadays more common, aptitude, is the standard tool for managing the packages. It is used to select packages that you want to install or upgrade. Eg: • dpkg -i debFileName Infinity 28
  • 29. • Software Center • Using this we can just search and install software easily • Synaptic package manager • Provide addition of software source, search of software, software organized in categories which easily we can select and install • Moreover you can download .bin, .sh files which are binary installation files which you can always execute and install it using making it executable using chmod + x and ./filename.sh or ./bin file Infinity 29
  • 30. Command Meaning bzip2 A block-sorting file compressor. cdrecord Record audio or data Compact Disks from a master. dd Convert and copy a file fdformat Low-level formats a floppy disk. gpg Encrypt and decrypt data. gzip Compress or expand files. mcopy Copy MSDOS files to/from UNIX. mdir Display an MSDOS directory. mformat Add an MSDOS file system to a low-level formatted floppy disk. mkbootdisk Creates a stand-alone boot floppy for the running system. Mount a file system (integrate it with the current file system by connecting it to a mount mount point). rsync Synchronize directories. tar Tape archiving utility, also used for making archives on disk instead of on tape. umount Unmount file systems. Infinity 30