0% found this document useful (0 votes)
23 views61 pages

Linux

Linux is an open source operating system that sits underneath software and relays requests to hardware. GNOME is a free and open source software desktop environment that runs on Linux and BSD derivatives and is the default on many distributions. KDE is another desktop environment that provides tools for developers to write applications and is used on various platforms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views61 pages

Linux

Linux is an open source operating system that sits underneath software and relays requests to hardware. GNOME is a free and open source software desktop environment that runs on Linux and BSD derivatives and is the default on many distributions. KDE is another desktop environment that provides tools for developers to write applications and is used on various platforms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 61

LINUX 1

Linux is the best-known and most-used open source operating system. As an operating system, Linux is
software that sits underneath all of the other software on a computer, receiving requests from those programs
and relaying these requests to the computer’s hardware.
Reffer the below mentioned website
https://opensource.com/resources/linux

Nahida Nazir
2

GENOME
• GNOME is a free and open source software that runs on Linux and most BSD derivatives. It
is the default desktop environments on many Linux distributions such as Fedora, Debian,
Red Hat Enterprise Linux, CentOS, Oracle Linux, Solaris and Kali Linux.

Nahida Nazir
3

• It was developed as part of the GNU Project by The GNOME Project. This project has a
large number of contributors. The main contributor among them is Red Hat. The main
objective of developing the GNU project was to develop frameworks that support the
software development. These frameworks help to program the end user applications.

• The official user interface of GNOME desktop environment is the GNOME shell. It has
features such as activities button, application menu, a clock and an integrated system status
menu.

Nahida Nazir
4

KDE

• KDE is a desktop environment that allows carrying out daily tasks without relying on the
Command Line Interface. Two common products of KDE are Plasma Desktop and KDE
frameworks. They are designed to run on Microsoft Windows, Android, Unix Desktops, etc.
It provides tools and documents for the developers to write applications.

Nahida Nazir
5

• KDE is a central development hub for many applications such as Krita and Calligra Suite.
KDE Plasma provides a unified environment for running and managing applications on
desktops, netbooks, smartphones, and tablets. KDE applications such as KTorrent and KDE
Partition Manager are built on top of KDE frameworks. KDE applications are portable
between operating systems

Nahida Nazir
GNOME VS KDE
COMMAND LINE STRUCTURE
 A command is a program that tells the Unix system to do something
 syntax command [options] [arguments]
 Commands are case sensitive.
 DATE and date are not same .
CHECKING DESKTOP
CHECKING VERSION AND RELEASE
DATE
CAL COMMAND
 This command presents the quick view of a calander
 Type cal for current calendar
 for previous calendar like 2008 type cal 2008
DATE COMMAND
Displays the system date and time
 For current date type date
 for 2 years ago here is the format
ECHO COMMAND
 It is used to display the character / string or other values that are
passed to it
PRINTING CHARACTERS BY
DIFFERENT WAYS
MKDIR
To create directories (also referred to as folders in some operating
systems)
 mkdir mydir creates a directory of my dir
mkdir mydir1 mydir2 mydir3 creates multiple directories
RMDIR – REMOVE EMPTY DIRECTORY

rmdir –p mydir1/mydir2/mydir3 (Each of the directory


argument is treated as a pathname of which all components will be
removed, if they are already empty, starting from the last
component.)
rmdirmydir1/mydir2/mydir3 (Remove directory mydir3
if it’s empty)
rmdirmydir1 mydir2 mydir3 (Remove the
directories mydir1, mydir2, and mydir3, if they are empty.)
LS – LIST CONTENTS OF A DIRECTORY
• ls - -help (displays general syntax)
• ls –t (sorts files by modification time)
• ls –a lists all the files along with hidden files
 pwd – present working directory
CAT
 cat - cat command allows us to create files, view contain of file,
concatenate files and redirect output in terminal or files.
 cat myfile (read content of myfile)
cat myfile1 myfile2 (read content of myfile1 and
myfile2)
cat –n myfile1 myfile2 (display content with line number)
cat >myfile (create new file named myfile and
write into it)
PRINTF
printf” command in Linux is used to display the given string, number
or any other format specifier on the terminal window.
 The most commonly used printf specifiers are %s, %b, %d, %x and
%f.
%S SPECIFIER
%s specifier: It is basically a string specifier for string output.$printf
"%s\n" "Hello, World!"
%D SPECIFIER
%d specifier: It is an integer specifier for showing the integral values.
Syntax $printf "%d\n" "213" "109"
%F SPECIFIER
BC COMMAND
 bc command is used for command line calculator. It is similar to
basic calculator by using which we can do basic mathematical
calculations
WHO COMMAND
command is used to find out the following information :
1. Time of last system boot
2. Current run level of the system
3. List of logged in users and more.
Syntax who
Who –a for all users
Who -b time of last boot
TOUCH COMMAND
It is used to create a file without any content
This command can be used when the user doesn’t have data to store
at the time of file creation.
Syntax touch file1 file2 file3
MODIFYING TIMESTAMPS
A timestamp is information associated with a file that identifies an
important time in the files history
STAT FILE1 THAT DISPLAYS FILE
STATUS
CHANGING TIMESTAMP ACCESS
TIME
-m is used to change the change the modification time and –a option is
used to change the access time
CHANGING THE MODIFICATION
TIME
CHANGING DATE

