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
cp
copy files and/or directories
26
cp item1 item2
copies single file or directory item1 to file/directory item2
27
cp -a (--archive)
copy files and directories and all of their attributes, inculuding ownerships and permissions
28
cp -i (--interactive)
prompts for confirmation before overwriting exisiting file
29
cp -r (--recursive)
copy directories and their contents
30
cp -u (--update)
copies only newer copies of files or ones that do not exist in directory
31
cp -v (--verbose)
displays informative message as copy is performed
32
mv
move/rename files an/or directories (can be used with: -i, -u, -v)
33
mv item1 item2
renames item1 to item2
34
mv item1 directory
moves item1 to directory
35
mkdir
make directory
36
mkdir dir1 dir2
multiple directories can be created with one comand
37
rm
remove or delete files and directories (can be used with: -i, -r, -v)
38
rm -f (--force)
ignore nonexistent files and do not prompt
39
ln
create hard and symbolic links
40
ln file link
creates hard link
41
ln -s item link
creats symbolic link
42
type command
indicate how a command name is interpreted - it's type
43
which command
display which executable program will be executed - it's location
44
help command
get help for shell built-ins
45
command --help
displays a description of the command's supported syntax and options - it's usage
46
man program
display a program's manual page
47
apropos command
display a list of appropiate commands
48
info program
display a program's info entry -- info pages are hyperlinks
49
whatis command
display one-line manual page descriptions
50
alias
create an alias for a command
51
alias name='cmd1; cmd2; cmd3'
create alias name by connecting commands together (alias name='string')
52
unalias name
removes alias
53
alias (by itself)
reveals all aliases defined in the environment
54
cat filename
concatenate files
55
sort
sort lines of text
56
uniq
report or omit repeated lines
57
uniq -d
report list of duplicates
58
grep pattern filename
print lines matching a pattern
59
grep -i pattern filename
ignore case
60
grep -v pattern filename
print lines that do not match
61
wc
prints number of lines, words, and byte counts for each file
62
head filename
output first 10 lines of file; -n 5 (5 lines)
63
tail filename
output last 10 lines of file; -n 5 (5 lines)
64
tail -f filename
view file in real ltime; tail -f /car/log/messages (to view messages file)
65
tee
read from standard input and write to standard output and files
66
echo text
display a line of text
67
echo *
shell expands the wildcard * into the names of the files in the current working directory
68
echo letter*
files beginning with letter are expanded
69
echo *letter
files ending with letter are expanded
70
echo wildcards and character class
varous means of expansions
71
echo ~
tilde expansion: expands home directory
72
printen
print part or all of the environment
73
printenv | less
to see a list of available variables
74
$(command)
command substitution
75
ls -l $(which cp)
example of command substitution: get listing of cp program
76
file $(ls -d /usr/bin/* | grep zip)
example of command substitution: pipeline using grep
77
double quotes " "
special characters used by the shell lose their special meaning except for $(dollar sign, \(backslash), `(backtick)
78
single quotes ' '
supress all expansions
79
escape character \
used to prevent an expansion (echo "balance is \$5.00")
80
clear
clear the terminal screen
81
history
display history
82
history | less
view contents of the command history
83
!number
history expansion: example !88 expands the contents of the 88th line in the history list.
84
id
display user identity
85
chmod 766 file.txt
Change File Mode -- using octal notation
86
su
run a shell as another user
87
su -
run a shell as superuser
88
sudo command
super user do -- execute a command as a different user
89
chown [owner][:[group]] file
change file ownership and group
90
chown bob
change file ownership to bob
91
chown bob:users
change file ownership to bob and change file group ownership to users
92
chown :admins
change group ownership to admins. File ownership is unchanged.
93
chown bob:
change file ownership to bob and group owner to the login group of user bob
94
passwd
used to change your password
95
ps
report a snapshot of current processes
96
ps x
show all processes regardless of what terminal they are controlled by
97
ps aux
displays processes belonging to every user
98
pstree
process list arranged in -tree-like pattern
99
vmstat
snapshot of system resource usage
100
top
display tasks
101
jobs
list active jobs
102
bg
place a job in the background
103
fg
place a job in the foreground
104
kill PID
terminate process by PID
105
kill -l
display a list of kill signals
106
killall
kill processes by name
107
shutdown
shutdown or reboot system
108
set
set shell options
109
export
export environment to subsequently executed programs
110
apt install package_name
method used to install Debian packages (may require sudo command)
111
yum install package_name
method used to install Red Hat packages
112
sudo apt update
update Debian system
113
sudo apt upgrade
upgrade Debian system
114
yum update
update Red Hat system
115
apt remove package_name
remove Debian package
116
yum erase package_name
remove Red Hate package
117
dpkg
list installed packages - Debian
118
rpm -qa
list installed packages - Red Hat
119
apt-cache show package_name
display info about an installed package - Debian
120
yum info package_name
display info about an installed package - Red Hat
121
dpkg -S file_name
determine which package is reponsible for the installation of a particular file - Debain
122
rpm -qf file_name
determine which package is reponsible for the installation of a particular file - Red Hat
123
mount
mount a file system
124
unmount
unmount a file sytem
125
fsck
check and repair a file system
126
fdisk
manipulate disk partition table
127
mkfs
create a file system
128
dd
convert and copy a file
129
genisoimage (mkisofs)
create an ISO 9660 image file
130
wodim (cdrecord)
write data to optical storage media
131
md5sum
calculate an MD5 checksum
132
ping
send an ICMP ECHO_REQUEST to network hosts
133
traceroute
print the route packets trace to a network host
134
ip
show/manipulate routing, devices, policy, and tunnels
135
netstat
print network connections, routing tables, and more
136
netstat -ie
examine network interfaces in system
137
netstat -r
kernal's network routing table
138
ftp
internet file transfer program
139
wget
non-interactive network downloader
140
ssh
OpenSSH SSH client (remote login program)
141
locate bin/zip
find files by name
142
find
search for files in a directory heirarchy
143
find ~
listing of home directory
144
find ~ | wc -l
pipe list into other programs; count number of files
145
find ~ -type -d | wc -l
pipe list into other programs; count number of diretories
146
find ~ -type -f | wc -l
pipe list into other programs; count number of regular files
147
xargs
build and execute command lines from standard input
148
touch
change file times
149
stat
display file or file system status