0% found this document useful (0 votes)
28 views

class2_22i272

Uploaded by

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

class2_22i272

Uploaded by

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

OPERATING SYSTEM

LAB REPORT-2

EXERCISE - 2 VIMALATHITHAN D
07.02.2024 22I272

AIM:
To implement the UNIX commands.
COMMANDS:
1. uptime Command:

Show how long the system has been running.

2. reboot Command:

Reboot the system

3. date Command:

Display the current date and time in the default format.


4. date in a specific format:

to display the date in the format YYYY-MM-DD.

5. Set System Date and Time:

You can set the system date and time using the -s option followed by the desired date
and time.

6. Display Time in UTC:

To display the current time in Coordinated Universal Time (UTC).

7. Display Date and Time in a specific Timezone:

You can specify a timezone using the TZ environment variable.

8. Display Day of the week:

To display the day of the week along with the date.


9. Display Time in 12-Hour Format:

To display the current time in 12-hour format with AM/PM indication.

10. lslogins:

Display all login.


11. history Command:

To display the history.

12. Display Time in Unix Timestamp:

To display the current time in Unix timestamp format (number of seconds since January
1, 1970, 00:00:00 UTC).
13. Display Date and Time with Timezone Offset:

To display the current date and time along with the timezone offset.

14. Display Date and Time in ISO 8601 Format:

To display the current date and time in ISO 8601 format with timezone information.

15. Display Date and Time of a specific File:

To display the last modification time of a specific file.

16. Calculate Future or Past Dates:

You can calculate future or past dates by adding or subtracting days.

17. Display Date in Julian Day Format:

To display the current date in Julian day format.


18. Display date in week number format:

To display the current week number of the year

19. Display Time in nanoseconds:

To display the current time in nanoseconds

20. Display Date and time in RFC 2822 Format:

To display the current date and time in RFC 2822 format

21. Display Date and Time in RFC 3339 Format:

To display the current date and time in RFC 3339 format (ISO 8601 extended format).

22. Display date and time in seconds since the Epoch:

To display the current date and time in seconds since the epoch (January 1, 1970).
23. Display date and time in a Custom Format:

You can create custom date and time formats using various format specifiers.

24. Display time in different times zones:

To display the current time in a particular location.


25. Display date and time in UTC:

To display the current date and time in Coordinated Universal Time (UTC).

26. Display time in hours,minutes and seconds only:

To display the current time without the date.

27. Display date and time in seconds with nanoseconds:

To display the current date and time with seconds and nanoseconds.
28. Display day of the year:

To display the day of the year (1-365 or 1-366 for leap years).

29. Display week number with week starting on Sunday or Monday:

To display the week number with the week starting on Sunday or Monday.

30. Display date and time in a specific format with timezone:

To display the date and time in a custom format with a specific timezone.

31. Display day of the week:

To display the day of the week.


32. Display Abbreviated Month name:

To display the abbreviated month name.

33. Display date and time in RFC 2822 format with Timezone:

To display the date and time in RFC 2822 format with timezone.

34. year Command:

To display the present year.

35. w Command:

This command tells about the users who are logged in and what are they doing.

36. usage Command:

Displays the short information about the whatis command.


37. man -aw Command:

List all available sections of a command.

38. sort Command:

The sort command is used to sort files in alphabetical order.

39. id Command:

This command basically prints the information of real and effective user or in other
words the current user.

40. printf Command:

Format and print data.


41. nano Command:

A simple command-line text editor.


42. vi Command:

A classic text editor with modes for insertion and command.


43. pico Command:

A simple text editor similar to ‘nano’.


44. xdg-open Command:

Open a file using the default application associated with its MIME type.

45. mcedit Command:

The text editor included in the Midnight Commander file manager.


46. ex Command:

A line-oriented text editor, similar to vi but with a different interface.

47. tail Comment:

The best use case of tail in my opinion is when called with the -f option. It opens the file at
the end, and watches for file changes. Any time there is new content in the file, it is printed
in the window.
48. who Comment:

The who command displays the users logged in to the system.

49. whoami Comment:

Type whoami to print the user name currently logged in to the terminal session.

50. which Comment:

The Linux which command is used to locate the executable files or location of a program
from the file system.

You might also like