This document provides an overview of Linux directory and file commands taught in an applied operating systems laboratory module. It introduces commands for navigating directories, creating and removing directories, creating and viewing files, and other utility commands. The module aims to teach students how to perform file and directory creation and move between directories using Linux commands.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
70 views
Module 3 - LINUX Directories and Files Creation
This document provides an overview of Linux directory and file commands taught in an applied operating systems laboratory module. It introduces commands for navigating directories, creating and removing directories, creating and viewing files, and other utility commands. The module aims to teach students how to perform file and directory creation and move between directories using Linux commands.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13
APPLIED OPERATING
SYSTEM LABORATORY MODULE 3 LINUX DIRECTORIES AND FILES CREATION Upon completion of this module, the student will be able to:
• Perform file and directory creation, and move between
directories using LINUX commands • Directory commands • Other commands • Display directory content • clear command • Change directory • history command • Make directory • date command • Print working directory • Remove directory • File creation • Display contents of single or multiple files • Create a file using cat command Display directory content • To display the contents of the current working directory Syntax: ls
Options that can be used with it.
• -a • -A • -d • -l • -r • -R Change directory • To change directory Syntax: • cd <directory_name> • cd . means the current directory • cd .. means parent directory • cd means will take you to your home directory • cd – will take you to your previous directory • cd ~ username will take you to the home directory of the user • cd <directorypath> Make directory • To make directory/directories Syntax: mkdir <directoryname> • To create multiple directories • To create directory name with spaces • To create a subdirectory /home/vetcha/folder1/folder2 (folder2 is not yet existing) • To print or show the working directory Syntax: pwd Remove empty directory • To remove empty directory/directories Syntax: rmdir [-option] <directoryname>
• To remove directory and its
subdirectory Remove directory that is not empty • To remove directory that is not empty Syntax: rm -r <directoryname> • -r means remove directories and their contents recursively Create a file or files • To create a file or files using cat command Syntax: cat > <filename> type text CTRL+D (to save and exit)
• cat means concatenate
• To view the content of file/files Syntax: cat <filename> clear command • To clear the screen. Syntax: clear history command • To display previously entered commands. This information is stored the ~/.bash_history file located at the home directory of each user. Syntax: history date command • To display the date and time. Syntax: date • Sobell, M., et al. (2017). A Practical Guide to Linux Commands, Editors, and Shell Programming, 4th Ed. Addison-Wesley Professional • Cobbaut, P. (2016). Mastering Linux- Networking • Blum, R., (2015). Linux Command Line and Shell Scripting Bible