CompTIA Linux+ Certification XK0-006 Flashcards - Section 3: Shell Operations

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/69

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:30 PM on 8/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

70 Terms

1
New cards

Linux shell

A tool that lets users run programs, check files, and customize how the system works.

2
New cards

Environmental variables

Special variables used by the system, shell, or apps to store process-specific or session data.

3
New cards

$USER variable

The username of the person currently logged in.

4
New cards

View the $USER variable

echo $USER

5
New cards

$HOME variable

The user's home directory path.

6
New cards

View the $HOME variable

echo $HOME

7
New cards

$SHELL variable

The path to the current shell interpreter (e.g., /bin/bash).

8
New cards

PS1 variable

The appearance of the command prompt.

9
New cards

Escape sequences in PS1

\u: username, \h: hostname, \w: working directory, \$: prompt symbol ($ or #).

10
New cards

PATH variable

A list of directories that Linux searches to find executable programs.

11
New cards

Add a directory to PATH temporarily

export PATH=$PATH:/your/custom/dir

12
New cards

Make PATH changes permanent

Add them to ~/.bashrc or ~/.zshrc.

13
New cards

DISPLAY variable

Specifies where GUI programs send their output.

14
New cards

DISPLAY=:0.0

Local desktop session using display 0 and screen 0.

15
New cards

DISPLAY=localhost:10.0

Remote X forwarding session over SSH.

16
New cards

Absolute path in Linux

A complete address to a file/folder starting from the root (/).

17
New cards

Relative path in Linux

A file/folder address based on your current working directory.

18
New cards

~ in Linux paths

The current user's home directory.

19
New cards

Environment configuration files

Files like .bash_profile, .bashrc, .profile that define shell behavior.

20
New cards

.bash_profile

Loads user-specific variables when starting a Bash login session.

21
New cards

.bashrc

Runs for every interactive, non-login shell like opening a terminal.

22
New cards

.profile

General login session settings, especially for POSIX-compliant shells.

23
New cards

Input redirection (

Redirects a command's input from a file instead of the keyboard.

24
New cards

Here-document (<

Allows embedding a block of text directly in a script/command.

25
New cards

Here-string (<<

Sends a single string as input to a command.

26
New cards

Standard input (stdin)

Default method for commands to receive input (usually the keyboard).

27
New cards

Output redirection (> and >>)

> overwrites a file with output; >> appends output to a file.

28
New cards

stderr in Linux

A separate output stream used for error messages.

29
New cards

2> and 2>> in output redirection

Redirects stderr to a file (overwrite or append).

30
New cards

&>

Redirects both stdout and stderr to the same file.

31
New cards

History command

Shows previously run commands in current and past sessions.

32
New cards

!!

Repeats the last command entered.

33
New cards

!43 or !cmd

Re-runs a specific command by number or prefix from history.

34
New cards

alias in Linux

A shortcut for a longer command.

35
New cards

make an alias permanent

Add it to ~/.bashrc or ~/.bash_profile.

36
New cards

regex

A series of character patterns used to search or match text.

37
New cards

regex symbol .

Matches any single character.

38
New cards

^ and $ in regex

^ matches start of line, $ matches end of line.

39
New cards

[ ] in regex

Define character ranges or sets (e.g., [a-z], [0-9]).

40
New cards

* in regex

Matches zero or more of the preceding character.

41
New cards

+ in regex

Matches one or more of the preceding character.

42
New cards

? in regex

Matches zero or one of the preceding character.

43
New cards

{n} in regex

Matches exactly n occurrences of the previous character.

44
New cards

grep

Searches files for lines that match a regex pattern.

45
New cards

sed

Stream editor used for modifying text in files.

46
New cards

awk

Text processing tool that handles structured data and prints specific fields.

47
New cards

cut

Extracts sections or columns from files.

48
New cards

tr

Translates or deletes characters in text.

49
New cards

wc

Counts lines, words, and characters in text.

50
New cards

sort

Arranges data by specified fields or values.

51
New cards

uniq

Filters out or counts duplicate lines in text.

52
New cards

xargs

Builds command lines from input (often used with find).

53
New cards

head

Displays the first few lines of a file.

54
New cards

tail

Displays the last few lines of a file; can follow live changes.

55
New cards

more

Displays file content page-by-page (scroll forward only).

56
New cards

less

Displays file content with forward/backward scrolling and searching.

57
New cards

echo

Prints text or variables to the screen or a file.

58
New cards

cat

Reads, concatenates, and displays file contents.

59
New cards

tee

Writes output to both a file and the screen at the same time.

60
New cards

printf

Prints formatted text with control over variables and layout.

61
New cards

bc

A command-line calculator for arithmetic operations.

62
New cards

uname

Displays system information (OS, kernel version, architecture).

63
New cards

source

Executes a script in the current shell, applying changes immediately.

64
New cards

nano

A simple, user-friendly terminal text editor.

65
New cards

nano's save and exit shortcuts

Ctrl + O to write, Ctrl + X to exit.

66
New cards

vi/vim

Advanced modal text editors with Insert, Command, and Execute modes.

67
New cards

command in vim saves and exits

:wq

68
New cards

quit vim without saving

:q!

69
New cards

replace text in vim

:s/old/new/g

70
New cards

highlight search matches in vim

:set hlsearch