Commands Flashcards

1
Q

Print to Standard Output

A

echo

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

Change Directory

A

cd

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

Manual Page

A

man

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

Print Working Directory

A

pwd

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

List directory

A

ls (ls -a to list hidden files)

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

Make Directory

A

mkdir (mkdir -p to create nested directories)

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

Delete file

A

rm (rm -rf to force delete)

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

Delete Directory

A

rmdir

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

Copy

A

cp

cp -R (select a directory to copy)

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

Move

A

mv

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

Create a link

A

ln

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

Print contents of file

A

cat

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

Print contents of file with paging

A

less

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

Evaluate an expression

A

expr

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

Create a data disc

A

dd

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

Check for a regular expression

A

grep

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

Search for processed by regular expression

A

pgrep

pgrep -l to list PID and process name

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

Use extended regular expressions

A

egrep

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

Print the field at a particular index in a record

A

awk

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

Edit each line of text

A

sed

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

Determine type of file

A

file

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

Find files matching a specific criteria

A

find

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

Update Database of files

24
Q

Search database for an entry

25
Extract the file name and remove extension
basename
26
Extract a directory name
dirname
27
Resolve the path for a file
realpath
28
Extract first few lines of a file
head
29
Extract the last few lines of a file
tail
30
Reverse the input
rev
31
Word count
wc
32
Extract a charcter or word from input
cut
33
Translate characters
tr
34
Reads one record from input into the shell variable
read
35
Print or set the system date
date
36
Print the full path to the executable
type
37
set shell variables
set
38
Print os name
uname
39
Print list of currently logged in users
w
40
Compare two files to check if they are the same
cmp
41
Compare to files to seee if they are different
diff
42
List current running processes
ps
43
Show system data and counters
top
44
Kill a process
kill
45
Pause activity in CPU
sleep
46
Lists any unique (non-repetitive) records in input.
uniq
47
Changes the permissions of to match .
chmod
48
Changes the owner of to .
chown
49
Create a file
touch
50
Create an archive
tar
51
Compress/Defalte an archive
gzip (gunzip to extract)
52
Get url
wget
53
Explain the difference between hard links and symbolic links
Hard links are simply another name for the original file Symbolic links provide a pointer to the original file
54
Test
Check if a condition is true or false
55
Evaluate an expression
expr
56
How do you examine the exit status of previous command
Echo the exit status of the previous command using a special shell variable: $? This is useful for confirming the result of the test command. 0 is true, 1 is false
57
Word count
wc