特黄特色三级在线观看免费,看黄色片子免费,色综合久,欧美在线视频看看,高潮胡言乱语对白刺激国产,伊人网成人,中文字幕亚洲一碰就硬老熟妇

學習啦>學習電腦>操作系統(tǒng)>Linux教程>

Linux常用命令(3)

時間: 春健736 分享

  查看文件內(nèi)容

  cat file1 從第一個字節(jié)開始正向查看文件的內(nèi)容

  tac file1 從最后一行開始反向查看一個文件的內(nèi)容

  more file1 查看一個長文件的內(nèi)容

  less file1 類似于 'more' 命令,但是它允許在文件中和正向操作一樣的反向操作

  head -2 file1 查看一個文件的前兩行

  tail -2 file1 查看一個文件的最后兩行

  tail -f /var/log/messages 實時查看被添加到一個文件中的內(nèi)容

  文本處理

  cat file1 file2 ... | command <> file1_in.txt_or_file1_out.txt general syntax for text manipulation using PIPE, STDIN and STDOUT

  cat file1 | command( sed, grep, awk, grep, etc...) > result.txt 合并一個文件的詳細說明文本,并將簡介寫入一個新文件中

  cat file1 | command( sed, grep, awk, grep, etc...) >> result.txt 合并一個文件的詳細說明文本,并將簡介寫入一個已有的文件中

  grep Aug /var/log/messages 在文件 '/var/log/messages'中查找關(guān)鍵詞"Aug"

  grep ^Aug /var/log/messages 在文件 '/var/log/messages'中查找以"Aug"開始的詞匯

  grep [0-9] /var/log/messages 選擇 '/var/log/messages' 文件中所有包含數(shù)字的行

  grep Aug -R /var/log/* 在目錄 '/var/log' 及隨后的目錄中搜索字符串"Aug"

  sed 's/stringa1/stringa2/g' example.txt 將example.txt文件中的 "string1" 替換成 "string2"

  sed '/^$/d' example.txt 從example.txt文件中刪除所有空白行

  sed '/ *#/d; /^$/d' example.txt 從example.txt文件中刪除所有注釋和空白行

  echo 'esempio' | tr '[:lower:]' '[:upper:]' 合并上下單元格內(nèi)容

  sed -e '1d' result.txt 從文件example.txt 中排除第一行

  sed -n '/stringa1/p' 查看只包含詞匯 "string1"的行

  sed -e 's/ *$//' example.txt 刪除每一行最后的空白字符

  sed -e 's/stringa1//g' example.txt 從文檔中只刪除詞匯 "string1" 并保留剩余全部

  sed -n '1,5p;5q' example.txt 查看從第一行到第5行內(nèi)容

  sed -n '5p;5q' example.txt 查看第5行

  sed -e 's/00*/0/g' example.txt 用單個零替換多個零

  cat -n file1 標示文件的行數(shù)

  cat example.txt | awk 'NR%2==1' 刪除example.txt文件中的所有偶數(shù)行

  echo a b c | awk '{print class="main">

Linux常用命令(3)

時間: 春健736 分享

  echo a b c | awk '{print class="main">

Linux常用命令(3)

