《linuxcommand》由会员分享,可在线阅读,更多相关《linuxcommand(30页珍藏版)》请在金锄头文库上搜索。
1、EnglishversionCOMMAND DESCRIPTIONGO TOP INDEX System informationarch show architecture of machine(1)uname -m show architecture of machine(2)uname -r show used kernel versiondmidecode -q show hardware system components - (SMBIOS / DMI)hdparm -i /dev/hda displays the characteristics of a hard-diskhdpa
2、rm -tT /dev/sda perform test reading on a hard-diskcat /proc/cpuinfo show information CPU infocat /proc/interrupts show interruptscat /proc/meminfo verify memory usecat /proc/swaps show file(s) swapcat /proc/version show version of the kernelcat /proc/net/dev show network adpters and statistics cat
3、/proc/mounts show mounted file system(s)lspci -tv display PCI deviceslsusb -tv show USB devicesdate show system datecal 2007 show the timetable of 2007date 041217002007.00 set date and time - MonthDayhoursMinutesYear.Secondsclock -w save date changes on BIOSlinux commands line list v1.2 - LinuxGuide
4、.it GO TOP INDEX Shutdown (Restart of a system and Logout ) shutdown -h now shutdown system(1)init 0 shutdown system(2)telinit 0 shutdown system(3)shutdown -h hours:minutes & planned shutdown of the systemshutdown -c cancel a planned shutdown of the systemshutdown -r now reboot(1)reboot reboot(2)log
5、out leaving sessionlinux commands line list v1.2 - LinuxGuide.it GO TOP INDEX Files and Directory cd /home enter to directory / homecd . go back one levelcd ./. go back two levelscd go to home directorycd user1 go to home directorycd - go to previous directorypwd show the path of work directoryls vi
6、ew files of directoryls -F view files of directoryls -l show details of files and directoryls -a show hidden filesls *0-9* show files and directory containing numberstree show files and directories in a tree starting from root(1)lstree show files and directories in a tree starting from root(2)mkdir
7、dir1 create a directory called dir1mkdir dir1 dir2 create two directories simultaneouslymkdir -p /tmp/dir1/dir2 create a directory treerm -f file1 delete file called file1rmdir dir1 delete directory called dir1rm -rf dir1 remove a directory called dir1 and contents recursivelyrm -rf dir1 dir2 remove
8、 two directories and their contents recursivelymv dir1 new_dir rename / move a file or directory cp file1 file2 copying a filecp dir/* . copy all files of a directory within the current work directorycp -a /tmp/dir1 . copy a directory within the current work directorycp -a dir1 dir2 copy a directory
9、ln -s file1 lnk1 create a symbolic link to file or directoryln file1 lnk1 create a physical link to file or directorytouch -t 0712250000 file1 modify timestamp of a file or directory - (YYMMDDhhmm)file file1 outputs the mime type of the file as texticonv -l lists known encodingsiconv -f fromEncoding
10、 -t toEncoding inputFile outputFilecreates a new from the given input file by assuming it is encoded in fromEncoding and converting it to toEncoding.find . -maxdepth 1 -name *.jpg -print -exec convert -resize 80x60 thumbs/ ;batch resize files in the current directory and send them to a thumbnails di
11、rectory (requires convert from Imagemagick)linux commands line list v1.2 - LinuxGuide.it GO TOP INDEX File search find / -name file1 search file and directory into root filesystem from /find / -user user1 search files and directories belonging to user1find /home/user1 -name *.bin search files with .
12、 bin extension within directory / home/user1 find /usr/bin -type f -atime +100 search binary files are not used in the last 100 daysfind /usr/bin -type f -mtime -10 search files created or changed within 10 daysfind / -name *.rpm -exec chmod 755 ; search files with .rpm extension and modify permitsf
13、ind / -xdev -name *.rpmsearch files with .rpm extension ignoring removable partitions as cdrom, pen-drive, etc.locate *.ps find files with the .ps extension - first run updatedb commandwhereis halt show location of a binary file, source or manwhich halt show full path to a binary / executablelinux c
14、ommands line list v1.2 - LinuxGuide.it GO TOP INDEX Mounting a Filesystem mount /dev/hda2 /mnt/hda2mount disk called hda2 - verify existence of the directory / mnt/hda2umount /dev/hda2 unmount disk called hda2 - exit from mount point / mnt/hda2 firstfuser -km /mnt/hda2 force umount when the device i
15、s busyumount -n /mnt/hda2run umount without writing the file /etc/mtab - useful when the file is read-only or the hard disk is fullmount /dev/fd0 /mnt/floppy mount a floppy diskmount /dev/cdrom /mnt/cdrom mount a cdrom / dvdrommount /dev/hdc /mnt/cdrecorder mount a cdrw / dvdrommount /dev/hdb /mnt/c
16、drecorder mount a cdrw / dvdrommount -o loop file.iso /mnt/cdrom mount a file or iso imagemount -t vfat /dev/hda5 /mnt/hda5 mount a Windows FAT32 file systemmount /dev/sda1 /mnt/usbdisk mount a usb pen-drive or flash-drivemount -t smbfs -o username=user,password=pass /WinClient/share /mnt/share mount a windows network sharelinux commands line list v1.2 - LinuxGuide.it GO TOP INDEX Disk Space df -h show list of par