No.4使用Linux基本命令
- 格式:ppt
- 大小:2.02 MB
- 文档页数:43


实训项目2 Linux基本命令一、实训目的●掌握Linux各类命令的使用方法;●熟悉Linux操作环境。
二、实训内容练习使用Linux常用命令,达到熟练应用的目的。
三、实训步骤子项目1.文件和目录类命令的使用(1)启动计算机,利用root用户登录到系统,进入字符提示界面。
练习使用cd命令(2)用pwd命令查看当前所在的目录。
pwd命令用于显示用户当前所在的目录。
如果用户不知道自己当前所处的目录,就可以使用这个命令获得当前所在目录(3)用ls命令列出此目录下的文件和目录。
然后,使用ls命令,并用-a选项列出此目录下包括隐藏文件在内的所有文件和目录。
最后,用man命令查看ls命令的使用手册。
补充说明浏览信息内容:(以下面图片为例)1 2 3 4 5 6 7 8 9 10 111属性:- 代表文件,l代表链接文件,d代表目录2 所有者权限(文件权限):具有r 读w 写没有x 执行3 同组用户权限(文件权限):只读r4 其他人权限(文件权限):只读r5 链接数:16 文件拥有者:root7 文件所属组:root8 文件大小:8字节9 创建或修改日期:2月21日10 创建或修改时间:18:4211 文件或目录名称(4)在当前目录下,创建测试目录test。
利用ls或ll命令列出文件和目录,确认test 目录创建成功。
然后进入test目录,利用pwd查看当前工作目录。
mkdir命令用于创建一个目录。
该命令的语法为:mkdir [参数] 目录名常用参数–p:如果父目录不存在,则同时创建该目录及该目录的父目录。
(5)利用cp命令复制系统文件/etc/profile到当前目录下。
# cp /etc/profile .(6)复制文件profile到一个新文件profile.bak,作为备份。
# cp profile profile.bak(7)用ll命令以长格形式列出当前目录下的所有文件,注意比较每个文件的长度和创建时间的不同。
Linux命令大全完整版目录目录 (I)1. linux系统管理命令 (1)adduser (1)chfn(change finger information) (1)chsh(change shell) (1)date (2)exit (3)finger (4)free (5)fwhois (5)gitps(gnu interactive tools process status) (5)groupdel(group delete) (6)groupmod(group modify) (6)halt (7)id (7)kill (8)last (8)lastb (8)login (9)logname (9)logout (9)logrotate (9)newgrp (10)nice (10)procinfo(process information) (11)ps(process status) (11)pstree(process status tree) (14)renice (15)rlogin(remote login) (16)rsh(remote shell) (16)rwho (16)screen (17)shutdown (17)sliplogin (18)su(super user) (18)sudo (19)suspend (19)swatch(simple watcher) (20)tload (20)top (21)uname (21)useradd (22)userconf (22)userdel (23)usermod (23)vlock(virtual console lock) (24)w (24)who (25)whoami (25)whois (25)2. linux系统设置命令 (27)alias (27)apmd(advanced power management BIOS daemon) (27)aumix(audio mixer) (27)bind (29)chkconfig(check config) (29)clock (30)crontab (31)declare (31)depmod(depend module) (32)dircolors (32)dmesg (33)enable (33)eval (33)export (33)fbset(frame buffer setup) (34)grpconv(group convert to shadow password) (35)grpunconv(group unconvert from shadow password) (35)hwclock(hardware clock) (35)insmod(install module) (36)kbdconfig (36)lilo(linux loader) (37)liloconfig (38)lsmod(list modules) (38)minfo (38)mkkickstart (39)modinfo(module infomation) (39)modprobe(module probe) (39)mouseconfig (40)ntsysv (41)passwd(password) (41)pwconv (41)pwunconv (42)rdate(receive date) (42)resize (42)rpm(redhat package manager) (43)set (46)setconsole (47)setenv(set environment variable) (48)setup (48)sndconfig (48)SVGAText Mode (49)timeconfig (49)ulimit (50)unalias (50)unset (51)3. linux文档编辑命令 (52)col (52)colrm(column remove) (52)comm(common) (52)csplit(context split) (53)ed(editor) (53)egrep (54)ex (54)fgrep(fixed regexp) (54)fmt(fromat) (54)fold (55)grep (55)ispell(interactive spelling checking) (57)jed (58)joe (58)join (60)look (61)mtype (61)rgrep(recursive grep) (62)sed(stream editor) (63)sort (64)spell (65)tr(translate character) (65)uniq (65)wc(word count) (66)4. linux压缩备份命令 (67)ar (67)bunzip2 (68)bzip2 (68)bzip2recover (69)compress (69)cpio(copy in/out) (70)dump (72)gunzip(gnu unzip) (73)gzexe(gzip executable) (74)gzip(gnu zip) (74)lha (75)restore (76)tar(tape archive) (77)unarj (80)unzip (81)zip (82)zipinfo (83)5.linux文件管理命令 (85)diff(differential) (85)diffstat(differential status) (86)file (87)git(gnu interactive tools) (90)gitview(gnu interactie tools viewer) (91)ln(link) (91)locate (92)lsattr(list attribute) (92)mattrib (93)mc(midnight commander) (93)mcopy (94)mdel (94)mktemp (95)mmove (95)mread (95)mren (96)mshowfat (96)mtools (96)mtoolstest (96)mv (97)od(octal dump) (97)paste (98)patch (99)rcp(remote copy) (101)rhmask (101)rm(remove) (101)slocate(secure locate) (102)split (102)tee (103)tmpwatch(temporary watch) (103)touch (103)umask (104)which (105)cat (105)chattr(change attribute) (106)chgrp(change group) (106)chmod(change mode) (107)chown(change owner) (108)cksum(check sum) (109)cmp(compare) (109)cp(copy) (110)cut (111)indent (111)6.linux文件传输命令 (115)bye (115)ftp(file transfer protocol) (115)ftpcount (115)ftpshut(ftp shutdown) (115)ftpwho (116)ncftp(nc file transfer protocol) (116)tftp(trivial file transfer protocol) (116)uucico (116)uucp (117)uupick (118)uuto (119)7. linux磁盘管理命令 (120)cd(change directory) (120)df(disk free) (120)dirs (121)du(disk usage) (121)edquota(edit quota) (122)lndir(link directory) (123)ls(list) (123)mcd (125)mdeltree (125)mdu (126)mkdir(make directories) (126)mlabel (126)mmd (127)mmount (127)mrd (127)mzip (127)pwd(print working directory) (128)quota (128)quotacheck (128)quotaoff (129)quotaon (129)repquota(report quota) (130)rmdir(remove directory) (130)rmt(remote magnetic tape) (130)stat(status) (131)Tree (131)umount (132)8. linux磁盘维护命令 (133)badblocks (133)cfdisk (133)dd (134)e2fsck(ext2 file system check) (134)ext2ed(ext2 file system editor) (136)fdisk (137)fsck.ext2(file system check-second filesystem) (137)fsck(file system check) (138)fsck.minix(file system check-minix filesystem) (139)fsconf(file system configurator) (139)hdparm(hard disk parameters) (139)losetup(loop setup) (141)mbadblocks (141)mformat (141)mkbootdisk(make boot disk) (142)mkdosfs(make Dos file system) (143)mke2fs(make ext2 file system) (143)mkfs.ext2 (144)mkfs(make file system) (144)mkfs.minix (145)mkfs.msdos (145)mkinitrd(make initial ramdisk images) (145)mkisofs(make iso file system) (145)mkswap (147)mpartition (148)sfdisk (148)swapoff (149)swapon (149)symlinks(symbolic links) (149)sync (150)9. linux网络通讯命令 (151)dip (151)getty(get teletypewriter) (151)mingetty (152)ppp-off (152)smbd(samba daemon) (152)telnet (153)uulog (154)uustat (154)uux (155)cu(call up) (156)dnsconf(dns configurator) (157)efax (158)httpd(http daemon) (159)ifconfig (159)mesg (160)minicom (161)nc (161)netconf (162)netstat (162)ping (163)pppstats(point to point protocol status) (164)samba (164)setserial (165)shapecfg(shaper configuration) (165)smbd(samba daemon) (166)statserial(status ofserial port) (166)talk (166)Tcpdump (167)testparm(test parameter) (168)traceroute (168)tty(teletypewriter) (169)uuname (169)wall(write all) (170)write (170)ytalk (170)arpwatch(ARP watcher) (170)apachectl(Apache control interface) (171)smbclient(samba client) (171)pppsetup (172)10. linux电子邮件与新闻组命令 (173)archive (173)ctlinnd(control the internet news daemon) (173)elm (173)getlist (174)inncheck(inn check) (174)mail (175)mailconf (175)mailq(mail queue) (175)messages (176)metamail (176)mutt (177)nntpget (178)pine (178)slrn (180)11. linux其他命令 (181)reconfig (181)startx(start X Window) (181)xconfigurator (181)XF86Setup (182)xlsatoms (182)xlsclients (183)xlsfonts (183)yes (184)1. linux系统管理命令adduser功能说明:新增用户帐号。
linux 服务器常用操作命令1.基本命令- pwd:查看当前所在目录- ls:列出当前目录下的文件和文件夹- cd:切换目录- touch:创建文件- mkdir:创建新的目录- rm:删除文件或目录- cp:复制文件或目录- mv:重命名文件或目录,或移动文件或目录到其他位置- cat:查看文件内容- grep:在文件中搜索指定的字符串- find:查找文件并执行相应操作- chmod:修改文件和目录的权限- chown:修改文件和目录的所有者- top:实时查看系统的资源使用情况- ps:显示当前正在运行的进程信息2.文件操作- echo:输出文本内容到终端或文件- head:显示文件的前几行- tail:显示文件的后几行- less:按页查看文件内容- wget:下载文件- tar:打包和解压文件- gzip:压缩文件- unzip:解压缩文件- file:查看文件类型- scp:在本地和远程服务器之间进行文件传输- sftp:通过SSH协议在本地和远程服务器之间进行文件传输3.网络相关- ifconfig:显示网络接口配置信息- ping:测试与指定主机的连通性- netstat:显示网络连接、路由表和网络接口信息- ssh:建立安全的远程登录连接- telnet:建立与远程主机的非安全连接- nslookup:域名解析工具- traceroute:显示数据包在网络上的传输路径- ifup/ifdown:启用/禁用网络接口- iptables:配置防火墙规则4.系统管理- uname:显示系统信息- whoami:显示当前用户- id:显示用户信息- date:显示系统日期和时间- uptime:显示系统的运行时间和平均负载- free:显示内存的使用情况- df:显示磁盘空间的使用情况- du:查看文件和目录的磁盘使用情况- kill:关闭指定进程- reboot:重启系统- shutdown:关闭系统5.用户和权限管理- useradd:创建用户- userdel:删除用户- passwd:修改用户密码- su:切换用户- sudo:以超级用户权限执行命令- visudo:配置sudo的访问权限- chattr:修改文件属性- addgroup:创建用户组- delgroup:删除用户组- chmod:修改文件和目录的权限- chown:修改文件和目录的所有者6.日志管理- tail:实时显示日志文件的最后几行内容- cat:显示整个日志文件的内容- grep:在日志文件中搜索指定的字符串- systemctl:管理系统服务- journalctl:查看系统日志7.进程管理- ps:显示当前正在运行的进程信息- top:实时查看当前系统进程的资源占用情况- kill:终止指定进程- nice:调整进程的优先级- nohup:在后台运行命令,不受终端断开影响- renice:修改进程的优先级这些是Linux服务器常用的操作命令,能够实现大部分日常操作和系统管理任务。