Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

Unix Commands in Operating systems

Beoordeling
-
Verkocht
-
Pagina's
34
Geüpload op
30-12-2022
Geschreven in
2021/2022

In these notes, Covered all the topics of operating systems briefly. COs - Analyze the structure of OS and basic architectural components involved in OS design. Compare and contrast various CPU scheduling algorithms. Evaluate the requirements for the process synchronization and co-ordination in the contemporary operating system. Analyze various algorithms for memory management, I/O management and security aspects of operating system. Write shell scripts in Unix/Linux O.S and write simple programs using kernel system calls. Also understand virtualization concept

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

Unix Commands
1) cal:- Displays a calendar
Syntax:- cal [options] [ month ] [year]
Description :-
➢ cal displays a simple calendar. If arguments are not specified, the current month is
displayed. The switching options are as follows:
-1 Display single (current) month output. (This is the default.)
-3 Display prev/current/next month output
-s Display Sunday as the first day of the week (This is the default.)
-m Display Monday as the first day of the week
-j Display Julian dates (days one-based, numbered from January 1)
-y Display a calendar for the current year
Example:-
$cal
or
$cal 02 2016
Feb 2016

Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29

2) clear :- It clears the terminal screen.
Syntax :- clear
Description :-
➢ Clear clears your screen if this is possible, including its scroll back buffer.
➢ Clear ignores any command-line parameters that may be present.

3) pwd :- Displays path from root to current directory
Syntax :- pwd [options]
Example:
$ pwd
/home/kumar/progs


4) cd:- It is used to change the directory.
Syntax :- cd [directory]
Description:-

1

, Unix Commands
➢ Used to go back one directory on the majority of all UNIX shells. It is important
that the space be between the cd and directory name or ..
Example:-
$ pwd
/home/kumar
$ cd progs
$ pwd
/home/kumar/progs
$ cd ..
/home/kumar

5) ls:- Lists the contents of a directory
Syntax :- ls [options]
Description :-
-a Shows you all files, even files that are hidden (these files begin with a dot.)
-A List all files including the hidden files. However, does not display the working
directory (.) or the parent directory (..).
-d If an argument is a directory it only lists its name not its contents
-l Shows you huge amounts of information (permissions, owners, size, and when last
modified.)
-p Displays a slash ( / ) in front of all directories
-r Reverses the order of how the files are displayed
-R Includes the contents of subdirectories
Example:-
$ ls – l
-rw-r----- 1 student student 23 Jan 16 15:27 file1.txt
Field Explanation:
➢ If first character is – then it is normal file
➢ If it is d then it is directory
➢ Field 1 – File Permissions: Next 9 character specifies the files permission. Each 3
characters refers to the read, write, execute permissions for user, group and world
In this example, -rw-r—– indicates read-write permission for user, read permission
for group, and no permission for others.
➢ Field 2 – Number of links: Second field specifies the number of links for that file. In
this example, 1 indicates only one link to this file.
➢ Field 3 – Owner: Third field specifies owner of the file. In this example, this file is
owned by username ‘student’.
➢ Field 4 – Group: Fourth field specifies the group of the file. In this example, this file
belongs to ”student’ group.
➢ Field 5 – Size: Fifth field specifies the size of file. In this example, ’13′ indicates the

2

, Unix Commands
file size.
➢ Field 6 – Last modified date & time: Sixth field specifies the date and time of the
last modification of the file. In this example, ‘Jan 16 15:27′ specifies the last
modification time of the file.
➢ Field 7 – File or directory name: The last field is the name of the file or directory.
In this example, the file name is file1.txt


6) exit :- It is used to terminate a program, shell or log you out of a network normally.
Syntax :- exit

7) echo :- It prints the given input string to standard output.
Syntax :- echo string
Example:-
$ echo “hi.. hello unix”
hi.. hello unix

8) who :- who command can list the names of users currently logged in, their terminal, the
time they have been logged in, and the name of the host from which they have logged in.
Syntax :- who [options] [file]
Description:-
Print the username of the invoking user, The 'am' and 'i' must be space
am i
separated.
-b Prints time of last system boot.
-d print dead processes.
-H Print column headings above the output.
Include idle time as HOURS:MINUTES. An idle time of . indicates activity
-l
within the last minute.
-m Same as who am i.
-q Prints only the usernames and the user count/total no of users logged in.
Example :-
$ who
dietstaffpts/1 2016-02-20 22:42 (:0.0)
dietstaffpts/2 2016-02-20 09:30 (:0.0)
➢ Here first column shows user name, second shows name of the terminal the user
is working on. Third& fourth column shows date and time of logging, last column
shows machine name.

9) who am i:- Print effective userid
Syntax :- who am i

3

, Unix Commands
Description: - Print the user name associated with the current effective user id.
Example :-
$ who am i
dietstaffpts/3 2016-02-10 08:52 (:0.0)
➢ Here first column shows user name, second shows name of the terminal the user
is working on. Third & fourth column shows date and time of logging, last column
shows machine name.

10) mkdir:- This command is used to create a new directory
Syntax :- mkdir [options] directory
Description :-

-m Set permission mode (as in chmod)
-p No error if existing, make parent directories as
needed.
-v Print a message for each created directory
directory The name of the directory that you wish to
create
Example:-
$ mkdir aaa
➢ The above command will create directory named aaa under the current directory.
We can also create number of subdirectories with one mkdir command.

11) rmdir:- It is used to delete/remove a directory and its subdirectories.
Syntax :- rmdir [options..] Directory
Description :-
➢ It removes only empty directory.

-p Allow users to remove the directory and its parent directories which become
empty.

12) bc:- bc command is used for command line calculator. It is similar to basic calculator. By
using which we can do basic mathematical calculations.
Syntax :- bc [options]
Description :-
➢ bc is a language that supports arbitrary precision numbers with interactive
execution of statements.
➢ bc starts by processing code from all the files listed on the command line in the
order listed. After all files have been processed, bc reads from the standard input.
All code is executed as it is read.

4

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
30 december 2022
Aantal pagina's
34
Geschreven in
2021/2022
Type
College aantekeningen
Docent(en)
Ymk sir
Bevat
Alle colleges

Onderwerpen

$5.09
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
vaibhav51ppsv2020

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
vaibhav51ppsv2020 C.K.Pithawala school of engineering and techonology
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
3 jaar
Aantal volgers
0
Documenten
14
Laatst verkocht
-

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen