Linux Commands Flashcards

1
Q

date

A

displays today’s date

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

cal

A

displays current month

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

df

A

displays the current amount of free space on disk drives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

free

A

displays the amount of free memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

exit

A

to end terminal session

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CTRL-D

A

command to end terminal session

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

pwd

A

print working directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

cd

A

change working directory to home directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

cd ..

A

change to parent directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

cd -

A

change to previous directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

cd ~user_name

A

change to home directory of user_name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

ls

A

list files and directories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

ls -a (–all)

A

list all files including hidden ones

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

ls -A (–almost all)

A

like ls -a except for . current directory and .. parent directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

ls -d (–directory)

A

use with -l to view details of the diretory itself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

ls -F (–classify)

A

appends indicator to each listed name (i.e., / if directory)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

ls -h (–human-readable)

A

displays files sizes in human-readable in long format listings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

ls -l

A

display listing in long format (with details)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

ls -r (–reverse)

A

display results in reverse order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

ls -S

A

display results by file size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

ls -t

A

display results by modification time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

file filename

A

determine file type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

less filename

A

program to view text files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

less etc/passwd

A

lists all the system’s user accounts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

cp

A

copy files and/or directories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

cp item1 item2

A

copies single file or directory item1 to file/directory item2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

cp -a (–archive)

A

copy files and directories and all of their attributes, inculuding ownerships and permissions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

cp -i (–interactive)

A

prompts for confirmation before overwriting exisiting file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

cp -r (–recursive)

A

copy directories and their contents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

cp -u (–update)

A

copies only newer copies of files or ones that do not exist in directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

cp -v (–verbose)

A

displays informative message as copy is performed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

mv

A

move/rename files an/or directories (can be used with: -i, -u, -v)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

mv item1 item2

A

renames item1 to item2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

mv item1 directory

A

moves item1 to directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

mkdir

A

make directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

mkdir dir1 dir2

A

multiple directories can be created with one comand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

rm

A

remove or delete files and directories (can be used with: -i, -r, -v)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

rm -f (–force)

A

ignore nonexistent files and do not prompt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

ln

A

create hard and symbolic links

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

ln file link

A

creates hard link

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

ln -s item link

A

creats symbolic link

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

type command

A

indicate how a command name is interpreted - it’s type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

which command

A

display which executable program will be executed - it’s location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

help command

A

get help for shell built-ins

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

command –help

A

displays a description of the command’s supported syntax and options - it’s usage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

man program

A

display a program’s manual page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

apropos command

A

display a list of appropiate commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

info program

A

display a program’s info entry – info pages are hyperlinks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

whatis command

A

display one-line manual page descriptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

alias

A

create an alias for a command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

alias name=’cmd1; cmd2; cmd3’

A

create alias name by connecting commands together (alias name=’string’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

unalias name

A

removes alias

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

alias (by itself)

A

reveals all aliases defined in the environment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

cat filename

A

concatenate files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

sort

A

sort lines of text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

uniq

A

report or omit repeated lines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

uniq -d

A

report list of duplicates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

grep pattern filename

A

print lines matching a pattern

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

grep -i pattern filename

A

ignore case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

grep -v pattern filename

A

print lines that do not match

61
Q

wc

A

prints number of lines, words, and byte counts for each file

62
Q

head filename

A

output first 10 lines of file; -n 5 (5 lines)

63
Q

tail filename

A

output last 10 lines of file; -n 5 (5 lines)

64
Q

tail -f filename

A

view file in real ltime; tail -f /car/log/messages (to view messages file)

65
Q

tee

A

read from standard input and write to standard output and files

66
Q

echo text

A

display a line of text

67
Q

echo *

A

shell expands the wildcard * into the names of the files in the current working directory

68
Q

echo letter*

A

files beginning with letter are expanded

69
Q

echo *letter

A

files ending with letter are expanded

70
Q

echo wildcards and character class

A

varous means of expansions

71
Q

echo ~

A

tilde expansion: expands home directory

72
Q

printen

A

print part or all of the environment

73
Q

printenv | less

A

to see a list of available variables

74
Q

$(command)

A

command substitution

75
Q

ls -l $(which cp)

A

example of command substitution: get listing of cp program

76
Q

file $(ls -d /usr/bin/* | grep zip)

A

example of command substitution: pipeline using grep

77
Q

double quotes “ “

A

special characters used by the shell lose their special meaning except for $(dollar sign, (backslash), `(backtick)

78
Q

single quotes ‘ ‘

A

supress all expansions

79
Q

escape character \

A

used to prevent an expansion (echo “balance is $5.00”)

80
Q

clear

A

clear the terminal screen

81
Q

history

A

display history

82
Q

history | less

A

view contents of the command history

83
Q

!number

A

history expansion: example !88 expands the contents of the 88th line in the history list.

84
Q

id

A

display user identity

85
Q

chmod 766 file.txt

A

Change File Mode – using octal notation

86
Q

su

A

run a shell as another user

87
Q

su -

A

run a shell as superuser

88
Q

sudo command

A

super user do – execute a command as a different user

89
Q

chown [owner][:[group]] file

A

change file ownership and group

90
Q

chown bob

A

change file ownership to bob

91
Q

chown bob:users

A

change file ownership to bob and change file group ownership to users

92
Q

chown :admins

A

change group ownership to admins. File ownership is unchanged.

93
Q

chown bob:

A

change file ownership to bob and group owner to the login group of user bob

94
Q

passwd

A

used to change your password

95
Q

ps

A

report a snapshot of current processes

96
Q

ps x

A

show all processes regardless of what terminal they are controlled by

97
Q

ps aux

A

displays processes belonging to every user

98
Q

pstree

A

process list arranged in -tree-like pattern

99
Q

vmstat

A

snapshot of system resource usage

100
Q

top

A

display tasks

101
Q

jobs

A

list active jobs

102
Q

bg

A

place a job in the background

103
Q

fg

A

place a job in the foreground

104
Q

kill PID

A

terminate process by PID

105
Q

kill -l

A

display a list of kill signals

106
Q

killall

A

kill processes by name

107
Q

shutdown

A

shutdown or reboot system

108
Q

set

A

set shell options

109
Q

export

A

export environment to subsequently executed programs

110
Q

apt install package_name

A

method used to install Debian packages (may require sudo command)

111
Q

yum install package_name

A

method used to install Red Hat packages

112
Q

sudo apt update

A

update Debian system

113
Q

sudo apt upgrade

A

upgrade Debian system

114
Q

yum update

A

update Red Hat system

115
Q

apt remove package_name

A

remove Debian package

116
Q

yum erase package_name

A

remove Red Hate package

117
Q

dpkg

A

list installed packages - Debian

118
Q

rpm -qa

A

list installed packages - Red Hat

119
Q

apt-cache show package_name

A

display info about an installed package - Debian

120
Q

yum info package_name

A

display info about an installed package - Red Hat

121
Q

dpkg -S file_name

A

determine which package is reponsible for the installation of a particular file - Debain

122
Q

rpm -qf file_name

A

determine which package is reponsible for the installation of a particular file - Red Hat

123
Q

mount

A

mount a file system

124
Q

unmount

A

unmount a file sytem

125
Q

fsck

A

check and repair a file system

126
Q

fdisk

A

manipulate disk partition table

127
Q

mkfs

A

create a file system

128
Q

dd

A

convert and copy a file

129
Q

genisoimage (mkisofs)

A

create an ISO 9660 image file

130
Q

wodim (cdrecord)

A

write data to optical storage media

131
Q

md5sum

A

calculate an MD5 checksum

132
Q

ping

A

send an ICMP ECHO_REQUEST to network hosts

133
Q

traceroute

A

print the route packets trace to a network host

134
Q

ip

A

show/manipulate routing, devices, policy, and tunnels

135
Q

netstat

A

print network connections, routing tables, and more

136
Q

netstat -ie

A

examine network interfaces in system

137
Q

netstat -r

A

kernal’s network routing table

138
Q

ftp

A

internet file transfer program

139
Q

wget

A

non-interactive network downloader

140
Q

ssh

A

OpenSSH SSH client (remote login program)

141
Q

locate bin/zip

A

find files by name

142
Q

find

A

search for files in a directory heirarchy

143
Q

find ~

A

listing of home directory

144
Q

find ~ | wc -l

A

pipe list into other programs; count number of files

145
Q

find ~ -type -d | wc -l

A

pipe list into other programs; count number of diretories

146
Q

find ~ -type -f | wc -l

A

pipe list into other programs; count number of regular files

147
Q

xargs

A

build and execute command lines from standard input

148
Q

touch

A

change file times

149
Q

stat

A

display file or file system status