Other Commands
Other Important Commands
These are commands that I feel are important for us to learn about, but do not fit into any of the other categories. Think of this is a catch all for other important commands. Just because they are not in a major category, they are still important to learn. These are covered in the Session Videos that I have posted. Please review those videos for detailed explanations. Also, I have provided short demos of the commands, short explanation and other resources below.
chown
The chown command (change ownership) is used to change the own of files and/or directories.
uptime
Very simple command. All this does is displays the time since the last system boot.
https://linux.die.net/man/1/uptime
history
Linux keeps track of the commands you have issued on the command line by storing this information in a file called .bash_history (in a users home directory). This information can be easily viewed using the history command.
https://linux.die.net/man/3/history
https://www.gnu.org/software/bash/manual/html_node/Bash-History-Facilities.html
https://www.howtoforge.com/linux-history-command/
History is not timestamped by default, and that can be a bit annoying to see when you last ran the command. This is an easy solution to add timestamps to the history output.
https://www.cyberciti.biz/faq/unix-linux-bash-history-display-date-time/
Keep in mind that if you change your shell from a bash shell the history file will most likely change.
env
This command has two usages. The first one (as can be seen in the video) is to print a list of the environmental variables. The other use is to run a program in a different environment (basically, so you don't have to mod the current system).
https://linux.die.net/man/1/env
echo
The echo command has a couple uses. The first is to just display any text that is provided as an argument to the command. The second is to display the value of environmental variables. The final use is within shell scripts to print information to the screen (we will learn about the other two later).
https://linux.die.net/man/1/echo
grep, egrep & fgrep
The grep command has the ability to search through plain text for lines of text that match a regular expression.
egrep works the same as grep -E
fgrep works the same as grep -F
https://linux.die.net/man/1/grep
https://www.makeuseof.com/grep-command-practical-examples/
https://www.geeksforgeeks.org/egrep-command-in-linux-with-examples/
https://www.geeksforgeeks.org/fgrep-command-in-linux-with-examples/
ln
The ln command provides the ability to create links within the Linux filesystem. There are two types of links: hard and soft. It is important to understand how these differ.
https://devconnected.com/understanding-hard-and-soft-links-on-linux/
file
The file command provides you with information about the type of file (text/binary/image/movie/etc.). This is useful as you should not always rely on the file extension to determine the file type!