In: Computer Science
Using Linux in VirtualBox
To display your system date:
You might see the abbreviation EDT (Eastern Daylight Time) instead of EST (Eastern Standard Time), or another time zone abbreviation, such as MDT (Mountain Daylight Time) or CST (Central Standard Time). Notice also that UNIX/Linux uses a 24-hour clock.
The system error message appears because you must enter the date command, like most Linux commands, in lower-case letters.
To display your system date in UTC:
Using the cal command
In this, you use the cal command to display the current calendar, a Julian date calendar, and the historical calendar for July 1776.
To use the cal command:
Using the who command
The who command is valuable for determining who is currently logged in to a system. In this, you try out the who command using several options.
To use the who command to determine who is logged in to the system:
In case any current users are logged in from a remote host, the COMMENT column shows the name of the host.
Below is the solution:
When type the date command to the terminal seen the date of the current with the time in IST.
When i typed the Date command in terminal the It will work fine as date command in mac os.
Example:
JohnDoe$ date
Tue Sep 3 12:08:39 IST 2019
JohnDoe$ Date
Tue Sep 3 12:09:40 IST 2019
date -u command will show the date in UTC.
JohnDoe$ date -u
Tue Sep 3 06:41:49 UTC 2019
cal command will display the calendar with selected current date
JohnDoe$ cal
September 2019
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
cal -j 2018 command will shoe the calendar of 2018 from
january
JohnDoe$ cal -j 2018
2018
January
February
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
1 2
3 4 5
6
32 33 34
7 8 9 10 11 12 13 35 36 37 38
39 40 41
14 15 16 17 18 19 20 42 43 44 45 46 47 48
21 22 23 24 25 26 27 49 50 51 52 53 54 55
28 29 30
31
56 57 58
59
March
April
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
60 61 62 91 92 93 94 95 96 97
63 64 65 66 67 68 69 98 99 100 101 102 103 104
70 71 72 73 74 75 76 105 106 107 108 109 110 111
77 78 79 80 81 82 83 112 113 114 115 116 117 118
84 85 86 87 88 89 90 119
120
May
June
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
121 122 123 124
125
152 153
126 127 128 129 130 131 132 154 155 156 157 158 159 160
133 134 135 136 137 138 139 161 162 163 164 165 166 167
140 141 142 143 144 145 146 168 169 170 171 172 173 174
147 148 149 150
151 175 176
177 178 179 180 181
July
August
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
182 183 184 185 186 187
188
213 214 215 216
189 190 191 192 193 194 195 217 218 219 220 221 222 223
196 197 198 199 200 201 202 224 225 226 227 228 229 230
203 204 205 206 207 208 209 231 232 233 234 235 236 237
210 211
212
238 239 240 241 242 243
September
October
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
244 274 275 276 277 278 279
245 246 247 248 249 250 251 280 281 282 283 284 285 286
252 253 254 255 256 257 258 287 288 289 290 291 292 293
259 260 261 262 263 264 265 294 295 296 297 298 299 300
266 267 268 269 270 271 272 301 302 303
304
273
November
December
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
305 306
307
335
308 309 310 311 312 313 314 336 337 338 339 340 341 342
315 316 317 318 319 320 321 343 344 345 346 347 348 349
322 323 324 325 326 327 328 350 351 352 353 354 355 356
329 330 331 332 333 334 357 358 359
360 361 362 363
364
365
cal 7 1776 will display the calendar of july 1776
JohnDoe$ cal 7 1776
July
1776
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
31
cal july 1776 will also display the calendar of july 1776
same as cal 7 1776
JohnDoe$ cal 7 1776
July
1776
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 31
who command will display the currently logged on to the system.
JohnDoe$ who
JohnDoe console Sep 3 12:07
JohnDoe ttys000 Sep 3 12:07
who -H will display the logged user with the information where the user logged in and when.
JohnDoe$ who -H
USER
LINE
WHEN
JohnDoe console Sep 3 12:07
JohnDoe ttys000 Sep 3 12:07
who -q will display the number of user logged into the system.
JohnDoe$ who -q
JohnDoe JohnDoe
# users = 2
who am i command will display the current using logged in user with date and time.
JohnDoe$ who am i
JohnDoe ttys000 Sep 3 12:07
whoami command will only display the name of the user who is logged in.
JohnDoe$ whoami
JohnDoe
who mom likes command will also display the currently logged in user with the date and time.
JohnDoe$ who mom likes
JohnDoe ttys000 Sep 3 12:07