[go: up one dir, main page]

0% found this document useful (0 votes)
15 views17 pages

Assignment_01_sol (1)

Linux assignment

Uploaded by

abisab007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views17 pages

Assignment_01_sol (1)

Linux assignment

Uploaded by

abisab007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Linux Assignment 01

Below are few commands you need to run on your Linux terminal. After running them observe their
output and check the command man page. Take a screen shot of the output and create word file to
submit your assignment.

1. echo hello world


Ans: The “echo” command helps us to move some text into a file and display what we pass

an argument.

2. Passwd

Ans : The “passwd” command in Linux is used to change the password of system users.
Passwd command options:
-a, --all password status on all accounts
-d, --delete delete the password
-e, --expire force expire
-h, --help display help messeage
-l, --lock lock the password
-q, --quiet quiet mode

-s, --status password status


3. date

Ans: The “date” command in Linux is used to display the system date and time. The “date”
command is also used to set date and time of the system.

4. hostname

Ans: The “hostname” command in linux is used to obtained the DNS (Domain Name System)
name and set the system's hostname. A hostname is a name which is given to a
computer and it attached to network.

5. Arch

Ans: The “arch” command in Linux is used to print the computer architecture. For example:

i386, i489, x84_64 etc.


6. uname -a

Ans : The “uname -a” is used to print basic system information. It is usually invoked with the -
a option to display all available information.

7. dmseg|more

Ans: dmesg command reads the messages generated by the kernel from the virtual file.
Dmesg stands for “display message or display driver”. We can use text manipulation
tools i.e. 'more', 'tail' or 'grep' with dmesg command.
8. Uptime

Ans: with the help of the uptime command, we can check the running time of your system.
Along with the system's running time, we can also get additional details of the system
that includes the current time, count of users with running sessions.

9. who am I

Ans: The “whoami” command in Linux is used to display the username of the current user
when this command is invoked.
10. Who

Ans: The “who” command is used to get information about currently logged in user on to
system

11. id

Ans: The “id” command is used to print the genuine and effective user ID and group ID. A
user ID is a particular user identity, whereas group IDs can contain more than one user's
identity.
12. Last

Ans: The last command displays information about the last logged-in users. It is convenient
when we need to track login activities or investigate a possible security breach.
13. W

Ans: w is a command-line utility that displays information about currently logged in users and
what each user is doing. It also gives information about how long the system has been
running, the current time, and the system load average.
14. Top

Ans: top command is used in Linux to show the Linux processes. It provides a dynamic real-
time view of the running system. Usually, this command shows the summary
information of the system and the list of processes or threads.
PID: Shows unique process id.
PR: Priority of the task.
SHR: Represents the amount of shared memory used by a task.
VIRT: Total virtual memory used by the task.
USER: User name of owner of task.
%CPU: Represents the CPU usage.
TIME+: CPU Time.
NI: Represents a Nice Value of task. A Negative nice value implies higher priority,
and positive Nice value means lower priority.
%MEM:Shows the Memory usage of task.
15. echo $SHELL

Ans: $: $ sign is used in the shell to retrieve the value of variables.


Echo: echo command is used to print the text or string to the shell or output file.
16. echo {con, pre}{sent, fer}{s,ed}

17. man “automatic door”

18. finger

19. man ls

Ans: man command in Linux is used to display the user manual of any command that we can
run on the terminal.
There are options:
-f option: One may not be able to remember the sections in which a command is
present. So this option gives the section in which the given command is
present.
-a option: This option helps us to display all the available intro manual
pages in succession.
-k option: This option searches the given command as a regular expression in all
the manuals and it returns the manual pages with the section number in
which it is found.
-w option: This option returns the location in which the manual page of a
given command is present.
-I option: It considers the command as case sensitive.

20. man who

Ans: The who command is used to get information about currently logged in user on to
system.
21. Lost

22. clear

Ans: It used to clear terminal.


23. Cal 2000

Ans: It gives us the calendar of the year 2000

24. cal 9 1752

Ans: It gives us the calendar of the 9th month that is September of the year of 1752.
25. time sleep 6

Ans: the sleep command pauses the execution of the next command for a given number of
seconds.

26. bc -l

Ans: bc command is used for command line calculator. It is similar to basic calculator by using
which we can do basic mathematical calculations.
Options:
-h, {- -help } : Print the usage and exit
-i, {- -interactive } : Force interactive mode
-l, {- -mathlib } : Define the standard math library
-w, {- -warn } : Give warnings for extensions to POSIX bc
-s, {- -standard } : Process exactly the POSIX bc language
-q, {- -quiet } : Do not print the normal GNU bc welcome
-v, {- -version } : Print the version number and copyright and quit
27. history

Ans: history command is used when we want to view the previously executed command in
terminal
28. yes please

Ans: The output of yes command is print same string in constant stream.

29. echo 5+4| bc -l

You might also like