Basic Commands Flashcards

1
Q

rm

A

remove (delete) a file

  • -r is used for recursive (use rm -r to remove a directory)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

rmdir

A

remove (delete) a directory (use rm -r if the directory contains files)

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

cd

A

change directory to move around the file structure

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

. (dot)

A

current directory

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

.. (dot dot)

A

parent directory

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

ls

A

list the contents of a directory

  • -l (prints long form of the file list)
  • -a (show all files, including hidden files)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

touch

A

create a new file

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

less

A

read the contents from a file

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

nano

A

a command line text editor

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

ln

A

link a file

  • -s (creates a softlink)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

cp

A

copy a file

Syntax: (cp file1 file2)

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

mkdir

A

make a new directory

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

clear

A

Clears the terminal prompt screen

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

pwd

A

print working directory (displays where you are in the filesystem)

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

cat

A

concatenate and print files

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

find

A

finds a file based on some criteria

Syntax: find [which directory] [-argument]

  • -type
  • -name
  • -size
  • -mtime (modified time)
  • -atime (accessed time)
  • -ctime (created time)
17
Q

grep

A

searches contents in a file based on a specified pattern

Syntax: grep [pattern] [filename]

  • -i (option for case-insensitive)