Common Linux commands required by programmers

Source: Internet
Author: User

This article by larrylgq prepared, reproduced please note the Source: http://blog.csdn.net/larrylgq/article/details/7395261
Author: Lu guiqiang
Email: larry.lv.word@gmail.com

Upper: http://blog.csdn.net/larrylgq/article/details/7333632

Frequently-needed dependencies for newly installed Ubuntu Software

Sudo apt-get-F install libcryct-perl libgnome2-gconf-perl Libnet-proxy-perl libyaml-perl libcrypt-CBC-perl libcrypt-Rijndael-perl libio-stty-perl libcrypt-blowfish-perl libgtk2-gladexml-perl libgtk2-ex-simple-list-perl Libnet-ARP-perl libossp-UUID-perl
Libossp-uuid16

Disable SELinux

Modify SELinux = disabled in the/etc/SELinux/config file, and then restart the server.

Setenforce 1 sets SELinux to enforcing Mode

Setenforce 0 sets SELinux to permissive Mode

Disable Firewall

/Etc/init. d/iptables stop

DF-H

View hard disk Information

View System bits in Ubuntu

Uname-

Ubuntu allows you to view the number of digits supported by the machine.

Lshw

PS-Aux | grep Tomcat

View the port occupied by the program

Netstat
-APN | grep 8080

View the program using the port

Whereis MySQL

Find the installation directory of MySQL

Which MySQL
Find the MySQL running directory

VI ~ /. Add alias idea = "CD ~ to bashrc ~ /Idea117/bin; nohup./idea. Sh &"
Alias idea

Quick Start

[Root @ admaster ~] # Vi/etc/sysconfig/Network
Hostname = yourname
[Root @ admaster ~] # Vi/etc/hosts
127.0.0.1 localhost. localdomain localhost
172.17.33.169 yourname // modify the hostname here
[Root @ admaster ~] # Hostname supervisor2
[Root @ admaster ~] # Su
[Root @ supervisor2 ~] #

Modify the Linux host name and take effect immediately

VI/etc/profile

# System variable directory

: | Dd OF = fname seek = 1 bs =$ ($ (stat-C % s fname)-$ (tail-2 fname | WC-C )))
Delete the last few lines of oversized text

Hadoop jar panel. Jar refer-D mapred. Child. java. opts =-xmx2048m cookie View

# Modify JVM memory during hadoop Runtime

Java-jar ad4rmi. Jar 1> logad4mr. log 2> & 1

1: Standard output, 2: Error output

MV-f/home/admaster/ad4mr/*/home/hadoop/ad4mr

Copy an object

Nohup Java-Jar/home/hadoop/rmiserver/RMI. Jar &

Run your program in the background

PS aux | grep jar
Search for processes

More ~ User/. bash_history

View the historical commands of a user, but you only need the access permission.

SCP-p58404 usr@xx.xxx.xxx.XXX:/home/usr/ad4mr/*/home/hadoop/xxx

Copy files between machines

Cat www.csdn.net. SQL | grep LV

File Search

Mount-o rw xx. XXX:/data/report/data/Report

Hard Disk ing

Distinct

File deduplication

Chown

Change file user

Chmod-r 777 help.txt

Modify file permissions

Ln help.txt OK

Create shortcuts

Tail-N 24
View the last 24 lines of Files

Screen-s tagfreq // open a screen
CTRL + A and then press d

Screen-r 22879 // enter an opened Screen

Exit

Screen usage:

CAT/data/report/dist_c1606_m5/dist_.csv | awk-F, '{printf $1 ",-1, "$2" \ n "} '>/data/report/pool/1606.csv
Screen
Awk '{print ($1> 4? "High" $1: "low" $1)} 'file

Awk replaces the file content and formatting the output

Crontab-e
20 6 ***/bin/bash/home/test/10079.sh

Scheduled call

Http://example.com/really-big-file.iso wget-C

Download-c Indicates resumable upload.

Rm-RF

Recursively delete folders

Add Group

Addgroup hadoop

Add a user to a group

Adduser -- ingroup hadoop Larry

Add existing users to a group
Usermod-G hadoop Larry

Sudo passwd root #

Set Root Password

Su-

Export do-F/etc/sudoers

You can use sudo

Sudo apt-Get install Nautilus-open-terminal #

Right-click Terminal plug-in

Run the command $ groups user to view the group to which the user belongs.

Or view the file: $ CAT/etc/group.

To install a. Deb File

Sudo dpkg-I package_file.deb

To uninstall A. Deb File
Sudo dpkg-r package_name

Sudo apt-Get autoremove
Sudo apt-Get autoclean
Sudo apt-Get update
Sudo apt-Get upgrade
Sudo apt-Get dist-Upgrade
Update System

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.