File Handling
TermiPy provides a range of commands for file and directory operations. This guide covers the most commonly used file handling commands.
Listing Files and Directories
getwd
Get working directory.
@termipy >> getwdls
List contents of the current directory.
@termipy >> lstree [directory]
Show directory structure
@termipy >> tree
@termipy >> tree /path/to/directoryor restricting the depth of the tree
@termipy >> tree -l 2Creating Files and Directories
create <path>
Create a new file or directory
@termipy >> create new_file.txt
@termipy >> create new_directory/Deleting Files and Directories
delete <path>
Delete a file or directory
@termipy >> delete old_file.txt
@termipy >> delete old_directory/Renaming Files and Directories
rename <old> <new>
Rename a file or directory
@termipy >> rename old_name.txt new_name.txtSearching for Files
search <filename>
Search for a file in the current directory and subdirectories
@termipy >> search important_doc.pdfFile Permissions
permissions <file>
Show file permissions
@termipy >> permissions myfile.txtDisk Usage
diskusage [path]
Show disk usage for a specific path or the current directory
@termipy >> diskusage
@termipy >> diskusage /home/userFile Details
about <file>
Show file details
@termipy >> about myfile.txtTips for File Handling
Use tab completion to quickly navigate directories and input file names.
When dealing with files or directories with spaces in their names, use quotes:
@termipy >> setwd "My Documents"Be cautious when using the
deletecommand, as it permanently removes files and directories.Use the
treecommand with a depth parameter to limit the levels shown:@termipy >> tree -l 2