1. Whatis echo // view the simple explanation of the ECHO command
2. Man echo // view the echo User Manual
2. info echo // view the echo User Manual
3. Echo -- help // view echo usage
4. History // view history shell commands
5. Echo $ PATH // view the environment variable value
Like other shells in the Unix/Linux World, bash uses special environment variables to facilitate system management. For example:
- Home, home directory
- Path, which is used by Linux to search for the executable image of the command you entered
- Histsize, number of historical events saved by the System
6. ls-l // display the files in the current directory in long format.
-RW-r -- 1 Younes 1037 2009-11-18 20:28 liang.txt
Drwxr-XR-x 2 Younes 4096 sonfile
For security reasons, all files are owned and protected. The file access permission (or file mode) contains the same 10 characters as mentioned earlier:
- The first character indicates the file type. The most common is-Represents a file,DRepresents the directory, andLLink.
- The next nine characters are access permissions for three user categories: file owner (2-4), user group (5-7), and others (8-10 ).RIndicates read permission,WIndicates write permission,XIndicates the execution permission on a file. Break number-If any of the nine locations appears, it indicates that this operation is forbidden for users of this category.
- The number next to the access permission indicates the number of subdirectories in the directory, including... and...
AvailableChmodThe command sets the access permission through the character symbol or binary mask. To use the binary mask, you must convert the character representation of the three permission groups to the binary format and convert it to the octal format:
| User Type: |
Owner |
User Group |
Others |
| Character representation: |
Rwx |
R-x |
R -- |
| Binary representation: |
111 |
101 |
100 |
| Octal representation: |
7 |
5 |
4 |
Chmod g + W test. Sh or chmod 774 test. Sh
7. process files. Movable (MV), Copy (CP) Or delete (RmFiles and directories. Use it wisely-IOption to get confirmation is usually a good idea. -I means iteractive, interactive.
$ cp -i ls.out ls2.out
CP: overwrite 'ls2. out '?
8. View and search for files
File Filter
Commands used to read the file content and perform operations on the file content are sometimes called
Such
$ Cat-n test. out1 this is a test // 1 indicates the role of-N and displays the row number.
The command for viewing files is more and less.
Redirection and MPs queue
Redirection allows you to redirect command output to a file, rather than standard output. Similarly, you can also redirect the input. Standard redirection symbol> Create a new file.> Symbol to add the output to an existing file.