Uploaded by Ain Berrie

Introduction-to-Linux

advertisement
What is
Linux?
It’s an
Operating
System
Linux is the kernel of an operating system. People who
are interested in computer-based electronic systems in
the name of UNIX have certainly heard it somewhere.
Linux is a UNIX clone. Linux was created by Linus
Torvalds using a language base developed by MIT called
Scratch. Linux is free and open-source software. You
can share this with your own name by making a small
change on Linux. There are a lot of Linux distributors,
and they are called "distros".
The terminal is simply a program. It takes the
commands that the users have entered and gives
them to the operating system to process. It shows
the results of the commands and the output on
itself. It mean that, it is the main bridge between the
operating system and the user. Linux distributors
come with a GUI (Graphical User Interface), but, Every
Linux has a CLI (Command Line Interface). In this
section we will discuss the simple commands we can
use in the Linux Terminal.










Network: ssh, scp, ping, telnet, nslookup, wget
Shells: BASH, TCSH, alias, watch, clear, history, chsh, echo,
set, setenv, xargs
System Information: w, whoami, man, info, which, free,
echo, date, cal, df, free, man, info
Command Information: man, info
Symbols: |, >, >>, <, &, >&, 2>&1, ;, ~, ., .., $!, !:<n>,
!<n>
Filters: grep, egrep, more, less, head, tail
Hotkeys: <ctrl><c>, <ctrl><d>
File System: ls, mkdir, cd, pwd, mv, ln, touch, cat, file,
find, diff, cmp, /net/<hostname>/<path>, mount, du, df,
chmod, find
Line Editors: awk, sed
File Editors: vim, gvim, emacs –nw, emacs
SNo.
Command
Function
1.
date
Show current date and time
2.
man
Tells how commands can be used
3.
ls
Directory listing
4.
cd
Change to home directory
5.
cd ..
Change to parent directory
6.
cd /
Change directory to root
7.
cd dir
Change directory to dir
8.
pwd
Show current working directory
9.
mkdir
Creating a new directory
10.
rmdir
Remove directory
11.
clear
Clear Screen
SNo.
Tasks
1.
Clear screen
2.
Display your current directory..
3.
Change to the any sub directory.
4.
Now change to your home directory
5.
Go to the parent directory of the current directory.
6.
Go to the root directory.
7.
List the contents of the root directory.
8.
List all the files in your home directory
9.
Create two directories testdir1 and testdir2 in your home directory
10.
Remove a directory testdir2 from your home directory
11.
Show current date and time.
SN
o.
Comma
nd
Function
SNo
.
Tasks
1.
date
Show current date and time
1.
Clear screen
2.
man
Tells how commands can be used
2.
Display your current directory..
3.
ls
Directory listing
3.
Change to the any sub directory.
4.
Now change to your home directory
5.
Go to the parent directory of the current
directory.
6.
Go to the root directory.
7.
List the contents of the root directory.
8.
List all the files in your home directory
9.
Create two directories testdir1 and testdir2 in
your home directory
10.
Remove a directory testdir2 from your home
directory
11.
Show current date and time.
4.
cd
Change to home directory
5.
cd ..
Change to parent directory
6.
cd /
Change directory to root
7.
cd dir
Change directory to dir
8.
pwd
Show current working directory
9.
mkdir
Creating a new directory
10
.
rmdir
Remove directory
11
.
clear
Clear Screen

Useful options for the “ls” command:
◦ ls -a List all file including hidden file beginning with
a period “.”
◦ ls -ld * List details about a directory and not its
contents
◦ ls -F Put an indicator character at the end of each
name
◦ ls –l Simple long listing
◦ ls –lh Give human readable file sizes
◦ ls –lS Sort files by file size
◦ ls –lt Sort files by modification time

New-Item "C:\Users\Valued
User\Downloads\AAA.txt“

"Hello World" | Set-Content "C:\Users\Valued
User\Downloads\AAA.txt“


Get-Content "C:\Users\Valued
User\Downloads\AAA.txt“
Remove-Item "C:\Users\Valued
User\Downloads\AAA.txt"









Write a Linux Script to go to “ Documents”
Directory and perform the following task.
List all the items of Documents
Create a Sub-Directory “CS Lab”.
Create two new files in Sub-Directory
◦ My Info
◦ My Details
Add content in both the files above. (Name, id etc)
Show the Content of Files on Power shell Terminal.
Delete the File naming My Details
Show the Current time and Date.
Take a screenshot of all the tasks performed above and
upload on Google Class Room in a pdf file in above
mentioned order.
Related documents
Download