Linux Command Line input summary, linux Command Line Summary

Source: Internet
Author: User
Tags hadoop fs

Linux Command Line input summary, linux Command Line Summary
Linux basic command input

New User: useradd [user name]; Change User name: usermod-l (Note: lowercase letter L) [user name you want] [Existing user name]

After modifying the user name, you must modify the group name. Modify group name: groupmod-n [newGroupName] [presentGroupName] Delete Username: userdel [user name to be deleted] display when Host Name: hostname display Host Name of the current computer Modify host name: use the vi editor to modify the network configuration file vi/etc/sysconfig/network.

Change the previous host name to the desired Host Name: vi/etc/hosts.

Modify the host name at the same time

Run the reboot command to restart the computer. Log On again to use hostname to view updates. View the current path: pwd; return from the root account to the general account [LittleLawson] command: su-l LittleLawson to update the database table: updatedb needs to use-p when creating the Parent and Child directories cyclically, for example, to create/usr/hadoop, if the file directory does not contain/usr, use-p

Command: hadoop fs-mkdir-p/usr/hadoop

Effect: A/usr/hadoop directory is generated to delete the Parent and Child directories cyclically. Use-r to view the Linux System Version: cat/etc/issue and change the File Permission: chmod 777 xxx.txt command vi ~ /. Bashrc has the same effect as command vi./. bashrc. Because ~ Home, '.' indicates the current directory. If the command vi ll cannot be used, and this happens again in the configuration file:/root /. the path in the bashrc file is modified, so the problem must be above this. It can be solved as follows: 1. enter: export PATH =/usr/bin:/usr/sbin:/bin:/sbin: /usr/X11R6/bin ensures that the command line command can be used temporarily. Do not close the terminal after the command is executed. 2. Input vi/etc/profile or vi/root/. bashrc in the command line to restore the path. Differences between yum and apt-get

Generally, the famous linux system is divided into two categories:

1) RedHat series: Redhat, Centos, Fedora, etc. 2). Debian series: Debian, Ubuntu, etc.

RedHat Series 1) common installation package format rpm package, command for installing rpm package is "rpm-parameter" 2) package management tool yum 3) support for tar package

Debian Series 1) common installation package format: deb package. The command for installing deb package is "dpkg-parameter" 2) package management tool apt-get 3) support for viewing files in tar package: use G to move the cursor to the last line. Use gg to move the cursor back to the first line. nG can move the cursor to the nth line. View hadoop node running status: hadoop dfsadmin-report view the last few lines of the file: tail [-nk] [file name]. Here,-nk is used to view the content of the file from the last row to the last row of the last row. View the first few lines of the file: head [-nk] [file name]. How to debug the bash Script: add the-xv parameter #! /Bin/bash: How to splice two strings: str1 = hello; str2 = world; str = S T R 1 "Role =" presentation "> Str1 S T R 1 Str2; echo str; execute the addition of two numbers:

1) expr 1 + 3 2) echo $[1 + 3] // here the echo is used to display the computation result 3) run the bc command-> enter an expression to check whether the file in a directory exists? Or a directory.

#!/bin/bash#check that the files exists.addr=/home/hadoop/test.txtif [ -d  $addr ]then echo $addr is a directoryelif [ -e  $addr ]then echo $addr is a filefi 

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.