時間: 春健736 分享

  paste file1 file2 合并兩個文件或兩欄的內(nèi)容

  paste -d '+' file1 file2 合并兩個文件或兩欄的內(nèi)容,中間用"+"區(qū)分

  sort file1 file2 排序兩個文件的內(nèi)容

  sort file1 file2 | uniq 取出兩個文件的并集(重復的行只保留一份)

  sort file1 file2 | uniq -u 刪除交集,留下其他的行

  sort file1 file2 | uniq -d 取出兩個文件的交集(只留下同時存在于兩個文件中的文件)

  comm -1 file1 file2 比較兩個文件的內(nèi)容只刪除 'file1' 所包含的內(nèi)容

  comm -2 file1 file2 比較兩個文件的內(nèi)容只刪除 'file2' 所包含的內(nèi)容

  comm -3 file1 file2 比較兩個文件的內(nèi)容只刪除兩個文件共有的部分

  字符設(shè)置和文件格式轉(zhuǎn)換

  dos2unix filedos.txt fileunix.txt 將一個文本文件的格式從MSDOS轉(zhuǎn)換成UNIX

  unix2dos fileunix.txt filedos.txt 將一個文本文件的格式從UNIX轉(zhuǎn)換成MSDOS

  recode ..HTML < page.txt > page.html 將一個文本文件轉(zhuǎn)換成html

  recode -l | more 顯示所有允許的轉(zhuǎn)換格式

  文件系統(tǒng)分析

  badblocks -v /dev/hda1 檢查磁盤hda1上的壞磁塊

  fsck /dev/hda1 修復/檢查hda1磁盤上linux文件系統(tǒng)的完整性

  fsck.ext2 /dev/hda1 修復/檢查hda1磁盤上ext2文件系統(tǒng)的完整性

  e2fsck /dev/hda1 修復/檢查hda1磁盤上ext2文件系統(tǒng)的完整性

  e2fsck -j /dev/hda1 修復/檢查hda1磁盤上ext3文件系統(tǒng)的完整性

  fsck.ext3 /dev/hda1 修復/檢查hda1磁盤上ext3文件系統(tǒng)的完整性

  fsck.vfat /dev/hda1 修復/檢查hda1磁盤上fat文件系統(tǒng)的完整性

  fsck.msdos /dev/hda1 修復/檢查hda1磁盤上dos文件系統(tǒng)的完整性

  dosfsck /dev/hda1 修復/檢查hda1磁盤上dos文件系統(tǒng)的完整性

  初始化一個文件系統(tǒng)

  mkfs /dev/hda1 在hda1分區(qū)創(chuàng)建一個文件系統(tǒng)

  mke2fs /dev/hda1 在hda1分區(qū)創(chuàng)建一個linux ext2的文件系統(tǒng)

  mke2fs -j /dev/hda1 在hda1分區(qū)創(chuàng)建一個linux ext3(日志型)的文件系統(tǒng)

  mkfs -t vfat 32 -F /dev/hda1 創(chuàng)建一個 FAT32 文件系統(tǒng)

  fdformat -n /dev/fd0 格式化一個軟盤

  mkswap /dev/hda3 創(chuàng)建一個swap文件系統(tǒng)

  SWAP文件系統(tǒng)

  mkswap /dev/hda3 創(chuàng)建一個swap文件系統(tǒng)

  swapon /dev/hda3 啟用一個新的swap文件系統(tǒng)

  swapon /dev/hda2 /dev/hdb3 啟用兩個swap分區(qū)

  備份

  dump -0aj -f /tmp/home0.bak /home 制作一個 '/home' 目錄的完整備份

  dump -1aj -f /tmp/home0.bak /home 制作一個 '/home' 目錄的交互式備份

  restore -if /tmp/home0.bak 還原一個交互式備份

  rsync -rogpav --delete /home /tmp 同步兩邊的目錄

  rsync -rogpav -e ssh --delete /home ip_address:/tmp 通過SSH通道rsync

  rsync -az -e ssh --delete ip_addr:/home/public /home/local 通過ssh和壓縮將一個遠程目錄同步到本地目錄

  rsync -az -e ssh --delete /home/local ip_addr:/home/public 通過ssh和壓縮將本地目錄同步到遠程目錄

  dd bs=1M if=/dev/hda | gzip | ssh user@ip_addr 'dd of=hda.gz' 通過ssh在遠程主機上執(zhí)行一次備份本地磁盤的操作

  dd if=/dev/sda of=/tmp/file1 備份磁盤內(nèi)容到一個文件

  tar -Puf backup.tar /home/user 執(zhí)行一次對 '/home/user' 目錄的交互式備份操作

  ( cd /tmp/local/ && tar c . ) | ssh -C user@ip_addr 'cd /home/share/ && tar x -p' 通過ssh在遠程目錄中復制一個目錄內(nèi)容

  ( tar c /home ) | ssh -C user@ip_addr 'cd /home/backup-home && tar x -p' 通過ssh在遠程目錄中復制一個本地目錄

  tar cf - . | (cd /tmp/backup ; tar xf - ) 本地將一個目錄復制到另一個地方,保留原有權(quán)限及鏈接

  find /home/user1 -name '*.txt' | xargs cp -av --target-directory=/home/backup/ --parents 從一個目錄查找并復制所有以 '.txt' 結(jié)尾的文件到另一個目錄

  find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2 查找所有以 '.log' 結(jié)尾的文件并做成一個bzip包

  dd if=/dev/hda of=/dev/fd0 bs=512 count=1 做一個將 MBR (Master Boot Record)內(nèi)容復制到軟盤的動作

  dd if=/dev/fd0 of=/dev/hda bs=512 count=1 從已經(jīng)保存到軟盤的備份中恢復MBR內(nèi)容

  光盤

  cdrecord -v gracetime=2 dev=/dev/cdrom -eject blank=fast -force 清空一個可復寫的光盤內(nèi)容

  mkisofs /dev/cdrom > cd.iso 在磁盤上創(chuàng)建一個光盤的iso鏡像文件

  mkisofs /dev/cdrom | gzip > cd_iso.gz 在磁盤上創(chuàng)建一個壓縮了的光盤iso鏡像文件

  mkisofs -J -allow-leading-dots -R -V "Label CD" -iso-level 4 -o ./cd.iso data_cd 創(chuàng)建一個目錄的iso鏡像文件

  cdrecord -v dev=/dev/cdrom cd.iso 刻錄一個ISO鏡像文件

  gzip -dc cd_iso.gz | cdrecord dev=/dev/cdrom - 刻錄一個壓縮了的ISO鏡像文件

  mount -o loop cd.iso /mnt/iso 掛載一個ISO鏡像文件

  cd-paranoia -B 從一個CD光盤轉(zhuǎn)錄音軌到 wav 文件中

  cd-paranoia -- "-3" 從一個CD光盤轉(zhuǎn)錄音軌到 wav 文件中(參數(shù)-3)

  cdrecord --scanbus 掃描總線以識別scsi通道

  dd if=/dev/hdc | md5sum 校驗一個設(shè)備的md5sum編碼,例如一張 CD

  網(wǎng)絡(luò) - (以太網(wǎng)和WIFI無線)

  ifconfig eth0 顯示一個以太網(wǎng)卡的配置

  ifup eth0 啟用一個 'eth0' 網(wǎng)絡(luò)設(shè)備

  ifdown eth0 禁用一個 'eth0' 網(wǎng)絡(luò)設(shè)備

  ifconfig eth0 192.168.1.1 netmask 255.255.255.0 控制IP地址

  ifconfig eth0 promisc 設(shè)置 'eth0' 成混雜模式以嗅探數(shù)據(jù)包 (sniffing)

  dhclient eth0 以dhcp模式啟用 'eth0'

  route -n show routing table

  route add -net 0/0 gw IP_Gateway configura default gateway

  route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1 configure static route to reach network '192.168.0.0/16'

  route del 0/0 gw IP_gateway remove static route

  echo "1" > /proc/sys/net/ipv4/ip_forward activate ip routing

  hostname show hostname of system

  host www.example.com lookup hostname to resolve name to ip address and viceversa(1)

  nslookup www.example.com lookup hostname to resolve name to ip address and viceversa(2)

  ip link show show link status of all interfaces

  mii-tool eth0 show link status of 'eth0'

  ethtool eth0 show statistics of network card 'eth0'

  netstat -tup show all active network connections and their PID

  netstat -tupl show all network services listening on the system and their PID

  tcpdump tcp port 80 show all HTTP traffic

  iwlist scan show wireless networks

  iwconfig eth1 show configuration of a wireless network card

  hostname show hostname

  host www.example.com lookup hostname to resolve name to ip address and viceversa

  nslookup www.example.com lookup hostname to resolve name to ip address and viceversa

  whois www.example.com lookup on Whois database

  GO TOP INDEX ^

  Microsoft Windows networks (SAMBA)

  nbtscan ip_addr netbios name resolution

  nmblookup -A ip_addr netbios name resolution

  smbclient -L ip_addr/hostname show remote shares of a windows host

  smbget -Rr smb://ip_addr/share like wget can download files from a host windows via smb

  mount -t smbfs -o username=user,password=pass //WinClient/share /mnt/share mount a windows network share

看過“ Linux常用命令 ”的人還看了:

1.LINUX操作系統(tǒng)常用命令有哪些

2.必學100個常用linux命令大全

3.Linux系統(tǒng)常用命令合集

4.linux常用基本命令

5.Linux必學的幾個個命令

749873