After reading this blog post, you should be able to:
Navigate in a Unix system
List files and directories
Display the content of a file
Create a file or directory
Remove a file or directory
Move or copy a file or directory
The Linux File System
Files on a Linux system are arranged in what is called a hierarchical directory structure. This means that they are organized in a tree-like pattern of directories (called folders in other systems), which may contain files and subdirectories. The first directory in the file system is called the root directory. The root directory contains files and subdirectories, which contain more files and subdirectories, and so on and so on.
Most graphical environments include a file manager program used to view and manipulate the contents of the file system.
Since the command line interface cannot provide graphic pictures of the file system structure, we must have a different way of representing it. To do this, think of the file system tree as a maze, and that we are standing in it. At any given moment, we are located in a single directory. Inside that directory, we can see its files and the pathway to its parent directory, and the pathways to the subdirectories of the directory in which we are standing.
:- to display the current path of your current directory
$ pwd
:- to list all files of your current directory
$ ls
:- to change to a music directory
$ cd /music
:- display the content of file.txt
$ less file.txt
:- to create an empty file
$ touch file.txt
:- copy a file (or directory if additional argument)
:- copy school.txt to tmp directory (in the same directory)
$ cp school.txt tmp/
:- to rename or move a file (or directory)
:- rename the file old.txt to new.txt (in the same directory)
$ mv old.txt new.txt
:- to delete a file (or directory if additional argument)
:- delete a kk.txt file
$ rm kk.txt
:- create a videos directory
$ mkdir videos
:- delete/remove an empty_directory
$ rmdir empty_directory
Man Page
A man page is a form of software documentation usually found on a Unix or Unix-like operating system. To view the documentation of a Unix command we use the man keyword/command on the terminal
$ man pwd
$ man ls
$ man cd
$ man less
$ man touch
$ man cp
$ man mv
$ man rm
$ man mkdir
$ man rmdir
THE END.
When I grow up, I want to be better than you.