More on this book
Community
Kindle Notes & Highlights
Over the years telnet has been replaced with Secure Shell, abbreviated SSH. SSH is, as its name implies, more secure than telnet. Telnet sends your login credentials over the network in plain text. SSH encrypts the communications between the client and the server, thus greatly improving security. If someone were to be packet snooping or eavesdropping on your connection, they would see garbled text and random characters.
The shell is nothing more than a program that accepts your commands and executes those commands. Said another way, the shell is a command line interpreter.
In two of the prompt examples you will notice a tilde (~). The tilde is a shorthand way of representing your home directory. In this example the tilde (~) is equivalent to /home/bob, which is Bob's home directory. This is called tilde expansion. A
Dir Description / The directory called "root." It is the starting point for the file system hierarchy. Note that this is not related to the root, or superuser, account. /bin Binaries and other executable programs. /etc System configuration files. /home Home directories. /opt Optional or third party software. /tmp Temporary space, typically cleared on reboot. /usr User related programs. /var Variable data, most notably log files.
cd [dir] - Changes the current directory to dir. If you execute cd without specifying a directory, cd changes the current directory to your home directory. This is how you navigate around the system.
man command - Displays the online manual for command. Type q to quit viewing the manual page. The documentation provided by the man command is commonly called "man pages."
The cd . command did not take you anywhere. Remember that . is "this directory" and .. is "the parent directory." Another shortcut for navigating directories is cd -. This command takes you to the previous directory. The environment variable that represents your previous working directory is OLDPWD. So, cd - and cd $OLDPWD are equivalent.
link is sometimes called a symlink, short for symbolic link. A link points to the location of the actual file or directory. You can operate on the link as if it were the actual file or directory. Symbolic links can be used to create shortcuts to long directory names. Another common use is to have a symlink point to the latest version of installed software as in this example.
You can add, subtract, or set permissions using user category and permission pairs. For example, if you want to add the write permission for the members of a file's group, you would specify chmod g+w file.
If you want to set the file to be just readable by everyone, run chmod a=r file. When you use the equal sign (=) the permission are set to exactly what you specify. If you specify just read, then only read will be available regardless of any existing permissions.
Work your way towards the root of the directory tree by running ls -ld .
The file creation mask is what determines the permissions a file will be assigned upon its creation. The mask restricts or masks permissions, thus determining the ultimate permission a file or directory will be given. If no mask were present directories would be created with 777 (rwxrwxrwx) permissions and files would be created with 666 (rw-rw-rw-) permissions. The mask can and is typically set by the system administrator, but it can be overridden on a per account basis by including a umask statement in your personal initialization files.
Using a umask of 002 is ideal for working with members of your group. You will see that when files or directories are created the permissions allow members of the group to manipulate those files and directories.
Here is another possible umask to use for working with members of your group. Use 007 so that no permissions are granted to users outside of the group.
There is a class of special modes. These modes are setuid, setgid, and sticky. Know that these special modes are declared by prepending a character to the octal mode that you normally use with umask or chmod. The important point here is to know that umask 0022 is the same as umask 022. Also, chmod 644 is the same as chmod 0644.
the above examples ls -lF /opt/apache > files.txt is the same as ls -lF /opt/apache 1> files.txt. Also, sort < files.txt is the same as sort 0< files.txt. Do not use a space between the file descriptor number and the redirection operator. The file descriptor must immediately precede the redirection operator, otherwise it will be interpreted as another item on the command line.
crontab - A program to create, read, update, and delete your job schedules. A crontab (cron table) is a configuration file that specifies when commands are to be executed by cron. Each line in a crontab represents a job and contains two pieces of information: 1) when to run and 2) what to run. The time specification consists of five fields. They are minutes, hour, day of the month, month, and day of the week. After the time specification you provide the command to be executed.

