Linux Internal Variables

What are they? They are builtin variables which hold information about the environment, the users and the system. There are two main types; shell (bash) and environmental. The scope of each is different. Shell variables are specific to the running shell and are not shared within other shells. On the

su apache: "This account is currently not available"

When trying to switch user to apache and you get the following: "This account is currently not available". You need to set a shell for the apache user. Let's say we want to use bash. # chsh -s /bin/bash apache You should get this prompt: Changing shell for apache. Shell

Examples of lftp

In this example we are changing directory to "output" and doing a listing of files: lftp -e 'set net:timeout 10;cd output/;ls; bye' -u USER,PASSWORD ftp.foo.com/ Here we are going to "output" and we transferring "myfile.txt" to our local /tmp directory. lftp -e 'set

Bash Shell Exit Status

Exit status codes are helpful when creating shell scripts with IF statements. They are also helpful when you are trying to troubleshoot the outcome of a command. You can use "echo $?" to find out the exit status. In the terminal exit codes are not displayed on the screen by default,

history command with date and timestamp

You can get a more detailed display of your bash history by including the date and timestamps. This can be done by defining an environmental variable. HISTTIMEFORMAT="%d/%m/%y %T" After defining this variable your bash history should look like this: 963 13/06/12 20:14:39 ls