Bash

Basic File Commands

touch test_file.txt
Creates an empty file called test_file.txt.


cp test_file.txt test_file_copy.txt

Copies your original test_file.txt and names the new copy to test_file_copy.txt.


cp test_file.txt one_more_dir/test_file.txt

Copies your original test_file.txt into the one_more_dir directory - and keeps its original name. (Only works if one_more_dir is in your current working directory.)


mv test_file.txt one_more_dir/test_file.txt

Moves your original test_file.txt into the one_more_dir directory. (Only works if one_more_dir is in your current working directory.)


mv test_file.txt test_file_some_new_name.txt

Renames your original test_file.txt to test_file_some_new_name.txt.


rm test_file.txt
Removes the test_file.txt file - if it exists.

Note: Be careful! In bash, if you delete a file, it will be deleted for good. There's no "Trash" folder or "Restore" button in case you remove something by accident.