常用linux命令詳解

350個linux命令詳解
COMMAND 命令 DESCRIPTION 註解
System information
系統信息
arch show architecture of machine 
顯示主機的體系結構
uname -r show used kernel version 
顯示kernel版本信息
dmidecode -q show hardware system components - (SMBIOS / DMI) 
顯示硬件系統部件
hdaparm -i /dev/hda displays the characteristics of a hard-disk 
顯示某一硬盤特點
hdparm -tT /dev/sda perform test reading on a hard-disk 
執行某一硬盤讀取測試
cat /proc/cpuinfo show information CPU info 
顯示CPU信息
cat /proc/interrupts show interrupts 
顯示中斷信息
cat /proc/meminfo verify memory use 
覈實內存使用情況
cat /proc/swaps show file(s) swap 
顯示文件swap情況
cat /proc/version show version of the kernel 
顯示kernel版本信息
cat /proc/net/dev show network adpters and statistics 
顯示網絡信息
cat /proc/mounts show mounted file system(s) 
顯示掛載系統信息
lspci -tv display PCI devices 
顯示PCI設備
lsusb -tv show USB devices 
顯示USB設備
date show system date 
顯示系統日期
cal 2007 show the timetable of 2007 
顯示2007年日曆
date 041217002007.00 set date and time
- MonthDayhoursMinutesYear.Second
設置時間和日期 - 格式:月日時分年.秒
clock -w
save 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 now shutdown system
關閉系統
init 0
shutdown -r hours:minutes planned shutdown of the system
定時關機
shutdown -c cancel a planned shutdown of the system
取消定時關機
shutdown -r now reboot
重啓系統
reboot
logout leaving session
註銷用戶
linux commands line v1.0 - LinuxGuide.it linux命令詳解翻譯 - moon-blog.cn

        
COMMAND 命令 DESCRIPTION 註解
Files and Directory 
文件及目錄
cd /home enter to directory '/ home'
進入/home目錄
cd .. go back one level
向上返回一個目錄
cd ../.. go back two levels
向上返回兩個目錄
cd go to home directory
前往/home目錄
cd ~utente go to home directory
前往/home目錄
cd - go to previous directory
進入先前所在目錄
pwd show the path of work directory
顯示目錄路徑
ls view files of directory
顯示目錄內包含的文件
ls -F view files of directory
顯示目錄內包含的文件
ls -l show details of files and directory
顯示目錄內文件的詳細信息
ls -a show hidden files
顯示隱藏文件
ls *[0-9]* show files and directory containing number
顯示目錄內包含有數字的文件
lstree show files and directories in a tree starting from root
以樹形顯示文件
mkdir dir1 create a directory called 'dir1'
建立dir1目錄
mkdir dir1 dir2 create two directories simultaneously
建立兩個目錄
mkdir -p /tmp/dir1/dir2 create a directory tree
建立目錄樹
rm -f file1 delete file called 'file1'
刪除名爲file1的文件
rmdir dir1 delete directory called 'dir1'
刪除名爲dir1的目錄
rm -rf dir1 remove a directory called 'dir1' and contents recursively
刪除dir1目錄及所含文件
rm -rf dir1 dir2 remove two directories and their contents recursively
刪除dir1 dir 2兩個目錄及所含文件
mv dir1 new_dir rename / move a file or directory
重命名/移動 文件或文件夾
cp file1 file2 copying 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 dir2 copy a directory
複製目錄
ln -s file1 lnk1 create a symbolic link to file or directory
建立文件或目錄的符號鏈
ln file1 lnk1 create a physical link to file or directory
建立文件或目錄的物理鏈
touch -t 0712250000 fileditest modify timestamp of a file or directory
- (YYMMDDhhmm)
修改文件或目錄的時間戳 
- 格式:YYMMDDhhmm
linux commands line v1.0 - LinuxGuide.it linux命令詳解翻譯 - moon-blog.cn

        
COMMAND 命令 DESCRIPTION 註解
File search 
文件搜索
find / -name file1 search file and directory into root filesystem from '/' 
在 / 目錄中搜索文件或目錄
find / -user user1 search files and directories belonging to 'user1'
搜索屬於user1的文件和目錄
find /home/user1 -name *.bin search files with '. bin' extension within directory '/ home/user1' 
在/home/user1目錄內搜索包含有.bin的文件
find /usr/bin -type f -atime +100 search bynary files are not used in the last 100 days 
搜索100天未用的文件
find /usr/bin -type f -mtime -10 search 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 -xdev search files with '.rpm' extension ignoring removable partitions as cdrom, pen-drive, etc.…
搜索全屬性的.rpm的文件
locate *.ps find files with the '.ps' extension - first run 'updatedb' command 
搜索擴展名爲.ps的文件 
- 需要先運行updatedb命令
whereis halt show location of a binary file,source or man 
搜索halt的路徑
which halt show 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/hda2 mount disk called hda2 - verify existence of the directory '/ mnt/hda2'
掛載名爲hda2的硬盤設備
umount /dev/hda2 unmount disk called hda2 - exit from mount point '/ mnt/hda2' first 
取消掛載名爲hda2的硬盤設備
fuser -km /mnt/hda2 force umount when the device is busy 
強行取消掛載設備
umount -n /mnt/hda2 run umount without writing the file /etc/mtab - useful when the file is read-only or the hard disk is full 
不記錄掛載信息直接取消掛載 
- 當硬盤爲只讀或硬盤已滿時很實用
mount /dev/fd0 /mnt/floppy mount a floppy disk 
掛載軟盤
mount /dev/cdrom /mnt/cdrom mount a cdrom / dvdrom 
掛載CDrom或DVDrom
mount /dev/hdc /mnt/cdrecorder mount a cdrw / dvdrom 
掛載CD-RW或DVDrom
mount /dev/hdb /mnt/cdrecorder mount a cdrw / dvdrom 
掛載CD-RW或DVDrom
mount -o loop file.iso /mnt/cdrom mount a file or iso image 
掛載一個文件或ISO光盤鏡像
mount -t vfat /dev/hda5 /mnt/hda5 mount a Windows FAT32 file system 
掛載windows FAT32文件系統
mount /dev/sda1 /mnt/usbdisk mount a usb pen-drive or flash-drive 
掛載USB閃存設備
mount -t smbfs -o username=user,password=pass //winclient/share /mnt/share mount a windows network share 
掛載windows網絡共享
linux commands line v1.0 - LinuxGuide.it linux命令詳解翻譯 - moon-blog.cn
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章