Output Redirection, Regular Expressions Flashcards
What is the command to create a directory?
mkdir
What is the command to remove an empty directory?
rmdir
What is the command to remove a directory with contents
rm -r
What is the command to create a parent directory and subdirectory?
mkdir -p
i.e mkdir -p parent/child
What is the command to create a non existing file/ update the timestamp of an existing file/directory?
touch
i. e touch file
- m modify timestamp to specific date
What is the command to rename a file/directory?
mv
i.e mv oldname newname
What is the command to copy a directory and its contents?
cp -r
-R –recursive
What the command to archive multiple files/directories?
tar -cf archivename file1 file2
- c create -f file
- f must be the last parameter
What is the command to archive and compress multiple files/directories?
tar -cf
-z gzip -j bzip2
What is the command to extract a compressed tar file?
tar -xf
-x extract -f file -C destination
What is the command to list the contents of a tar file without extracting it?
tar -tf
How do you zip compress a file?
zip zipfilename file1 file2
- r recursively on directories
- creates a new compressed file
How do you uncompress a zip file?
unzip
How do you gzip compress a file?
gzip
*directly compresses file in place
How do you uncompress a gzip file?
gunzip