加入收藏 | 设为首页 | 会员中心 | 我要投稿 源码网 (https://www.900php.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Unix > 正文

UNIX系统怎么用,常用的命令有哪些

发布时间:2022-11-06 14:32:07 所属栏目:Unix 来源:转载
导读: 查看文章
UNIX/Linux 常用命令参考2009-11-12 13:00findall the files under /etc directory with mail in the filename.
# find /etc -name "*mail*"
all the files in the system greate

查看文章

UNIX/Linux 常用命令参考2009-11-12 13:00findall the files under /etc directory with mail in the filename.

# find /etc -name "*mail*"

all the files in the system greater than 100MB.

# find / -type f -size +100M

all the files that were modified more than 60 days ago under the current directory.

# find . -mtime +60

delete all the archive files with extension *.tar.gz and greater than 100M

# find / -type f -name *.tar.gz -size +100M -exec rm -f {} \;

archive all the files that are not modified in the last 60 days

# find /home/jsmith -type f -mtime +60 | xargs tar -cvf /tmp/`date '+%d%m%Y'_archive.tar`

xargs# find ~ -name ‘*.log’ -print0 | xargs -0 rm -f

If you have a file with list of URLs that you would like to download,you can use xargs as shown below.

# cat url-list.txt | xargs wget –cdate格式化$ date

Thu Jan 1 08:19:23 PST 2009

$ date +"%d-%m-%Y"

01-01-2009

$ date +"%d/%m/%Y"

01/01/2009

# date -s 07/20/2009

# date -s 09:20:00

crontab设置计划任务cronjobcrontab -l 查看

crontab -e 编辑

grep (-i ignore case)# grep -i john /etc/passwd

jsmith:x:1082:1082:John Smith:/home/jsmith:/bin/bash

jdoe:x:1083:1083:John Doe:/home/jdoe:/bin/bash

cutDisplay 1st and 3rd field from a colon delimited file

$ cut -d: -f 1unix命令行,3 names.txt

Emma Thomas:Marketing

Alex Jason:Sales

Display only the first 8 characters of every line in a file

$ cut -c 1-8 names.txt

Emma Tho

系统服务管理# export LANG='en_US'

# setup 进入system service 选项

# chkconfig --level 2345 vsftpd on 开机自动启动服务

# /sbin/service start

# /etc/rc.d/init.d/ {start|stop|restart|condrestart|status}Change system booting level.Edit /etc/inittab file# vi /etc/inittab

# Default runlevel. The runlevels used by RHS are:

# 0 - halt (Do NOT set initdefault to this)

# 1 - Single user mode

# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)

# 3 - Full multiuser mode

# 4 - unused

# 5 - X11

# 6 - reboot (Do NOT set initdefault to this)

#

id:3:initdefault:Install VMware Tools

2. 以root用户装载VMware Tools虚拟光驱镜像并安装

# mount /dev/cdrom /mnt

# rpm -Uvh /mnt/VMwareTools-3.5.0-64607.i386.rpm

# umount /mnt

3. 配置VMware Tools

# vmware-config-tools.pl

(编辑:源码网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!