一些简单的Linux命令

这些命令仅是在工作中的linux机器上运行正常的,在其他系统中正常与否有待验证。

ubuntu:sudoapt-getinstall

GNU/linux:sudoyuminstall

uname[-amnrsv][–help][–version]

显示系统信息http://zhidao.baidu.com/question/39995251

pwd

打印当前目录的路径

grepMemTotal/proc/meminfo

显示机器的内存

grepSwapTotal/proc/meminfo

thesizeoftheconfiguredswapspace

free

显示内存空间和交换空间

df-k/tmp

显示一个目录下硬盘空间,没有目录的话显示系统

cat/proc/version

查看linux安装的版本

echo$shell

查看当前shell

chmod777file/folder

修改文件(夹)权限

zip-rfilename.zipfolderfile

压缩文件到zip中

unzipfile_name.zip(-dfilepath)

gunzipfilename.cpio.gz

解压缩文件(到指定目录)

unzip*.ear

解压缩ear文件

zip与unzip命令详细参考http://www.cnblogs.com/chinareny2k/archive/2010/01/05/1639468.html

jar-cvf<<ear-name>><<fileswanttobeintheear>>

产生.ear文件

cp-r[f]folder1folder2

拷贝文件夹

suusername

切换用户

/usr/local/packages/aime/ias/run_as_root(command)

以root身份运行命令

/usr/local/packages/aime/ias/run_as_root"bash"切换到root

/usr/local/packages/aime/ias/run_as_root"vi/etc/passwd"

更改主目录,将/home/username替换为新设置的主目录

设置变量值:

csh:setANT_HOME="/scratch/user/Oracle/ant"

setPATH=${PATH}";/home/user"(根据我的经验仅当前shell有效)

bash:exportANT_HOME="/scratch/user/Oracle/ant"

exportPATH=$PATH:${ANT_HOME}/bin(跨shell也保留,但是只当前窗口有效)

ANT安装:http://ant.apache.org/manual/install.html

linux下bash中提示符颜色的设置

vi.bashrc

http://sxpspace.blogspot.com/2009/04/shell.html

netstat-nlp

查看端口情况p程序l监听socktesn数值的主机端口和用户

ADE中已经安装vnc后:

vncserver启动vnc

vncpassword设置密码

~/.vnc/xstartup里可以设置vncserver的属性

vncconfig-nowin&解决vnc主客机的相互复制问题

vncserver:1-geometry1280x960端口以及分辨率

    Start vnc by executing the "vncserver" script.vncserverVNC will prompt you for a password the first time this script is run. This is the password used to connect to the machine from a vncviewer. I suggest NOT using your SSO password because you may want to share the VNC session with someone.By default, the vncserver command starts the window manager not a KDE desktop. Therefore, kill the Xvnc process and then edit the command file as described in the following steps.ps -ef | grep Xvnc // find the Xvnc process id.kill <pid>cd .vnc (notice the DOT in the directory name)vi xstartup // edit the vnc startup script – emacs is also on the machine if you preferchange "twm &" to "startkde &" and save the fileExecute the "vncserver" command again. Now a KDE desktop will start (it takes a few minutes).Using vncviewer // TightVNC downloadconnect to the machine. You now have a remote desktop for development.If you run "konsole &" from the desktop, it gives you as many shells as you want in the same terminal window.

如果困难是堵砖墙,拍拍它说你还不够高。

一些简单的Linux命令

相关文章:

你感兴趣的文章:

标签云: