Lecture 2(LAB)
Lecture 2(LAB)
1. cat Command
2. Hidden Files
3. Showing Contents of a File
4. How to Append Files
5. How to Concatenate Files
6. cp Command
7. mv Command
8. rm Command
cat command
cat > test.txt
This is a test.
To delete a file
Syntax: $ rm filename
Example: $ rm ex1
To delete all files
Syntax: $ rm *
rm -r /tmp/backup to remove everything that folder.
Of course you've to be careful before removing anything.
Create, change and remove a
directory
To create a directory
Syntax: $ mkdir dirname
To change the name of the directory
Syntax: $ cd dirname
To remove the directory
Syntax: $ rmdir dirname
Example: $ rmdir flower
To delete all directories The -p option can delete
directory and its subdirectories/sub-folders:
Syntax: $ rmdir -p dir1/dir2/dir3
Books
Unix Shell Programming
Written by Yashavant P. Kanetkar