Assignment 1
Assignment 1
8. Operating systems : It is the system software for both computer hardware and
software and provides common service for computer programme
11.Editor : It is a software programme which enables the user to create or edit text
files.
12.Shell : It is the outermost layer of the operating system which understands and
executes the instruction given by the user.
LINUX COMMANDS
s7@pglab1-19:~$ pwd
/home/s7
s7@pglab1-19:~$ ls
Desktop Documents Downloads Music Pictures Public S7-senthalir2310047 snap Templates
Videos
s7@pglab1-19:~$ cd S7-senthalir2310047
s7@pglab1-19:~/S7-senthalir2310047$ pwd
/home/s7/S7-senthalir2310047
s7@pglab1-19:~/S7-senthalir2310047$ pwd
/home/s7/S7-senthalir2310047
s7@pglab1-19:~/S7-senthalir2310047$ cd A1
s7@pglab1-19:~/S7-senthalir2310047/A1$ pwd
/home/s7/S7-senthalir2310047/A1
s7@pglab1-19:~/S7-senthalir2310047/A1$ cd B1
bash: cd: B1: No such file or directory
s7@pglab1-19:~/S7-senthalir2310047/A1$ cd ..
s7@pglab1-19:~/S7-senthalir2310047$ cd ..pwd
bash: cd: ..pwd: No such file or directory
s7@pglab1-19:~/S7-senthalir2310047$ cd .. ped
bash: cd: too many arguments
s7@pglab1-19:~/S7-senthalir2310047$ cd .. pwd
bash: cd: too many arguments
s7@pglab1-19:~/S7-senthalir2310047$ mkdir A2
s7@pglab1-19:~/S7-senthalir2310047$ cd A2
s7@pglab1-19:~/S7-senthalir2310047/A2$ cd A1
bash: cd: A1: No such file or directory
s7@pglab1-19:~/S7-senthalir2310047/A2$ cd ..
s7@pglab1-19:~/S7-senthalir2310047$ cd A1
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat>ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls -l
total 116
-rw-rw-r-- 1 s7 s7 32757 Sep 14 11:01 Assignment.odt
-rw-rw-r-- 1 s7 s7 80777 Sep 14 10:20 Ex1-LinuxCommands-iPython.pdf
-rw-rw-r-- 1 s7 s7 38 Sep 14 11:47 ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls
Assignment.odt Ex1-LinuxCommands-iPython.pdf ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ chmod 764 ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls -l
total 116
-rw-rw-r-- 1 s7 s7 32757 Sep 14 11:01 Assignment.odt
-rw-rw-r-- 1 s7 s7 80777 Sep 14 10:20 Ex1-LinuxCommands-iPython.pdf
-rwxrw-r-- 1 s7 s7 38 Sep 14 11:47 ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ chmod u-wx ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ chmod g-wx ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ chmod o+wx ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls -l
total 116
-rw-rw-r-- 1 s7 s7 32757 Sep 14 11:01 Assignment.odt
-rw-rw-r-- 1 s7 s7 80777 Sep 14 10:20 Ex1-LinuxCommands-iPython.pdf
-r--r--rwx 1 s7 s7 38 Sep 14 11:47 ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat>>ssn
bash: ssn: Permission denied
s7@pglab1-19:~/S7-senthalir2310047/A1$ chmod u+w ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat>ssn
ssn college of engineering chennai senthalir^Z
[2]+ Stopped cat > ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ wc ssn
0 0 0 ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ man wc
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat>ssn
ssn college of engineering senthalir
^Z
[3]+ Stopped cat > ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ wc ssn
1 5 37 ssn
s7@pglab1-19:~/S7-senthalir2310047/A1$ cp ssn college
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat collge
cat: collge: No such file or directory
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat college
ssn college of engineering senthalir
s7@pglab1-19:~/S7-senthalir2310047/A1$ mv college college2
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat college2
ssn college of engineering senthalir
s7@pglab1-19:~/S7-senthalir2310047/A1$ who
s7 tty2 2023-09-14 10:14 (tty2)
s7@pglab1-19:~/S7-senthalir2310047/A1$ whoami
s7
s7@pglab1-19:~/S7-senthalir2310047/A1$ date
Thursday 14 September 2023 12:14:47 PM IST
s7@pglab1-19:~/S7-senthalir2310047/A1$ calender 2023
Command 'calender' not found, did you mean:
command 'calendar' from deb calendar (12.1.7+nmu3ubuntu2)
Try: apt install <deb name>
s7@pglab1-19:~/S7-senthalir2310047/A1$ calendar
Command 'calendar' not found, but can be installed with:
apt install calendar
Please ask your administrator.
s7@pglab1-19:~/S7-senthalir2310047/A1$ bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation,
Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
2+3
5
^C
(interrupt) use quit to exit.
quit
s7@pglab1-19:~/S7-senthalir2310047/A1$ mkdir ssn
mkdir: cannot create directory ‘ssn’: File exists
s7@pglab1-19:~/S7-senthalir2310047/A1$ mkdir SSN
s7@pglab1-19:~/S7-senthalir2310047/A1$ mkdir SSN/BE
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls SSN
BE
s7@pglab1-19:~/S7-senthalir2310047/A1$ cal 2023
Command 'cal' not found, but can be installed with:
apt install ncal
Please ask your administrator.
s7@pglab1-19:~/S7-senthalir2310047/A1$ cat>firstyear.txt
first year orientation was held on 25th august 2023 in justice pratab auditorium^Z
[4]+ Stopped cat > firstyear.txt
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls BE
ls: cannot access 'BE': No such file or directory
s7@pglab1-19:~/S7-senthalir2310047/A1$ mv firstyear.txt orientation.txt
s7@pglab1-19:~/S7-senthalir2310047/A1$ cd orientation.txt
bash: cd: orientation.txt: Not a directory
s7@pglab1-19:~/S7-senthalir2310047/A1$ mv orientation.txt BE
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls -l
total 124
-rw-rw-r-- 1 s7 s7 32757 Sep 14 11:01 Assignment.odt
-rw-rw-r-- 1 s7 s7 0 Sep 14 12:25 BE
-rw-r--r-x 1 s7 s7 37 Sep 14 12:12 college2
-rw-rw-r-- 1 s7 s7 80777 Sep 14 10:20 Ex1-LinuxCommands-iPython.pdf
-rw-r--rwx 1 s7 s7 37 Sep 14 12:12 ssn
drwxrwxr-x 3 s7 s7 4096 Sep 14 12:19 SSN
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls -lBE
ls: invalid option -- 'E'
Try 'ls --help' for more information.
s7@pglab1-19:~/S7-senthalir2310047/A1$ ls -l BE
-rw-rw-r-- 1 s7 s7 0 Sep 14 12:25 BE
s7@pglab1-19:~/S7-senthalir2310047/A1$ cd SSN
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN$ ls BE
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN$ cat>firstyear.txt
^Z
[5]+ Stopped cat > firstyear.txt
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN$ cd BE
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ cat>orientation.txt
first year orientation was held on 25th august 2023 ^Z
[6]+ Stopped cat > orientation.txt
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ ls -lBE
ls: invalid option -- 'E'
Try 'ls --help' for more information.
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ ls -l BE
ls: cannot access 'BE': No such file or directory
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ ls -l
total 0
-rw-rw-r-- 1 s7 s7 0 Sep 14 12:35 orientation.txt
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ chmod u+x
chmod: missing operand after ‘u+x’
Try 'chmod --help' for more information.
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ chmod u+x
chmod: missing operand after ‘u+x’
Try 'chmod --help' for more information.
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ chmod g-r
chmod: missing operand after ‘g-r’
Try 'chmod --help' for more information.
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ ls -l
total 0
-rw-rw-r-- 1 s7 s7 0 Sep 14 12:35 orientation.txt
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ chmod u+x orientation.txt
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ ls -l
total 0
-rwxrw-r-- 1 s7 s7 0 Sep 14 12:35 orientation.txt
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ cat>Aboutme.txt
I am senthalir from mechanical department ^Z
[7]+ Stopped cat > Aboutme.txt
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/BE$ cd ..
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN$ mkdir dept_mech
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN$ mkdir SEC7
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN$ cd dept_mech/
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/dept_mech$ cat>dep.txt
mechanical department is one of the core department ^Z
[8]+ Stopped cat > dep.txt
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN/dept_mech$ cd ..
s7@pglab1-19:~/S7-senthalir2310047/A1/SSN$
PYTHON COMMANDS
guest@rams-pc:~$ python3
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> num1=100
>>> print(num1)
100
>>> type(num1)
<class 'int'>
>>> num2=200
>>> type(num2)
<class 'int'>
>>> num2=12.345
>>> type(num2)
<class 'float'>
>>> print(num2)
12.345
>>> name=senthalir
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'senthalir' is not defined
>>> name="senthalir"
>>> print(name0
...
... print(name)
File "<stdin>", line 1
print(name0
^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
>>> print(name)
senthalir
>>> type(name)
<class 'str'>
>>> print("hello"+name)
hellosenthalir
>>> print(4+6*7/2)
25.0
>>> print(4+5*7/3)
15.666666666666666
>>> print(4+5*7//3)
15
>>> print(num1**num2)
4.897788193684476e+24
>>> input()
print(input())
'print(input())'
>>> num3=input(num1**num2)
4.897788193684476e+24
>>> print(num3)
>>>
>>>
>>> input('Type some word' )
Type some word this is the sentence I gave to validate input function in python
' this is the sentence I gave to validate input function in python'
>>>