1st method is using touch command
2nd method by cat and redirection command
3rd method with echo command
xxxxxxxxxx
# 1st method
touch access.log
# 2nd method
cat > sample.txt
# 3rd method
echo "some text" > sample.txt
- in touch command we create an empty file - in cat method the prompt will ask for the data which needs to be added into it you can exit the prompt by pressing CTRL + C - in the same way in echo command we need to provide the context for the file while creating it