The beauty of shell scripting in Unix is that there are plenty of commands you can use to get useful output from and reuse it by assigning it to variables.
This section of the Unix Commands website contains such commands. Please contact me if you know of yet another extra-useful command to be included.
Files and directories
- pwd – confirm the current directory you're in
- dirname – extract the directory name from a full path to a file
- basename – strip directory and suffix from a full path to a file
System status and processes
- pgrep – find processes by name or other process attributes
- uname – print Unix system information
- date – getting current time and date in Unix (can also be used to set time)