Linux command learning the next day

Source: Internet
Author: User

1, first check which version of VNC you have installed

#rpm-qa |grep VNC

---------------------------------------------------------------------

Tigervnc-1.1.0-5.el6.x86_64

Tigervnc-server-1.1.0-5.el6.x86_64

If not installed, you can use the following command to install

Yum Install Tigervnc Tigervnc-server

---------------------------------------------------------------------

2. Editing the VNC configuration file

Vim/etc/sysconfig/vncservers

Add the following features:

Vncservers= "1:root"

vncserverargs[1]= "-geometry 800x600-alwaysshared-depth 24"

---------------------------------------------------------------------

3. Set the VNC password:

Vncserver The first entry prompts you to set the VNC password:

Vncserver

Later, if you want to modify the VNC user's password, you can use the Vncpassword command to modify:

#vncpasswd

Password:

Verify

4, turn on vncserver, note that n is a value that needs to be specified by itself, such as 1

------------------------------------------------------------------

Vncserver:n

Note: The default VNC port is 5900, and the Remote Desktop Connection port is 5900+n (n is specified by the Vncserver command) if you start Vncserver with Vncserver:1, then the following port is 5901

The Client connection is ip:5901 (i.e. 5900+1)

5, list the remote Desktop that is established by the current user

---------------------------------------------------------------------

Vncserver-list

TigerVNC Server Sessions:

X DISPLAY # PROCESS ID

: 1 2469

6, the client connects to the VNC server.

Click on the connection to connect to the server side. It came to a successful

7, Close Vncserver

# vncserver-kill:n

---------------------------------------------------------------------

8. Set the VNC service to boot with the following command:

# Chkconfig Vncserver on

---------------------------------------------------------------------

9 to see if the boot starts

#chkconfig--list |grep VNC

Vncserver 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off

Types of Linux file systems

Common types of Linux files are: Normal files, directory files, device files (character device files and block device files), pipe files and symbol files, and so on.

1, normal file

Using Ls-l/mnt to view the properties of a file, the first symbol of its properties is "-", which is a common file on a Linux system.

--------------------------------------------------------------------

Ls-l/mnt

Total Dosage 12

-rw-r--r--. 1 root root 6 July 13:49 BC

Drwxr-xr-x 2 root root 4096 July 20:16 test

-rw-r--r--. 1 root root 237 July 15:47 Test.log

2, catalog file

Using Ls-l/mnt to view the properties of a file, the first symbol of its properties is "D", which is the directory file on the Linux system.

---------------------------------------------------------------------

Ls-l/mnt

Total Dosage 12

-rw-r--r--. 1 root root 6 July 13:49 BC

Drwxr-xr-x 2 root root 4096 July 20:16 test

-rw-r--r--. 1 root root 237 July 15:47 Test.log

3, device files

The/dev directory under the Linux system has a large number of device files, mainly block device files and character device files

--------------------------------------------------------------------

Ls-l/dev|grep SD

BRW-RW----1 root disk 8, 0 July 17:12 SDA

BRW-RW----1 root disk 8, 1 July 17:12 sda1

BRW-RW----1 root disk 8, 2 July 17:12 sda2

3.1 Pieces of device files

The main feature of block device is that it can read and write randomly, and the common block device is disk, such as/DEV/SDA1, the first character of its property is "B"

---------------------------------------------------------------------

Ls-l/dev/|grep SD

BRW-RW----1 root disk 8, 0 July 17:12 SDA

BRW-RW----1 root disk 8, 1 July 17:12 sda1

BRW-RW----1 root disk 8, 2 July 17:12 sda2

3.2 Character device files

Common character device files are printers and terminals that can accept character streams. /dev/null is a very useful character device file. All content that is sent to this device is ignored.

Listed below are the character device files, whose properties are the first character "C"

----------------------------------------------------------------

Ls-l/dev|grep Tty5

CRW-------1 root root 4, 5 July 17:13 tty5

CRW--W----1 root TTY 4, 50 July 17:12 tty50

CRW--W----1 root TTY 4, 51 July 17:12 tty51

CRW--W----1 root TTY 4, 52 July 17:12 tty52

CRW--W----1 root TTY 4, 53 July 17:12 tty53

CRW--W----1 root TTY 4, 54 July 17:12 tty54

CRW--W----1 root TTY 4, 55 July 17:12 tty55

CRW--W----1 root TTY 4, 56 July 17:12 tty56

CRW--W----1 root TTY 4, 57 July 17:12 tty57

CRW--W----1 root TTY 4, 58 July 17:12 tty58

CRW--W----1 root TTY 4, 59 July 17:12 tty59

Main device number, secondary device number

The main device number is the identity of the kernel that identifies a device. is an integer that generally uses 1 to 255.

The secondary device number is the driver itself used to differentiate multiple devices. is an integer that generally uses 0 to 255.

4, Pipeline file

Pipeline files are sometimes referred to as FIFO files (FIFO is the first-in-one-out meaning), and the pipe file is flowing from the one to the other.

Use the following command to see that the first character of a file property is "P", so that the file is a pipe file.

--------------------------------------------------------------------

Ls-l/var/run/autofs.fifo-misc

PRW-------1 root root 0 July 1817:13/var/run/autofs.fifo-misc

Mkfifo Creating a pipeline file

5, Link file

There are two types of linked file types: soft-link files and hard-link files.

A soft link file is also called a symbolic link file, similar to the Windows shortcut is a shortcut to the soft connection to read and write operations, the system will automatically convert the operation to the source file, but delete the linked file, the system only delete the linked file, not delete the source file itself.

You can see from the following example that the first character of the file attribute is "L", so that the file is a soft connection file.

---------------------------------------------------------------------

Ls-l/etc/system-release

lrwxrwxrwx. 1 root root 14 July 1712:04/etc/system-release-Oracle-release

Hard link file

Link is a file in the presence of another file, the hard-link file read and write and delete operations, the results and soft links are the same, but if you delete the hard-link file source file, the hard-link file still exists, and retains the original content, this is, the system "forgot" he was a hard link, and it as a normal file.

Linux Commands learn the next day

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.