General Flashcards
list the common shells
bash #The GNU Bourne Again Shell
sh #The Bourne shell upon which bash is based
tcsh #This shell is based on the earlier C shell
csh #The original C shell
ksh #The Korn shell; bourne shell+c shell+extended
zsh #The Z shell takes shell evolution further than the Korn shell
what is an internal command
a command that is built into the shell program
what is an external command
a command that is not built into the shell program
how do you reverse search for a command in your history
ctrl+r
how do you search for a command in your history
ctrl+s
how do you terminate a search through your command history
ctrl+g
how do you move your shell cursor to the beginning of the line
ctrl+a
how do you move your shell cursor to the end of the line
ctrl+e
how do you move the shell cursor back one character
Ctrl+b
how do you move the shell cursor forward one character
Ctrl+f
how do you delete the character under the shell cursor
Ctrl+d
how do you delete all text from the shell cursor to the end of the line
ctrl+k
how do you delete all of the text from the shell cursor to the beginning of the line
Ctrl+x and then Backspace
how do you transpose the character before the cursor with the character under the shell cursor
ctrl+t
how do you transpose the two words immediately before (or under) the shell cursor
Esc and then t
how do you convert text from the shell cursor to the end of the word to uppercase.
Pressing Esc and then u
how do you convert text from the cursor to the end of the word to lowercase
Esc and then l
how do you convert the letter under the cursor (or the first letter of the next word) to uppercase; leaving the rest of the word unaffected.
Esc and then c
how do you launch a full-fledged editor to edit a command at the shell
Ctrl+x followed by Ctrl+e
how do you set an enviornment variable
VARNAME=VALUE
how do you save an environment variable across sessions
export VARNAME
how do you set and save an environment variable across sessions
export VARNAME=VALUE
what is man section 1
Executable programs and shell commands
what is man section 2
System calls provided by the kernel
what is man section 3
Library calls provided by program libraries
what is man section 4
Device files (usually stored in /dev )
what is man section 5
File formats
what is man section 6
Games
what is man section 7
Miscellaneous (macro packages; conventions; and so on)
what is man section 8
System administration commands (programs run mostly or exclusively by root )
what is man section 9
Kernel routines
what is stdin’s file descriptor
0
what is stdout’s file descriptor
1
what is stderr’s file descriptor
2
how do you specify all numbers and letters in the tr command
[:alnum:]
how do you specify all uppercase letters in the tr command
[:upper:]
how do you specify all lowercase letters in the tr command
[:lower:]
how do you specify all numbers in the tr command
[:digit:]
how do you specify a range of characters in the tr command
You can specify a range of characters by separating them with dashes ( - ); as in A-M
how do you move forward one screen in less
spacebar
how do you move back one screen in less
Esc followed by v
how do you do a search in less
/STRING
how do you do a backward search in less
?STRING
how do you move to the next search result in less
n
how do you move to the previous search result in less
N
how do you go to a specific line in less
gNUMBER
how do you display the help system in less
h
what are the extended regular express characters
? + | ( )
what is the windows newline
/r/n
what is the mac newline
/n
what is the linux newline
/n
how could you use tr to convert from windows to linux format line endings
tr -d \r < dosfile.txt > unixfile.txt
how could you use sed to convert from linux to windows line endings
sed “”s/$/\r/”” unixfile.txt > dosfile.txt
describe the naming convention of this rpm package: string-a.b.c-x.y.rpm
string = Package Name a.b.c = Version Number x = Build Number y = Architecture
How would you use rpm to install or upgrade package samba-4.1.9-4.fc20.x86_64.rpm from an RPM file that you have already downloaded to your local system
rpm -Uvh samba-4.1.9-4.fc20.x86_64.rpm
how would you query information on the installed package samba using rpm
rpm -qi samba
how would you convert samba-4.1.9-4.fc20.src.rpm to samba-4.1.9-4.fc20.src.cpio
rpm2cpio samba-4.1.9-4.fc20.src.rpm > samba-4.1.9-4.fc20.src.cpio
how would you extract samba-4.1.9-4.fc20.src.cpio
cpio -i –make-directories < samba-4.1.9-4.fc20.src.cpio