8. Other Linux commands:
This section only learns other commands under the Linux system, which have TTY, STARTX, type and so on.
8.1 TTY:
Display current terminal equipment .
In the Linux operating system, all peripheral devices have their names and codes, which are stored in the/dev directory as special file types. You can perform a TTY (teletypewriter) command to query the file name of the terminal you are currently using.
8.1.1 Command syntax:
tty[Options]
8.1.2 option Parameters:
Command entry:
-
-s,--silent,--quiet: Nothing prints, just returns the exit status code.
-
--help: Printing help information.
-
--version: Print the version information and exit.
Returned status code:
0 indicates that the standard input is a terminal.
1 indicates that the standard input is not a terminal.
2 indicates that the given argument is an incorrect parameter.
3 indicates a write error has occurred.
8.1.3 instances:
Example 1: Displaying the current terminal
[[email protected]/]# TTY
/dev/pts/0
8.2 startx: Used to start X window, the program that actually launches X window is xinit.
launch the Gnome interface
8.2.1 Command syntax:
startx[parameters]
8.2.3 option Parameters:
8.2.4 instances:
Example 1: To start an X session on a workstation or x terminal
Input:
StartX
Example 2: Forcing an X session on a workstation
Input:
Startx-w
Example 3: To start an X session for an X terminal and log off the user's Telnet session
Input:
StartX Kill-9 $$
Example 4: To start an X session with a. XINITRC script
Input:
Startx-x. xinitrc
Example 5: To start an X session using the MWM window Manager
Input:
Startx-m MWM
8.3 Type: Displays the types of commands
Use the type command to determine whether a given command is an internal command or an external command, and to see the location of the executable file that corresponds to the external command.
8.3.1 Command syntax:
type[options [command]
8.3.2 parameter options:
-A shows all possible types
-P returns information for external commands only, equivalent to the which command
-F returns information only for Shell functions
-T returns only information of the specified type
8.3.3 Command type:
-
alias: Alias.
-
Keyword: key word, shell reserved word.
-
Function: Functions, shell functions.
-
builtin: Built-in command, Shell built-in command.
-
file: File, disk file, external command.
-
unfound: Not found.
The built-in command can be used to get help with the assist command, and the external command uses man or info to get help.
8.3.4 instances:
Example 1: Display the type of the LS command
[[email protected] /]# type-a ls
LS is aliased to ' LS--color=auto '
LS Is/bin/ls
The LS command is an alias
Example 2: Display the type of the CD command
[[email protected]/]# type-a ls
LS is aliased to ' LS--color=auto '
LS Is/bin/ls
The CD command is a shell built-in command
Example 3: Display the type of the GERP command
[[email protected]/]# type-a grep
grep is/bin/grep
The grep command is an external command
Linux command details 8, Linux other commands