Deleting, Copying, Moving, and Renaming files Flashcards
What command should we use for removing a file?
rm
Can we use rm for deleting a directory?
Yes, rm -r will work
What is cp command for?
Copy a file
Can you copy multiple files at once with cp?
Yes, like this: cp file1 file2 dir
Can you copy directories with cp?
yes, cp -r source_dir dest_dir
What command should we use to move a file or a directory?
mv
does move works for renaming a file?
yes, if the argument provided in destination is a file/directory that already exist it will be rename with the source argument
What command should you use to sort the contents of a text file?
sort
If you want to archive a group of files or directories, what command should we use?
tar
If you want to zip a file, which command should we use?
gzip
If you want to unzip a file, which command should we use?
gunzip
What command should I use for know the disk usage of a file?
du (disk usage)