350个linux命令详解

浏览:24日期:2022-07-29
COMMAND 命令DESCRIPTION 注解System information系统信息archshow architecture of machine 显示主机的体系结构uname -rshow used kernel version 显示kernel版本信息dmidecode -qshow hardware system components - (SMBIOS / DMI) 显示硬件系统部件hdaparm -i /dev/hdadisplays the characteristics of a hard-disk 显示某一硬盘特点hdparm -tT /dev/sdaperform test reading on a hard-disk 执行某一硬盘读取测试cat /proc/cpuinfoshow information CPU info 显示CPU信息cat /proc/interruptsshow interrupts 显示中断信息cat /proc/meminfoverify memory use 核实内存使用情况cat /proc/swapsshow file(s) swap 显示文件swap情况cat /proc/versionshow version of the kernel 显示kernel版本信息cat /proc/net/devshow network adpters and statistics 显示网络信息cat /proc/mountsshow mounted file system(s) 显示挂载系统信息lspci -tvdisplay PCI devices 显示PCI设备lsusb -tvshow USB devices 显示USB设备dateshow system date 显示系统日期cal 2007show the timetable of 2007 显示2007年日历date 041217002007.00 set date and time- MonthDayhoursMinutesYear.Second设置时间和日期 - 格式:月日时分年.秒clock -wsave changes on BIOS 保存BIOS设置linux commands line v1.0 - LinuxGuide.it linux命令详解翻译 - moon-blog.cn COMMAND 命令DESCRIPTION 注解 Shutdown, Restart of a system and Logout系统关机,重启或注销shutdown -h nowshutdown system关闭系统init 0 shutdown -r hours:minutes planned shutdown of the system定时关机shutdown -ccancel a planned shutdown of the system取消定时关机shutdown -r nowreboot重启系统rebootlogoutleaving session注销用户linux commands line v1.0 - LinuxGuide.it linux命令详解翻译 - moon-blog.cn COMMAND 命令DESCRIPTION 注解 Files and Directory 文件及目录cd /homeenter to directory '/ home'进入/home目录cd ..go back one level向上返回一个目录cd ../..go back two levels向上返回两个目录cdgo to home directory前往/home目录cd ~utentego to home directory前往/home目录cd -go to previous directory进入先前所在目录pwdshow the path of work directory显示目录路径lsview files of directory显示目录内包含的文件ls -Fview files of directory显示目录内包含的文件ls -lshow details of files and directory显示目录内文件的详细信息ls -ashow hidden files显示隐藏文件ls *[0-9]*show files and directory containing number显示目录内包含有数字的文件lstreeshow files and directories in a tree starting from root以树形显示文件mkdir dir1create a directory called 'dir1'建立dir1目录mkdir dir1 dir2create two directories simultaneously建立两个目录mkdir -p /tmp/dir1/dir2create a directory tree建立目录树rm -f file1delete file called 'file1'删除名为file1的文件rmdir dir1 delete directory called 'dir1'删除名为dir1的目录rm -rf dir1remove a directory called 'dir1' and contents recursively删除dir1目录及所含文件rm -rf dir1 dir2remove two directories and their contents recursively删除dir1 dir 2两个目录及所含文件mv dir1 new_dirrename / move a file or directory重命名/移动 文件或文件夹cp file1 file2copying a file复制文件cp dir/* .copy all files of a directory within the current work directory复制目录及目录内所有文件到当前目录cp -a /tmp/dir1 .copy a directory within the current work directory复制目录到当前目录cp -a dir1 dir2copy a directory复制目录ln -s file1 lnk1 create a symbolic link to file or directory建立文件或目录的符号链ln file1 lnk1create a physical link to file or directory建立文件或目录的物理链touch -t 0712250000 fileditestmodify timestamp of a file or directory- (YYMMDDhhmm)修改文件或目录的时间戳 - 格式:YYMMDDhhmmlinux commands line v1.0 - LinuxGuide.it linux命令详解翻译 - moon-blog.cn COMMAND 命令DESCRIPTION 注解 File search 文件搜索find / -name file1search file and directory into root filesystem from '/' 在 / 目录中搜索文件或目录find / -user user1search files and directories belonging to 'user1'搜索属于user1的文件和目录find /home/user1 -name *.binsearch files with '. bin' extension within directory '/ home/user1' 在/home/user1目录内搜索包含有.bin的文件find /usr/bin -type f -atime +100search bynary files are not used in the last 100 days 搜索100天未用的文件find /usr/bin -type f -mtime -10search files created or changed within 10 days搜索10天内创建或更改的文件find / -name *.rpm -exec chmod 755 {} ;search files with '.rpm' extension and modify permits搜索带有修改属性的.rpm的文件find / -name *.rpm -xdevsearch files with '.rpm' extension ignoring removable partitions as cdrom, pen-drive, etc.…搜索全属性的.rpm的文件locate *.psfind files with the '.ps' extension - first run 'updatedb' command 搜索扩展名为.ps的文件 - 需要先运行updatedb命令whereis haltshow location of a binary file,source or man 搜索halt的路径which haltshow full path to a binary / executable 取得halt列表并寻找当halt作为命令给定时所运行的文件linux commands line v1.0 - LinuxGuide.it linux命令详解翻译 - moon-blog.cn COMMAND 命令DESCRIPTION 注解 Mounting a Filesystem 挂载文件系统mount /dev/hda2 /mnt/hda2mount disk called hda2 - verify existence of the directory '/ mnt/hda2'挂载名为hda2的硬盘设备umount /dev/hda2unmount disk called hda2 - exit from mount point '/ mnt/hda2' first 取消挂载名为hda2的硬盘设备fuser -km /mnt/hda2force umount when the device is busy 强行取消挂载设备umount -n /mnt/hda2run umount without writing the file /etc/mtab - useful when the file is read-only or the hard disk is full 不记录挂载信息直接取消挂载 - 当硬盘为只读或硬盘已满时很实用mount /dev/fd0 /mnt/floppymount a floppy disk 挂载软盘mount /dev/cdrom /mnt/cdrommount a cdrom / dvdrom 挂载CDrom或DVDrommount /dev/hdc /mnt/cdrecordermount a cdrw / dvdrom 挂载CD-RW或DVDrommount /dev/hdb /mnt/cdrecordermount a cdrw / dvdrom 挂载CD-RW或DVDrommount -o loop file.iso /mnt/cdrommount a file or iso image 挂载一个文件或ISO光盘镜像mount -t vfat /dev/hda5 /mnt/hda5mount a Windows FAT32 file system 挂载windows FAT32文件系统mount /dev/sda1 /mnt/usbdiskmount a usb pen-drive or flash-drive 挂载USB闪存设备mount -t smbfs -o username=user,password=pass //winclient/share /mnt/sharemount a windows network share 挂载windows网络共享linux commands line v1.0 - LinuxGuide.it linux命令详解翻译 - moon-blog.cn
标签: Linux系统
相关文章: