Are you planning to switch from Windows to Linux, or are you just switching to Linux? Alas !!! What am I talking about? Why are you in my world. From my past experience, I was shocked when I first started using Linux, commands, terminals, and so on. I am worried about how many commands I should remember to help me complete all the tasks. Without a doubt, online documents, books, man pages, and communities have helped me a lot, but I still firmly believe that there is an article that records how to learn and understand commands in a simple way. This inspires me to master Linux and make it easy to use. This article is the ladder to it.
1. ls command
The ls command is used to List Directory Contents (List Directory Contents. Running it is to list the content in the folder, which may be a file or a folder.
- Root @ tecmint :~ # Ls
- Android-Games Music
- Pictures Public
- Desktop Tecmint.com
- Documents TecMint-Sync
- Downloads Templates
The "ls-l" command has long listing fashion to list the contents of the folder.
- Root @ tecmint :~ # Ls-l
- Total 40588
- Drwxrwxr-x 2 ravisaive 4096 May 8 006 Android Games
- Drwxr-xr-x 2 ravisaive 4096 May 15 Desktop
- Drwxr-xr-x 2 ravisaive 4096 May 16 Documents
- Drwxr-xr-x 6 ravisaive 4096 May 16 Downloads
- Drwxr-xr-x 2 ravisaive 4096 Apr 30 Music
- Drwxr-xr-x 2 ravisaive 4096 May 9 Pictures
- Drwxrwxr-x 5 ravisaive 4096 May 3 Tecmint.com
- Drwxr-xr-x 2 ravisaive 4096 Apr 30 Templates
The "ls-a" command lists all contents in the folder, including hidden files starting.
- Root @ tecmint :~ # Ls-
- ... Gnupg. scheduler. goutputstream-PI5VVW. mission-control
- . Adobe deja-dup. grsync. mozilla. themes
- . Gstreamer-0.10. mtpaint. thumbnails. gtk-bookmarks. thunderbird
- . HotShots. mysql_history. htaccess. apport-ignore.xml. ICEauthority
- . Profile. bash_history. icons. bash_logout. fbmessenger
- . Jedit. pulse. bashrc. liferea_1.8. pulse-cookie
- . Xauthority. gconf. local. Xauthority. HGHVWW. cache
- . Gftp. macromedia. remmina. cinnamon. gimp-2.8
- . Ssh. xsession-errors. compiz. gnome teamviewer_linux.deb
- . Xsession-errors.old. config. gnome2. zoncolor
Note: in Linux, files starting with "." are hidden files, and each file, folder, device, or command is treated as files. Ls-l command output:
- D (indicates a directory ).
- Rwxr-xr-x is the permission of the user to which the file or directory belongs, the same group of users and other users.
- In the preceding example, the first ravisaive indicates that the file belongs to the user ravisaive.
- In the preceding example, the second ravisaive represents the file that belongs to the user group ravisaive.
- 4096 indicates that the file size is 4096 bytes.
- May 8 represents the last modification date and time of the file.
- The last step is the file/folder name.
Recommended reading:
Linux Command-sleep-delay specified time
Shell programming in Linux -- basic usage of sed command
Shell programming in Linux -- basic use of the grep command
For more Linux commands, see the next page: