The date Command
Duh, you type “date” and you get the date and time. However...
- The command can be used to set the system clock.
- The command allows arguments that will modify and format the output.
- Ex: date '+DATE: %m/%d/%y%nTIME:%H:%M:%S'
- Output:
- DATE: 07/05/14
- TIME:21:52:35
The ls Command
By default, ls lists names of every non-hidden item in the directory.
- -l long listing
- -R list everything in and under
- -a or -A list hidden as well (what is the difference?)
- -d DO NOT EXPAND DIRECTORIES
- -i show inode numbers
- -F append a character to items listed to show type
Who are we or who's on the system?
- who - lists everyone who is on the system.
- w- similar information as who but also gives idle time.
- finger - might not be available on all distros but gives different user information along with the idle time.
- who am i - gives expanded information about the users on the system.
- whoami - on some machines this might only give you a brief output.
Do you hear an echo?
The echo command is very important in scripts and become real essential. You can use the command to:
- Prompt users
- Explain output
The # (pound sign) denotes a comment follows. This is also important in scripts.
The wc Command
The wc command is useful for counting lines, words, bytes and characters. This is very useful for knowing things like how many people you may have in your etc/passwd file or how many files you have in a directory, etc.
- -l lines
- -w words
- -c bytes
- -m characters