Term
| in the shell what are the two types of variables |
|
Definition
| local and environment(AKA global) |
|
|
Term
| In the shell, what type of variable can't be passed to a sub-shell |
|
Definition
| local variables are limited to the current shell |
|
|
Term
| In the shell, what type of variable can't be passed to a sub-shell |
|
Definition
| local variables are limited to the current shell |
|
|
Term
| what is a global variable |
|
Definition
| an environment variable, can be passed from the current process or shell to a child process or shell |
|
|
Term
| set a global variable V1 to "college" |
|
Definition
export V1=college or V1=college; export V1 |
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
| set a local variable V1 to college |
|
Definition
|
|
Term
| set V2 global variable to "a lovely bunch of coconuts" |
|
Definition
export V2="a lovely bunch of coconuts" or V2="a lovely bunch of coconuts"; export V2 |
|
|
Term
| set local variable V2 to "gabba gabba" |
|
Definition
|
|
Term
| variable V2 was set, undo this |
|
Definition
|
|
Term
| set environment variable V2 to "hey hey" |
|
Definition
export V2="hey hey" or V2="hey hey"; export V2 |
|
|
Term
| pre-defined environment variable |
|
Definition
| defined by the shell at login |
|
|
Term
| pre-defined environment variable DISPLAY |
|
Definition
| stores the hostname or IP address to display graphics |
|
|
Term
| pre-defined environment variable HISTFILE |
|
Definition
| where the command history is saved |
|
|
Term
| pre-defined environment variable HISTSIZE |
|
Definition
| defines the maximum size of the histfile |
|
|
Term
| pre-defined environment variable HOME |
|
Definition
|
|
Term
| pre-defined environment variable LOGNAME |
|
Definition
|
|
Term
| pre-defined environment variable MAIL |
|
Definition
| mail directory path, ex: /var/spool/mail/user1 |
|
|
Term
| pre-defined environment variable PATH |
|
Definition
| the command paths, shown separated by colons |
|
|
Term
| pre-defined environment variable PS1 |
|
Definition
| primary command prompt - default for root is # |
|
|
Term
| pre-defined environment variable PS2 |
|
Definition
| secondary command prompt - default is > |
|
|
Term
| pre-defined environment variable PWD |
|
Definition
| stores the current directory location |
|
|
Term
| pre-defined environment variable SHELL |
|
Definition
| holds the absolute path of the primary shell |
|
|
Term
| pre-defined environment variable TERM |
|
Definition
| hold the terminal type value |
|
|
Term
| why should variables be in upper case |
|
Definition
| so they don't conflict with commands |
|
|
Term
| change the primary command prompt be the current directory |
|
Definition
| export PS1="<$PWD>" - test this |
|
|
Term
| set PS1 to include logname, hostname, and PWD |
|
Definition
| export PS1="<$LOGNAME@$HOSTNAME:\$PWD>" |
|
|
Term
What is the symbol for stdin? What is the digit for stdin? |
|
Definition
|
|
Term
what is the symbol for stdout? and digit for stdout? |
|
Definition
|
|
Term
| standard out, what is the file descriptor, symbol, and digit? |
|
Definition
|
|
Term
| standard in, what is the file descriptor, symbol, and digit? |
|
Definition
|
|
Term
| standard error, what is the file descriptor, symbol, and digit? |
|
Definition
|
|
Term
| what is the symbol and digit of stdout? |
|
Definition
|
|
Term
what is the symbol for stderr? and digit for stderr? |
|
Definition
|
|
Term
| use input redirection to send file1 to user2 using mailx |
|
Definition
|
|
Term
| sort file1 and send it to sort.out |
|
Definition
|
|
Term
| sort file1 and append it to sort.out |
|
Definition
|
|
Term
| ls /etc and /cdr redirect output to file1 but don't show the error for the made-up /cdr directory |
|
Definition
ls /etc /cdr 1>file1 2>&1 or ls /etc /cdr &>file1 |
|
|
Term
| you hit up-arrow and want to take that to vi. What do you have to do first. And how is it done |
|
Definition
set -o vi up-arrow, to the command esc, then v takes it into vi |
|
|
Term
| display the last 20 commands you entered |
|
Definition
|
|
Term
| re-execute a command by line number 17 |
|
Definition
|
|
Term
| reenter the last command that started with a ch , two answers |
|
Definition
|
|
Term
| repeat the last command, two answers |
|
Definition
|
|
Term
|
Definition
| create shortcuts for lengthy commands |
|
|
Term
| make is so that when you enter cp it really runs cp -i |
|
Definition
|
|
Term
| what command to unset an alias |
|
Definition
|
|
Term
| show all the current aliases |
|
Definition
|
|
Term
| make it so that every time you run rm it prompts you before removing a file |
|
Definition
|
|
Term
|
Definition
| use ~ for $HOME, the current user's home directory |
|
|
Term
| echo ~+ , what do you get |
|
Definition
| $PWD, the current directory |
|
|
Term
| echo ~- , what do you get |
|
Definition
|
|
Term
| echo ~user2 , what do you get |
|
Definition
| the home directory of user2 |
|
|
Term
| display the previous directory |
|
Definition
|
|
Term
| display the home directory of user2 |
|
Definition
|
|
Term
| display the current directory using the tilde |
|
Definition
|
|
Term
| list files file1, file2, file3, and file4 in one command, don't list fileindex.txt |
|
Definition
|
|
Term
| ls [af]* , what does this mean |
|
Definition
| list files that start with a or f |
|
|
Term
| list files that start with a through f |
|
Definition
|
|
Term
| put multiple commands on the same line, how |
|
Definition
put a semicolon in between ; |
|
|
Term
| cd to your home directory and show the contents, put the commands on one line |
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
remove a file named * three answers |
|
Definition
|
|
Term
|
Definition
|
|
Term
| what is the difference between echo '$HOME' and echo "$HOME" |
|
Definition
echo '$HOME' displays $HOME echo "$HOME" displays /home/username |
|
|
Term
| what three characters will not lose special meaning if put in double quotes |
|
Definition
|
|
Term
| split the output of "ll /etc" to number the lines on the screen, and put that in /tmp/ll.out |
|
Definition
| ll /etc | nl | tee /tmp/ll.out |
|
|
Term
|
Definition
| puts the output in more than one destination |
|
|
Term
|
Definition
| tee file.out pipe the output to a file and also to the screen |
|
|
Term
|
Definition
| used to extract columns from a file |
|
|
Term
| cut /etc/group use : as the delimiter, show fields 1 and 4 |
|
Definition
|
|
Term
| show columns 1 and 5 from /etc/passwd |
|
Definition
| cut -d: -f1,5 /etc/passwd |
|
|
Term
|
Definition
| pr filter, prints a file, formats and displays text file output. |
|
|
Term
| print starting at page two /etc/group |
|
Definition
|
|
Term
| print /etc/group and /etc/passwd side by side in separate columns |
|
Definition
| pr -m /etc/group /etc/passwd |
|
|
Term
| print /etc/group add line numbers |
|
Definition
|
|
Term
| print /etc/group with the header "my file" |
|
Definition
| pr -h "my file" /etc/group |
|
|
Term
| print /etc/passwd in two columns with double line spacing |
|
Definition
|
|
Term
| run what, but display everything in uppercase |
|
Definition
|
|
Term
| run what, but leave one space removing the extra spaces |
|
Definition
|
|
Term
|
Definition
| tr filter, translate, sqeeze, or delete characters from standard input |
|
|
Term
| show /etc/passwd but don't display any numbers |
|
Definition
| cat /etc/passwd | tr -d '[0-9]' |
|
|
Term
| tr, squeeze all the extra spaces out the the w output |
|
Definition
|
|