1.linux查看组
cat /etc/group
2.如何看linux是32位还是64位
uname -a
如果看到是i386之类的,就是32位;如果是x86_64,则是64位的
参考链接:http://tieba.baidu.com/p/820576856
3.linux查找命令:
find /etc -name "passwd*"
3.1 按照内容查找
#在etc目录下查找所有文件中含有hello abcserver的文件 find /etc -name "*" | xargs grep "hello abcserver"
4.linux查看GCC版本命令:
cat /proc/version (这个显示结果包含gcc版本)
5.linux查看组命令:
cat /etc/group
6、linux查看用户命令:
cat /etc/passwd
7、linux修改IP 生效
sudo ifdown eth0 关闭
sudo ifup eth0 生效。
8、linux kill/killall
利用 ps -ef|grep httpd查看所有的进程id号
然后利用Kill id来杀死进程。
但是如果进程太多的话,用这个得一个一个删除,较慢
此时我们可以用killall 进程名来结束进程。
9、linux复制文件夹命令(将当前目录下go目录)
9.1) 简易版:cp -ri source/* target/ (必须先创建target)
9.2) 给力版:cp -r source target(不需要创建target)
一般情况下,都用9.2比较爽。
10、linux重命名,用mv命令,和移动那个命令一样。
11、Linux解压命令,用unzip
1)unzip ADMS_WEBSERVICE.zip
在windows下面压缩成zip后,在linux端解压需要用到此命令。
如果不加上压缩到哪个目录,则压缩到当前目录,不用担心,它会以压缩包名称重新建一个文件夹。
2)如果想要解压到某个目录下,则用-d参数
unzip text.zip -d /tmp
refurl:http://www.linuxso.com/command/unzip.html
12、linux压缩命令:
tar czvf ADMS_WEBSERVICE.tar.gz ADMS_WEBSERVICE/
我们最常用的就是把某个文件夹进行一个备份,此时用tar非常方便,加上参数czvf,然后加上期待生成的文件名称即可。
解压缩:
tar xzvf tomcat_admin.tart.gz
注意到:c是创建的意思,x是解压的意思。
refurl:http://blog.csdn.net/dzassn/article/details/1623360
13、删除文件命令
rm -f xx.zip
14、删除文件夹命令
rm -rf xxxx
15、netstat -anp|grep 9217,注意:查看端口请用下面这个命令
想要查看端口号为9217的进程ID,用上述命令
16、如果mysql在ubuntu上服务停止了。可以用命令:service mysql start
17、查看ubuntu监听某个端口。命令:netstat -an |grep 3306
18、关掉ubuntu防火墙,用ufw disable. 查看防火墙状态用ufw status.
16、linux设置系统时间:
将日期设置成2009年5月10号
#date -s 05/10/2009
将日期设置成10:18:00
#date -s 10:18:00
格式化显示系统日期,用如下命令:date -R
http://blog.csdn.net/zztp01/article/details/5207771
17、root为某个用户改密码:
假设为zhangsan改密码,利用passwd zhangsan即可。
输入2次,2次输一样的就行。
18、centos5如何切换用户:
如root切换到git用户,su - git即可。
参考链接:http://jingyan.baidu.com/article/e2284b2b3cea8ae2e6118de1.html
19、ls如何分页
ls -l | less -r
参考链接
19.1 less如何翻页,用空格,参考链接
20、linux反向查找:
grep -n 'something' file | tail -n 1
比如grep -n 'hello' nono.log | tail - n1
refurl:http://zhidao.baidu.com/question/195156345.html
20.1 ubuntu创建文件,用touch命令即可
参考链接:http://wandejun1012.iteye.com/admin/blogs/2066435
20.2 ubuntu关机:
shutdown -h 0
21、查看git存放在哪,输入命令:whereis git即可。
22、查看ubuntu版本,用命令:lsb_release -a
23、ubuntu查看系统环境变量,输入形如下命令:echo $JAVA_HOME
24、ubuntu查看是32位还是64位,用命令:uname -m
1)修改ubuntu计算机名称(需要重启)
1、sudo vim /etc/hostname 2、sudo vim /etc/hosts
25、32位ubuntu安装jdk8
参考链接:http://wandejun1012.iteye.com/blog/1903804
-------------------------------------------------------------------------------------------
http://zhidao.baidu.com/link?url=ITyPfHHuyn7V_XAvSK_9ogS0b3AomBGUy8zibsR5u0NIH8yUk5-kYwrMp9RJ6reiWQG0wJhIJrwTYL8-9sPX3K 教我们如何识别linux是32位还是64位的
http://www.cnblogs.com/wanqieddy/archive/2011/06/09/2076785.html find命令参照
http://os.chinaunix.net/a2008/1005/987/000000987543.shtml 查看gcc版本命令
http://bbs.51cto.com/thread-789908-1.html 如何关闭网卡/启用网卡
http://www.2cto.com/os/201204/129021.html 结束进程详解。
refurl:http://lichen.blog.51cto.com/697816/210787 通过端口号查询进程
ubuntu查看版本。http://zhidao.baidu.com/question/154707237.html
ubuntu查看系统环境变量。http://os.51cto.com/art/201005/202463.htm
格式化显示系统日期。http://os.51cto.com/art/201312/425028.htm