Avdut Final
Avdut Final
Introduction
Linux is a community of open-source Unix like operating systems that are
based on the Linux Kernel. It was initially released by Linus Torvalds on
September 17, 1991. It is a free and open-source operating system and the
source code can be modified and distributed to anyone commercially or
noncommercially under the GNU General Public License.
Initially, Linux was created for personal computers and gradually it was used
in other machines like servers, mainframe computers, supercomputers, etc.
Nowadays, Linux is also used in embedded systems like routers, automation
controls, televisions, digital video recorders, video game consoles,
smartwatches, etc. The biggest success of Linux is Android(operating
system) it is based on the Linux kernel that is running on smartphones and
tablets. Due to android Linux has the largest installed base of all general-
purpose operating systems. Linux is generally packaged in a Linux
distribution.
lOMoAR cPSD| 25205884
Architecture of Linux
• Linux architecture has the following components:
lOMoAR cPSD| 25205884
1. pwd Command
The pwd command is used to display the location of the current working directory.
Syntax:
1. pwd
2. mkdir Command
The mkdir command is used to create a new directory under any directory.
Syntax:
mkdir <directory name>
Output:
3. rmdir Command
Output:
4. ls Command
Syntax:
ls
Output:
lOMoAR cPSD| 25205884
5. cd Command
cd <directory name>
Output:
6. touch Command
The touch command is used to create empty files. We can create multiple empty files by
executing it once.
Syntax:
)
lOMoAR cPSD| 25205884
7. cat Command
The cat command is a multi-purpose utility in the Linux system. It can be used to create a file,
display content of the file, copy the content of one file to another file, and more.
Syntax:
1. cat [OPTION]... [FILE]..
To create a file, execute it as follows:
Output:
8. rm Command
rm <file name>
)
lOMoAR cPSD| 25205884
Output:
9. cp Command
10. mv Command
The mv command is used to move a file or a directory form one location to another location.
Syntax:
)
lOMoAR cPSD| 25205884
The rename command is used to rename files. It is useful for renaming a large group of files.
Syntax:
The head command is used to display the content of a file. It displays the first 10 lines of a file.
Syntax:
)
lOMoAR cPSD| 25205884
Output:
The tail command is similar to the head command. The difference between both commands is
that it displays the last ten lines of the file content. It is useful for reading the error message.
Syntax:
)
lOMoAR cPSD| 25205884
The tac command is the reverse of cat command, as its name specified. It displays the file content
in reverse order (from the last line).
Syntax:
Output:
The more command is quite similar to the cat command, as it is used to display the file content in
the same way that the cat command does. The only difference between both commands is that, in
case of larger files, the more command displays screenful output at a time.
In more command, the following keys are used to scroll the page:
)
lOMoAR cPSD| 25205884
Output:
)
lOMoAR cPSD| 25205884
The less command is similar to the more command. It also includes some extra features such as
'adjustment in width and height of the terminal.' Comparatively, the more command cuts the output
in the width of the terminal.
Syntax:
)
lOMoAR cPSD| 25205884
Output:
17. su Command
The su command provides administrative access to another user. In other words, it allows access
of the Linux shell to another user.
Syntax:
18. id Command
The id command is used to display the user ID (UID) and group ID (GID).
Syntax:
1. id
Output:
lOMoAR cPSD| 25205884
1. useradd username
Output:
The passwd command is used to create and change the password for a user.
Syntax:
14
lOMoAR cPSD| 25205884
The cat command is also used as a filter. To filter a file, it is used inside pipes.
Syntax:
1. cat <fileName> | cat or tac | cat or tac |. . .
Output:
The cut command is used to select a specific column of a file. The '-d' option is used as a delimiter,
and it can be a space (' '), a slash (/), a hyphen (-), or anything else. And, the '-f' option is used to
specify a column number.
Syntax:
Output:
lOMoAR cPSD| 25205884
The grep is the most powerful and used filter in a Linux system. The 'grep' stands for "global
regular expression print." It is useful for searching the content from a file. Generally, it is used
with the pipe.
Syntax:
Output:
The 'comm' command is used to compare two files or streams. By default, it displays three
columns, first displays non-matching items of the first file, second indicates the non-matching item
of the second file, and the third column displays the matching items of both files.
Syntax:
16
lOMoAR cPSD| 25205884
Output:
The sed command is also known as stream editor. It is used to edit files using a regular expression.
It does not permanently edit files; instead, the edited content remains only on display. It does not
affect the actual file.
Syntax:
The tee command is quite similar to the cat command. The only difference between both filters is
that it puts standard input on standard output and also write them into a file.
Syntax:
28. tr Command
The tr command is used to translate the file content like from lower case to upper case.
Syntax:
18
lOMoAR cPSD| 25205884
The uniq command is used to form a sorted list in which every word will occur only once.
Syntax:
30. wc Command
The wc command is used to count the lines, words, and characters in a file.
Syntax:
1. wc <file name>
Output:
31. od Command
The od command is used to display the content of a file in different s, such as hexadecimal, octal,
and ASCII characters.
Syntax:
lOMoAR cPSD| 25205884
Output:
20
lOMoAR cPSD| 25205884
The gzip command is used to truncate the file size. It is a compressing tool. It replaces the
original file by the compressed file having '.gz' extension.
Syntax:
Output:
The gunzip command is used to decompress a file. It is a reverse operation of gzip command.
Syntax:
1. gunzip <file1> <file2> <file3>. .
Output:
lOMoAR cPSD| 25205884
The find command is used to find a particular file within a directory. It also supports various
options to find a file such as byname, by type, by date, and more.
22
lOMoAR cPSD| 25205884
The locate command is used to search a file by file name. It is quite similar to find command; the
difference is that it is a background process. It searches the file in the database, whereas the find
command searches in the file system. It is faster than the find command. To find the file with the
locates command, keep your database updated.
Syntax:
Output:
The date command is used to display date, time, time zone, and more.
lOMoAR cPSD| 25205884
Syntax:
1. date
Output:
The cal command is used to display the current month's calendar with the current date highlighted.
Syntax:
1. cal<
Output:
The sleep command is used to hold the terminal by the specified amount of time. By default, it
takes time in seconds.
Syntax:
24
lOMoAR cPSD| 25205884
Syntax:
1. time
Output:
Output:
lOMoAR cPSD| 25205884
42. df Command
The df command is used to display the disk space used in the file system. It displays the output as
in the number of used blocks, available blocks, and the mounted directory.
Syntax:
1. df
Output:
The mount command is used to connect an external device file system to the system's file system.
Syntax:
Output:
26
lOMoAR cPSD| 25205884
Linux exit command is used to exit from the current shell. It takes a parameter as a number and
exits the shell with a return of status number.
Syntax:
1. exit
Output:
1. clear
Output:
lOMoAR cPSD| 25205884
After pressing the ENTER key, it will clear the terminal screen
❖ Linux Networking Commands
46. ip Command
Syntax:
1. ip a or ip addr
Output:
Linux ssh command is used to create a remote connection through the ssh protocol.
28
lOMoAR cPSD| 25205884
Syntax:
1. ssh user_name@host(IP/Domain_name)</p>
The mail command is used to send emails from the command line.
Syntax:
The ping command is used to check the connectivity between two nodes, that is whether the server
is connected. It is a short form of "Packet Internet Groper."
Syntax:
1. ping <destination>
Output:
The host command is used to display the IP address for a given domain name and vice versa. It
performs the DNS lookups for the DNS Query.
Syntax:
Output:
30
lOMoAR cPSD| 25205884
7.0 Outputs of the micro projects (Drawings of the prototype, drawing of survey,
Presentation of collected data, findings etc.)
2. ping
• Conclusion
lOMoAR cPSD| 25205884
By subscribing to the security alert mailing lists, and keeping current, you can do a lot towards securing your
machine. If you pay attention to your log files and run something like tripwire regularly, you can do even more.
A reasonable level of computer security is not difficult to maintain on a home machine. More effort is required
on business machines, but Linux can indeed be a secure platform. Due to the nature of Linux development,
security fixes often come out much faster than they do on commercial operating systems, making Linux an ideal
platform when security is a requirement.
32
lOMoAR cPSD| 25205884
Referenc http://www.thegeekstuff.com/2010/07/executeshell-script/
http://en.wikipedia.org/wiki/Shell_script
http://www.calpoly.edu/~rasplund/script.html ➢
http://supportweb.cs.bham.ac.uk/docs/tutorials/docsystem/build/tutorials/unixscripting/uni