Ubuntu command

#svn command
svn co address defineName
svn info
svn st
svn ci  javascript/comprofile.js -m'fixed brand alert defect'
svn st (svn status path)
#After the change in .bashrc
#mci means the command of mvn clean install
#mee means the command of mvn eclipse:eclipse

#modify the hosts file,used for DNS (domain name resolution )
cat etc/hosts
sudo gedit /etc/hosts

#alias command
~/.bashrc file is used for defining the alias command.
alias mci='mvn clean install -Dmaven.test.skip'
alias mee='mvn eclipse:eclipse'

#find something in file which is used vi to open.
use vi command to open file, and press / to put the pattern string to find the matched string.

#unzip tar file
tar xvzf
tail -n -500f one.log
tail -f 命令可用于监视另一个进程正在写入的文件的增长。
tail -n Number 从首行或末行位置来读取指定文件,位置由 Number 变量的符号(+ 或 - 或无)表示
http://hi.baidu.com/fx1168/blog/item/b358a8510fe4fd2243a75b4b.html

#more command
more,类似 cat,不过会以一页一页的显示方便使用者逐页阅读,而最基本的指令就是按空白键(space)就往下一页显示,按 b 键就会往回(back)一页显示,而且还有搜寻字串的功能(与 vi 相似),使用中的说明文件,请按 h 。

#Use svn to compare with each other file
select a file and press the ctrl,select another file and click the right key to each other of compare list.

#make apahce of 64bit available
chown root:root httpd/ -r
chown root:root.This command changes the ownership of some installed files, the result of building the package as a user other than root
chmod +s httpd/ -r
chmod +s:

  s 在文件执行时把进程的属主或组ID置为该文件的文件属主。

       方式“u+s”设置文件的用户ID位,“g+s”设置组ID位。


On POSIX-compliant and UNIX systems, this stands for setuid on execution or setgid on execution permission. On Windows systems, this stands for a system file.
=====
我将要文件给一个peter的人
在我的电脑上输入
sftp [email protected]
password:
put filename
10.16.74.1是对方的ip,然后让对方输入密码,接下来我就可以将文件put到peter的home目录。

sudo tar xvzf apache2.tar.gz –C /usr/local
将解压的文件copy到/usr/local目录下

====

#!/bin/bash

# check if root run the script
if [ `id -u` = 0 ]
then
    echo "****************************************************"
    echo "*Error: root (the superuser) can't run this script.*"
    echo "****************************************************"   
    exit 1
fi

# determine base directory; preserve where you're running from
cd `dirname $0`/..
BASE=`pwd`

chmod +x $BASE/bin/ -R

$BASE/bin/jbossctl start
the below is comment:

# check if root run the script
if [ `id -u` = 0 ]
then
    echo "****************************************************"
    echo "*Error: root (the superuser) can't run this script.*"
    echo "****************************************************"   
    exit 1
fi

note:
http://www.basicconfig.com/linux-commands/linux-id-command-tutorial


2.
# determine base directory; preserve where you're running from
cd `dirname $0`/..
BASE=`pwd`

note:
$0当前Shell程序的文件名
dirname $0,获取当前Shell程序的路径
cd `dirname $0`,进入当前Shell程序的目录

3.linux中shell变量$#,$@,$0,$1,$2的含义解释
http://www.itwis.com/html/os/linux/20100202/7373.html

猜你喜欢

转载自forrest420.iteye.com/blog/942913