Hi guys,welcome to Linux Gijutsu tutorials previously you already learn about cd, pwd, mkdir and touch command,now you will learn about ls command.
ls is just to view or check list the contents of files. example on location basicLinux/ just typing ls
and the result is you get to view all only the list of contents files basicLinux/
example again on location basicLinux/ if you want to view a list of the contents of files in the home directory just typing: ls /home/developer
or you can use this command : ls ~ (with symbol home)
If you are still confused why I typing /home/developer you can typing pwd command on location home directory to find out the name of the location your home.
and about this symbol, this symbol is /home/developer
so I prefer to use this symbol to write home, no need to write a long, and very simple
example again on location home,if you want to view a list of the contents of files in the home directory just typing ls.
but if you want to view a list of the contents of files in the Downloads/ directory just typing : ls Downloads/
example again on location Downloads/ if you want to view a list of the contents of files in the Videos/ directory just typing: ls ~/Videos
if Pictures/ Directory ls ~/Pictures
if /opt root directory ls /opt
option -a is to view or check a list of hidden files
the dot in front of the files is a hidden files. if you want to use GUI, use ctrl + h to view hidden files.
example again on location basicLinux/ create a hidden folder with name .gijutsu
check ls with option -a ,and a hidden folder with name .gijutsu already is created
Here you should to typing the ls command with option -a because if you just typing ls without option -a , you will not be able to view the hidden files.
ls -l to view the file permissions, you will learn this later in special tutorial that will discuss about of the file permission
to view list subdirectories recursively,examples on location ~/basicLinux create folder
Ok here, you create folder : parents A/ and subdirectories B/ folder and change directory to on location B/ directory and B/ directory create empty file with name empty and you back again to ~/basicLinux
and if you want to view folder A with his subdirectories folder A/ just typing ls -R A/
A/ folder as the parents folder,has subdirectories B/ , B folder has files with name empty..
Không có nhận xét nào:
Đăng nhận xét