More on this book
Community
Kindle Notes & Highlights
sftp> pwd Remote working directory: /home/bob
sftp> lpwd Local working directory: /tmp
sftp> lls file1.txt
If FTP is not enabled, you will see a "Connection refused" error message.
The contents of .profile or .bash_profile are only executed for interactive sessions.
You can save yourself some hassle by making your interactive and non-interactive sessions behave the same. To do this, configure .bash_profile to reference .bashrc and put all of your configuration in .bashrc.
$ cat .bash_profile # Put our settings in .bashrc so we have the same environment for login and non-login shells. if [ -f ~/.bashrc ]; then source ~/.bashrc fi
# - Octothorpe. Also known as a hash, square, pound sign, or number sign. This symbol precedes comments.
!N - Repeat command line number N.
!! - Repeat the previous command line.
!string - Repeat the most recent command startin...
This highlight has been truncated due to consecutive passage length restrictions.
If you want to execute the second to last command type !-2.
the greater-than symbol (>) in the above example. It is the secondary prompt string and can be customized by changing the PS2 environment variable.
The variables that are not exported are called local variables.
Processes that are backgrounded still execute and perform their task, however they do not block you from entering further commands at the shell prompt.
Ctrl-c - Kill the foreground process.
Ctrl-z - Suspend the foreground process.
$ ./long-running-program & [1] 22686 $ ps -p 22686
When a command is backgrounded two numbers are displayed. The number in brackets is the job number and can be referred by preceding it with the percent sign.
The plus sign (+) in the jobs output represents the current job while the minus sign (-) represents the previous job. The current job is considered to be the last job that was stopped while it was in the foreground or the last job started in the background. The current job can be referred to by %% or %+. If no job information is supplied to the fg or bg commands, the current job is operated upon. The previous job can be referred to by %-.
To bring a job back to the foreground, type the name of the job or use the fg command. To foreground the current job execute %%, %+, fg, fg %%, fg %+, or fg %num. To foreground job number 3, execute %3 or fg %3.
You can stop or kill a background job using the kill command. For example, to kill job number 1 execute kill %1. To kill a job that is running in the foreground, type Ctrl-c.
The default signal used by kill is termination. You will see this signal referred to as SIGTERM or TERM for short. Signals have numbers that correspond to their names. The default TERM signal is number 15. So running kill pid, kill -15 pid, and kill -TERM pid are all equivalent. If a process does not terminate when you send it the TERM signal, use the KILL signal which is number 9.
Every minute the cron service checks to see if there are any scheduled jobs to run and if so runs them.
If you want to run a job every minute for the first four minutes of the hour you can use this time specification: 0-4 * * * * command.
If no arguments are supplied to su, it assumes you are trying to become the superuser. Executing su is the same as executing su root.
bob@linuxsvr:~$ su -c 'echo $ORACLE_HOME' - oracle Password: /u01/app/oracle/product/current
The output of sudo -l displays what commands can be executed with sudo and under which account. In the above example, sudo will not prompt for a password for the commands preceded with NOPASSWD.
The package manager uses a package's metadata to automatically install the dependencies. Package managers keep track of what files belong to what packages, what packages are installed, and what versions of those packages are installed.
The Debian and Ubuntu distributions use a package manager called APT, the Advanced Packaging Tool. APT is comprised of a few small utilities with the two most commonly used ones being apt-cache and apt-get.
apt-get remove package - Remove/uninstall package, leaving behind configuration files. apt-get purge package - Remove/uninstall package, deleting configuration files.
The Linux kernel handles the interactions between the software running on the system and the hardware.
If your goal is to eventually become a Linux system administrator, focus on CentOS or Ubuntu.
CentOS is a Red Hat Enterprise Linux (RHEL) derivative. As a general rule, CentOS and RHEL are often found in corporate environments. Ubuntu is popular with startups and smaller companies that run their operations in the cloud.