touch –d “ 2002-09-7 13:24” name of file that you created


Type stat
SCRIPT COMMAND
command in Linux is used to make typescript or record all the terminal
activities. After executing the script command it starts recording
everything printed on the screen including the inputs and outputs until
exit.
Syntax type script
Type exit to exit from script command
SCRIPT COMMAND
 to start type script and to stop type exit
Default name of file is typescript
 But we can change the name of typescript to any other name by
typing the following command
 mv typescript name of file(say abc)
 Then to display type cat or more abc
SCRIPT COMMAND
command in Linux is used to make typescript or record all the terminal
activities. After executing the script command it starts recording
everything printed on the screen including the inputs and outputs until
exit.
Syntax type script
Type exit to exit from script command
SCRIPT COMMAND
 to start type script and to stop type exit
Default name of file is typescript
 But we can change the name of typescript to any other name by
typing the following command
 mv typescript name of file(say abc)
 Then to display type cat or more abc
GREP
 The grep filter searches a file for a particular pattern of characters,
and displays all lines that contain that pattern
 grep stands for globally search for regular expression and print out
DISPLAYING THE COUNT OF
NUMBER OF MATCHES
 We can find the number of lines that matches the given string/pattern
 syntax grep -c “in" file1.txt
 Note inside the quotes it can be any word that is present in your file
followed by the filename
FINDING “IN”
DISPLAYING ONLY THE MATCHED
PATTERN
 We can make the grep to display only the matched string by using
the -o option.
 syntax
SHOW LINE NUMBER WHILE DISPLAYING
THE OUTPUT USING GREP -N
 o show the line number of file with the line matched.
INVERTING THE PATTERN MATCH
 You can display the lines that are not matched with the specified
search sting pattern using the -v option.
 syntax
HISTORY COMMAND
 The history command will show you the last five hundred
commands you have entered.
TO CHECK THE LIMITED NO. OF
COMMANDS
 To check last five executed commands
 syntax history 5
MOST RECENTLY EXECUTED
COMMAND
CLEARING YOUR HISTORY
 history –c
CP COMMAND
 This command is used to copy files or group of files or directory.
 cp command require at least two filenames in its arguments.
COPYING FILE INTO DIRECTORY
OVERWRITING THE TEXT OF SOURCE
FILE TO DESTINATION FILE
cat> a1.txt
good to see you
cat>a2.txt
teacher
cp -i a1.txt a2.txt
cp: overwrite 'a2.txt'? y
cat a2.txt
good to see you
~$
COPYING A FILE IN MULTIPLE
DIRECTORIES
Syntax Cp –r followed by name of directories
RENAMING A FILE
 mv file1.txt(name of file that you want to change ) followed by the
name the name you want to keep it .
 type ls to check the renamed file .
49

pwd command
Displays the path name of the working directory. The pwd command writes to standard output
the full path name of your current directory (from the root directory). All directories are
separated by a / (slash). The root directory is represented by the first /, and the last directory
named is your current directory

Nahida Nazir
50

• -L
• Displays the value of the PWD environment variable if the PWD environment variable
contains an absolute path name of the current directory that does not contain the file names .
(dot) or .. (dot-dot). Otherwise, the -L flag behaves the same as the -P flag.

Nahida Nazir
-P

51

• -P
• Displays the absolute path name of the current directory. The absolute path name displayed
with the -P flag does not contain file names that, in the context of the path name, refer to
files of type symbolic link.

Nahida Nazir
52

ABSOLUTE PATH
• An absolute path is defined as specifying the location of a file or directory from the root
directory(/). In other words,we can say that an absolute path is a complete path from start of
actual file system from / directory.

Nahida Nazir
53

RELATIVE PATH
• Relative path is defined as the path related to the present working directly(pwd). It starts at
your current directory and never starts with a / .
• .(a single dot) - this represents the current directory.
• ..(two dots) - this represents the parent directory.
• Now, what this actually means is that if we are currently in directory /home/kt/abc and now
you can use .. as an argument to cd to move to the parent directory /home/kt as :

Nahida Nazir
54

• $pwd
• /home/kt/abc
• $cd .. ***moves one level up***
• $pwd
• /home/kt

Nahida Nazir
55

• NOTE:Now / when used with .. has a different meaning ;instead of moving down a level,it
moves one level up:


• $pwd
• /home/kt/abc ***moves two level up***
• $cd ../..
• $pwd
• /home

Nahida Nazir
56

• cat command
Cat(concatenate) command is very frequently used in Linux. It reads data from the file and
gives their content as output. It helps us to create, view, concatenate files. So let us see some
frequently used cat commands
Syntax cat filename {to display the content of a file}

Nahida Nazir
57

CONCATENATION

Nahida Nazir
58

COPYING CONTENT FROM ONE FILE INTO


ANOTHER ONE WITH OVERWRITTING

Nahida Nazir
59

COPYING IN A SINGLE FILE


WITHOUT OVERWRITING

Nahida Nazir
60

TO PRINT THE TEXT IN REVERSE


ORDER
tac ge.txt

Nahida Nazir
61

DISPLAY LINE NUMBER

• cat –n g2.txt

Nahida Nazir

You might also like