Linux Prac 2
Linux Prac 2
12
2) Find out the users who are currently logged in and find the particular user too.
Ans -
who: Lists users currently logged in.
who | grep <username>: Finds information about a specific user.
3) Display the calendar for
cal: Displays a calendar.
date "+%a, %b %d %Y": Shows the current date with day abbreviation, month abbreviation,
and year.
a. Jan 2024
25/02/24LINUX OPERATING SYSTEM PRACTICAL 02ROLL NO. 12
b. Feb 2025
date "+%a, %b %d %Y": Shows the current date with day abbreviation, month abbreviation,
and year
9) Change to SAMPLE.
Ans-
12) Using a single command change from current directory to home directory.
Ans-
13) Create files myfile and yourfile under Present Working Directory.
Ans-
touch myfile yourfile: Creates empty files named myfile and yourfile.
ls myfile yourfile: Lists the files myfile and yourfile in the current directory.
15) Can you remove a directory with files by using a single command?
Ans-