File and Directory Management Flashcards
How do you list directory contents and what are the available options to go along with this command?
ls
-a to show all files including hidden ones
-l to use long listing format
How do you print the current working directory?
pwd
How do you change the working directory?
cd
- current working directory .
- the parent directory ..
- the previous working directory -
- the users home directory tilda
How do you concatenate files and print output?
cat
What command for visual display editor that can also be used to create files?
vi
Change the timestamp for existing files or create new files?
touch
Command to create a directory/ies if they do not already exist?
mkdir
-p option will create parent directories as needed
Command to copy files and directories
cp
-r/-R option is used to copy directories recursively
Command to move or rename files
mv
remove files or directories
rm
-r/-R option removes directories and their contents recursively.
-f option removes the prompt when deleting files or directories
rmdir
Remove empty directories
How to show all files long list option and hidden files?
ls -al
Show syntax for copying testfile to a new testfile2
cp testfile testfile2
Change the name of testfile1 to testfile4
mv testfile1 testfile4
Create two new files test01 and test02
touch test01 test02