| Getting Started with Linux - Lesson 11 |
|---|
Miscellaneous commands
These might come in handy from time to time
'dir'
The people who traveled down the MS-DOS road will know this one.
Actually, dir=ls -l. It will give you the same result. If
you do any downloading or uploading of files via FTP by way of a non-GUI FTP program in your terminal, you may find this command useful. I once ran into a case where the remote computer didn't recognize the ls -l command. I just typed in dir and that did the trick. Then I fired off a nasty e-mail asking why in the world they weren't using Linux!
'pwd'
The command pwd will show complete information on the directory you're working in. For example, if you type pwd you may get something like this:
/home/bob/homework
which shows you that you're in the directory 'homework' in your user directory as 'bob', so you know exactly where you are.
'date'
Did you forget your wedding aniversary? Your boyfriend or girlfriend's birthday? Tax day? (everyone wants to forget that one!) No need for that to happen anymore with Linux. Just type:
date
You'll get this: (or something like it, actually. If you get the same thing as I do, then I'd consider buying lottery tickets)
Thu Sep 7 20:34:13 CEST 2000
You probably get everything here. If you're living in central Europe, you will recogize the 'CEST' part. That stands for 'Central European Standard Time'. Linux recognizes world time zones and you set this up when you installed Linux. If you live on Mars, you're out of luck, unfortunately.
There are other uses of the 'date' command. To see just the date, type:
date +%D
To see just the time, type:
date +%T
To see on what day Christmas falls this year (really, I'm not kidding!), type:
date --date 'Dec 25'
and you'll get the day that Christmas falls on this year. Substitute that for any date that you'd like to see.
There are many other options. Consult your manual file ('man date') or ('info date')
'cal'
Typing cal will give you the calendar of the present month on your screen, in the nice standard calendar format. There are a lot of useful options.
If you type:
cal 2000
You'll get the entire calendar for the year 2000. Substitute any year you like.
If you type:
cal 12 2000
You'll see the calender for December of 2000. Substitute any year or month you like.
If you add the option cal -m, the week will start on Monday, as it is preferred in many countries.
Just for fun, I typed cal 10 1492 and I found out that Columbus discovered America on a Friday. That was good luck for him because that way he got to relax for the weekend.
'exit'
As you can guess, you can get out of a terminal with the exit command. If you're working in text mode, typing exit will prompt you to login again. If you want to work as another user, use logout instead.
If you're in x-windows, exit will close the X-Terminal you're working with
exit with the option "stage right" will get you an error message.
[Previous] [Next]
|