DTL Lab 4
DTL Lab 4
Aim:
To perform basic file operations using Linux command line tools such as creating, editing, moving, and deleting
files and directories.
Theory:
Linux is a powerful operating system widely used in servers, development environments, and embedded
systems. One of its key strengths is the command-line interface (CLI), which allows users to perform tasks
efficiently. File operations are fundamental to working with any operating system, and Linux provides a variety
of commands to manage files and directories.
Key Commands:
Procedure:
Launch the terminal on your Linux system. You can do this by searching for "Terminal" in
the applications menu or using a keyboard shortcut (e.g., Ctrl + Alt + T).
1. Creating a Directory: o
touch my_file.txt
3. Editing a File:
5. Copying a File:
6. Moving/Renaming a File: o
Command: mv my_file_copy.txt
renamed_file.txt
7. Creating a Subdirectory: o
8. Moving a File to a
Subdirectory:
rm
sub_directory/renamed_file.txt
Contents: o Command: ls
Directory: o Command: rm -r
my_directory
––
Steps to Follow:
Output:
• Successfully created, edited, moved, and deleted files and directories using Linux
commandline tools.
• Learned to use commands like touch, mkdir, nano, mv, cp, rm, rmdir, ls, and cat.
Conclusion: