Linux basic commands

Source: Internet
Author: User

Linux Shutdown and Boot

#shutdown [Options] Time

Option:-C: Cancel the previous shutdown command-H: Shutdown-r: Restart

Time: Now to perform six-point restart at 06:00 a.m.

#shutdown-R &: 6 o'clock in the morning reboot, background execution, press ENTER can continue to do things, if the last not add &, the interface lock, nothing can do

#shutdown-C: Cancel the previous restart command

#shutdown-H Now: Shut down immediately

Other shutdown commands (less secure, data may be lost):

1. #halt

2. #poweroff

3. Init 0

Other Restart commands:

1, reboot

2, Init 6 (not recommended)

System operating level:

0-Power off 1-Single user 2-incomplete user, without NFS service 3-Full multiuser 4-Unassigned 5-graphical interface 6-restart

Query the current operating level of the system: #runlevel

#cat/etc/inittab: Modify the system default run level Id:3:initdefault: (Boot into character interface)

Exit Login Command: Logout

Linux Mount commands

#mount: Querying devices that are already mounted in the system

#mount-A: Automatically mounts based on the contents of the/etc/fstab profile

#mount [-t file system] [-o Special Options] device mount name mount point

Options:

-T File system: Add File system and other types to make mount type, can ext3, Ext4, iso9660 and other file system

-O Special option: You can specify additional options for mounting

Example: #mount-o remount,noexec/home: Using the Noexec

#cd/Home #vi hello.sh (#! /bin/bash echo "Hello") #chmod 755 hello.sh

#./hello.sh Run error prompt does not have permission to re-modify Mount command: #mount-o remount,exec/home

To mount a disc:

#ls/dev Sr0 is the system's own

1, set up mount point: #mkdir/mnt/cdrom (an empty directory, the equivalent of Windows inserted u disk letter)

2. Mount disc: #mount-T iso9660/dev/cdrom/mnt/cdrom/

#mount/dev/sr0/mnt/cdrom/to mount the device/dev/sr0 to the/mnt/cdrom/directory

Uninstall command

#umount device file name or mount point

such as: Exit the/mnt/cdrom directory to uninstall #umount/mnt/cdrom or (/dev/sr0) #pwd查看目录

Mount USB Drive

#fdisk-L View USB drive device file name

#mount-T vfat/dev/sdb1/mnt/usb/

Note: The NTFS file system is not supported by default on Linux (mounting the removable hard disk does not work, you have to recompile the kernel to support NTFS)

Viewing logged-in user information

1. #w

2. #who

3, #last查询当前登录和过去登录的用户信息 (default read/var/log/wtmp file data)

4, #lastlog query the last logon time for all users (default read/var/log/lastlog file data)

Linux basic commands

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.