Last Updated : 30 Jul, 2025
In Linux, most of the operations are performed on files. And to handle these files Linux has directories also known as folders which are maintained in a tree-like structure. Though, these directories are also a type of file themselves. Linux has 3 types of files:
To perform Files listings or to list files and directories ls command is used
$ls
All your files and directories in the current directory would be listed and each type of file would be displayed with a different color. Like in the output directories are displayed with dark blue color.
$ls -l
It returns the detailed listing of the files and directories in the current directory. The command gives os the owner of the file and even which file could be managed by which user or group and which user/group has the right to access or execute which file.
2. Creating Filestouch command can be used to create a new file. It will create and open a new blank file if the file with a filename does not exist. And in case the file already exists then the file will not be affected.$touch filename3. Displaying File Contentscat command can be used to display the contents of a file. This command will display the contents of the 'filename' file. And if the output is very large then we could use more or less to fit the output on the terminal screen otherwise the content of the whole file is displayed at once.
$cat filename4. Copying a Filecp command could be used to create the copy of a file. It will create the new file in destination with the same name and content as that of the file 'filename'.
$cp source/filename destination/5. Moving a Filemv command could be used to move a file from source to destination. It will remove the file filename from the source folder and would be creating a file with the same name and content in the destination folder.
$mv source/filename destination/6. Renaming a Filemv command could be used to rename a file. It will rename the filename to new_filename or in other words, it will remove the filename file and would be creating a new file with the new_filename with the same content and name as that of the filename file.
$mv filename new_filename7. Deleting a Filerm command could be used to delete a file. It will remove the filename file from the directory.
$rm filename
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4