Several Basic linux commands

Source: Internet
Author: User
Several Basic linux commands-general Linux technology-Linux technology and application information. For details, refer to the following section. Shutdown-h now
Sudo-sH
Shutdown-h now

Restart shutdown-r now

Reboot is not recommended for quick restart.
Init 0 shutdown init 6 reboot
Halt system downtime

Init 3 5 1 Text Graphics Single User Interface startup

Default home directory
/Home/username

Useradd username create row user
Passwd username add Password
/Etc/passwd

Device Installation
Mount-t iso9660/dev/cdrom/mnt/cdrom
File-type device file Mount directory
Unmount umount/mnt/cdrom

Soft drive mount-t fdtype/dev/fdo/mnt/floppy

Man command to view the command manual page
Info view Command help
Command-help

Mkdir
Rm-r-f
Rmdir empty directory
Pwd Current Directory

Cd
Cd. Enter the current directory
Cd .. go to the last directory
Cd ~ Go to your home directory
Cd-go to the last directory as shown in the figure, which is equivalent to the return value in windows.

Ls-r recursion-l details-I displays the node information of the file
Ls parameter path file name

Ln command to create a file Node
Ln-s file name-hardlink
Ln-s file name-softlink create a soft Node

More/less File Viewing file type
Cat displays the content of the specified file
Mv mobile
Target of the mv parameter Source Address
-If
Cp parameter source address objective
-F overwrite-I indicates whether to overwrite-R Recursion

Fsck disk repair
Fsck option device name
-F type of the file system to be checked
-R: Ask the user to confirm the response.
-N simulated display does not actually check
-P automatically fixes security corrections and does not cause loss of up to nine
Fsck-p-t ext2/dev/hda2

Find Path Options
Find/etc-name passwd

Grep option search mode file name
Grep parameter 'str' filelinst
-I case-insensitive
-R recursive search

Chmod changes File Access Permissions
Chmod (ugoa) (+-=) (rwx) file name path
Chmod g + w o-x/usr/local /*

Diff
Diff parameter file 2
-W ignore space difference-I ignore case Difference

Cmp
Compare any connected files
Cmp parameter file 2

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.