Lab 1 Unix Himanshu Amity
Lab 1 Unix Himanshu Amity
Lab 1
himanshuamity@golusharma-VirtualBox:~$ uname
Linux
himanshuamity@golusharma-VirtualBox:~$ logname
himanshuamity
himanshuamity@golusharma-VirtualBox:~$ hostname
golusharma-VirtualBox
2. Find out the users who are currently logged in and find the particular user too.
himanshuamity@golusharma-VirtualBox:~$ who
January 2000
Su Mo Tu We Th Fr Sa
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
30 31
(ii) Feb 1999
February 1999
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
September 7
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 30
himanshuamity@golusharma-VirtualBox:~$ cal
September 2023
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 30
(v) Current Date Day Abbreviation , Month Abbreviation along with year
21/09/23
4. Display the time in 12-Hour and 24 Hour Notations.himanshuamity@golusharma-VirtualBox:~$ date '+24Hour:%T 12
Hour:w%1:%M;%S'
24Hour:22:36:18 12 Hour:w%1:36;18
himanshuamity@golusharma-VirtualBox:~$ pwd
/home/himanshuamity
himanshuamity@golusharma-VirtualBox:~/SAMPLE$ cd sample
himanshuamity@golusharma-VirtualBox:~/SAMPLE$ cd
12. Change from home directory to TRIAL by using absolute and relative pathname.
himanshuamity@golusharma-VirtualBox:~$ cd $home/TRIAL
himanshuamity@golusharma-VirtualBox:~$ cd SAMPLE
15. Using a single command change from current directory to home directory.
himanshuamity@golusharma-VirtualBox:~$ cd/SAMPLE/TRIAL
17. Create files myfile and yourfile under Present Working Directory.
himanshuamity@golusharma-VirtualBox:~$ cat>myfile
himanshuamity@golusharma-VirtualBox:~$ cat>yourfile
This is myfile
Add
^d
Add
^d
himanshuamity@golusharma-VirtualBox:~$ cat>.hide
hidden
^d
27. Append two more lines in emp file existing in TRIAL directory.
himanshuamity@golusharma-VirtualBox:~$ cd/SAMPLE/TRIAL
cat>>emp
himanshuamity@golusharma-VirtualBox:~/SAMPLE/TRIAL$ rm *
31. Can you remove a directory with files by using a single command.
himanshuamity@golusharma-VirtualBox:~/SAMPLE$ rm -r TRIAL
himanshuamity@golusharma-VirtualBox:~$ cp DATA/same/TRIAl
35. Create a file called dummy in TRIAL and link it to another file by name star.
36. Link the dummy file in TRIAL to another file by name power in DATA.
himanshuamity@golusharma-VirtualBox:~$ ln -s/SAMPLE/TRIAL/DATA/filename