manipulating files and directory Flashcards

1
Q

what is the wildcard matches any characters and the wildcard matches any single character

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

wildcard that matches any character that is a member of the set characters or not the member or of the specified class

A

[characters] [!characters] [[:class:]]

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

character classes

A

alphanumberic [:alnum:] alphabetic [:alpha:] numeral [:digit:] lowercase letter [:lower:] uppercase letter [:upper:]

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

what is the wildcard of any file beginning with either an ‘a’, ‘b’ or ‘c’

A

[abc]*

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

what is the wildcard of any file beginning with ‘back’ follow by three numerals

A

back[:digit:][:digit:][:digit:]

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

what is the wildcard of any file ending with lowercase letter or numeral ‘1’ or ‘2’

A

*[[:lower:]12]

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

how to create directory ‘dir1’

A

mkdir dir1

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

how to create multi directory ‘dir1’,’dir2’and’dir3’

A

mkdir dir1 dir2 dir3

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

how to copy a file or directory ‘item1’ to file or directory ‘item2’

A

cp item1 item2

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

how to copy multiple items ‘item1’ ‘item2’ ‘item3’ to a directory ‘items’

A

cp item1 item2 item3 items

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

how to copy files and directories with all of their attributes including ownerships and permission

A

cp -a

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

how to set a confirmation before overwriting an existing file when coping the files

A

cp -i

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

how to recursively copy directories itself and their content

A

cp -r

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

how to display informative messages as the copy is performed

A

cp -v

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

how to copy file only when that file either dont exist or are newer than the existing corresponding files in the destination directory

A

cp -u

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

how to copy all the file in dir1 but not dir1 itself to dir2 where dir2 must alr exist

A

cp dir1/* dir2

17
Q

how to copy the all content of directory dir1 to dir2 and dir2 can does not exist

A

cp -r dir1 dir2

18
Q

how to rename a file ‘item1’ to ‘item2’

A

mv item1 item2

19
Q

how to move files ‘item1’ ‘item2’ to ‘dir1’

A

mv item1 item2 dir1

20
Q

confirmation of move

A

mv -i

21
Q

moving files from one directory to another, only move files that either dont exist or are newer than the existing corresponding files in the destination directory

A

mv -u

22
Q

display informative messages as the move is performed

A

mv -v

23
Q

move ‘dir1’ and its content to ‘dir2’ where dir2 can be exist or not, and dir1 is deleted

A

mv dir1 dir2

24
Q

remove ‘item’ ‘item2’

A

rm item item2

25
Q

confirmation of remove; ignore nonexistent files and overrides confirmation to remove

A

rm -i ; rm -f

26
Q

Recursively delete dir even dir has subdir. When delete a dir, this option must be specified

A

rm -r

27
Q

delete file1 and dir1 and its contents no matter either file1 or dir1 do not exist

A

rm -rf file1 dir1

28
Q

how to create hard link

A

ln file link

29
Q

how to create a symbolic link

A

ln -s item link

30
Q

make a hard link ‘fun-hard’ in ‘dir1’ that point to item ‘fun’

A

ln fun dir1/fun-hard

31
Q

how to list the files with long format and inode

A

ls -li

32
Q

how to create a symbolic link of between dir1 and dir1-sym

A

ln -s dir1 dir1-sym

33
Q

how to create a symbolic link of file ‘fun’ and ‘fun-sym’ in ‘dir1’ where in current directory

A

ln -s ../fun dir1/fun-sym