Chapter 1 - Exploring Linux Command-Line Tools Flashcards
What shell is not often used and is often a pointer to the bash shell or other shells?
page 4
sh
What shell is based on the earlier Bourne shell for Unix but extends it in several ways, and is the common default shell for user accounts?
page 4
bash
What was the original C shell and isn’t used much in Linux?
page 5
csh
Which shell is similar to bash in many respects, but some operational details differ and no major Linux distributions make it the default shell?
page 5
tcsh
Which shell was designed to take the best features of the Bourne shell and the C shell and extend them, but has a small but dedicated following among Linux users?
page 5
ksh
Which shell takes shell evolution further than the Korn shell, incorporating features from earlier shells and adding still more?
page 5
zsh
What is the difference between “default interactive shell” and “default system shell”?
page5
- default interactive shell - shell program a user uses to enter commands, run programs from the command line.
- default system shell - is used by the Linux system to run system shell scripts, typically at startup.
Which command are built-in and likely use enables you to perform some common tasks
page 6
Internal Commands
What internal command displays the text you enter
page 7
echo
To terminate the shell, which command(s) will accomplish it?
page 7
exit or logout
How does”command completion” work?
page 9
type part of a command or filename and then press the tab key, the shell tries to fill the rest of the command or file.
Which shell command keeps a record of every command you type?
page 10
history
How do you Retrieve a Command?
page 10
Press the Up Arrow Key, if you over shoot, press the Down Arrow Key,
Ctrl+P and Ctrl+N keystrokes double for the Up and Down Keys
To keep your terminal from hanging what do you do?
page 10
type stty -ixon
When you want to move within a line what different commands can you type?
page 10 Ctrl+A for Start of the line Ctril+E for End of the line Left Arrow for 1 character at a time Right Arrow for 1 character at a time Ctrl+B for moving Backward Ctrl+F for moving Forward
If you want to launch a full-fledge editor, what keys do you press?
page 11
Ctrl+X followed by Ctrl+E
What are Environment Variables?
page 13
They hold data to be referred to by the variable name.
To get text-based help, what command can you use?
page 15
man, which is short for manual.
Using “man” followed by the particular command, you can read about that particular command from the manual.
What are the Manual Sections?
page 16
- Executable programs and shell commands
- System calls provided by the kernel.
- Library calls provided by program libraries.
- Device files (usually stored in /dev)
- File formats.
- Games
- Miscellaneous (macro packages, conventions and so no)
- System administration commands
- Kernel routines
How does Linux treats the input to and output from programs?
page 16
Streams
Linux handles all objects files, to identify a particular file object, what file descriptors does Linux use?
page 17
STDIN - Standard input
STDOUT - Standard Output
STDERR - Standard Error
What command can be used to remove every file in a directory tree that belongs to a user?
page 20
xargs
basic syntax is:
xargs [options] [command [initial-arguments]]
What is the command’s short name for concatenate, and what does it do?
page 22
cat
links together an arbitrary number of files end to end and sends the result to standard output
How can you merge files line by line?
page 24
paste command
What command allows you break a file into pieces?
page 26 split split by bytes split by bytes in line-sized chucks split by number of lines
how do you delete Duplicate lines?
page 28
uniq
If you want to view only the tail end of files, which command do you use?
page 32
Tail
What are “regular expressions”
page 35
are similar in principle to the wildcards that can be used to specify multiple file names.
Two forms - basic and extended.
What command searches for files that contain a specified string and returns the name of the file and a line of context for that string?
page 36
grep