manipulating files and directory Flashcards
what is the wildcard matches any characters and the wildcard matches any single character
- and ?
wildcard that matches any character that is a member of the set characters or not the member or of the specified class
[characters] [!characters] [[:class:]]
character classes
alphanumberic [:alnum:] alphabetic [:alpha:] numeral [:digit:] lowercase letter [:lower:] uppercase letter [:upper:]
what is the wildcard of any file beginning with either an ‘a’, ‘b’ or ‘c’
[abc]*
what is the wildcard of any file beginning with ‘back’ follow by three numerals
back[:digit:][:digit:][:digit:]
what is the wildcard of any file ending with lowercase letter or numeral ‘1’ or ‘2’
*[[:lower:]12]
how to create directory ‘dir1’
mkdir dir1
how to create multi directory ‘dir1’,’dir2’and’dir3’
mkdir dir1 dir2 dir3
how to copy a file or directory ‘item1’ to file or directory ‘item2’
cp item1 item2
how to copy multiple items ‘item1’ ‘item2’ ‘item3’ to a directory ‘items’
cp item1 item2 item3 items
how to copy files and directories with all of their attributes including ownerships and permission
cp -a
how to set a confirmation before overwriting an existing file when coping the files
cp -i
how to recursively copy directories itself and their content
cp -r
how to display informative messages as the copy is performed
cp -v
how to copy file only when that file either dont exist or are newer than the existing corresponding files in the destination directory
cp -u