1.查看内存和释放内存:
查看内存:free -m
释放内存:echo 1 > /proc/sys/vm/drop_caches
2.查看用户和用户组:
cat /etc/passwd
结果如下:
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
abrt:x:173:173::/etc/abrt:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
saslauth:x:499:76:Saslauthd user:/var/empty/saslauth:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
apache:x:48:48:Apache:/var/www:/sbin/nologin
zookeeper:x:498:498:ZooKeeper:/var/lib/zookeeper:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
solr:x:497:497:Solr:/var/lib/solr:/sbin/nologin
hbase:x:496:496:HBase:/var/lib/hbase:/sbin/nologin
hive:x:495:495:Hive:/var/lib/hive:/sbin/nologin
sentry:x:494:494:Sentry:/var/lib/sentry:/sbin/nologin
hdfs:x:493:492:Hadoop HDFS:/var/lib/hadoop-hdfs:/bin/bash
yarn:x:492:491:Hadoop Yarn:/var/lib/hadoop-yarn:/bin/bash
impala:x:491:490:Impala:/var/lib/impala:/bin/bash
mapred:x:490:489:Hadoop MapReduce:/var/lib/hadoop-mapreduce:/bin/bash
hue:x:500:500::/home/hue:/bin/bash
3. vim 撤销、回退操作:
u:撤销上一步的操作;
Ctrl+r:恢复上一步被撤销的操作。
4. 查看IP地址和对应端口号,目的是查看某个端口号是绑定的IP的值:
netstat -nlp | grep 50070
这里查看到50070绑定的是127.0.0.1,还是192.168.8.100
5. 查看java进程:
把以下的自定义命令写到/etc/profile中:
alias jpsv="jps | grep -v Jps | grep -v 'process information unavailable'"
6.