Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common commands of Linux and what are their functions?

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

< page.txt >

Page.html converts a text file to html recode-l | more displays all allowed conversion formats file system analysis badblocks-v / dev/hda1 check bad blocks on disk hda1 fsck / dev/hda1 repair / check linux file system integrity on hda1 disk fsck.ext2 / dev/hda1 repair / check ext2 file system integrity on hda1 disk e2fsck / dev/hda1 repair / check ext2 file system on hda1 disk Integrity of e2fsck-j / dev/hda1 repair / check integrity of ext3 file system on hda1 disk fsck.ext3 / dev/hda1 repair / check integrity of ext3 file system on hda1 disk fsck.vfat / dev/hda1 repair / check integrity of fat file system on hda1 disk fsck.msdos / dev/hda1 repair / check integrity of dos file system on hda1 disk dosfsck / dev/hda1 repair / check dos on hda1 disk File system integrity initialization a file system mkfs / dev/hda1 create a file system mke2fs / dev/hda1 in the hda1 partition create a linux ext2 file system mke2fs-j / dev/hda1 in the hda1 partition create a linux ext3 (log-type) file system mkfs-t vfat 32-f / dev/hda1 create a fat32 file system fdformat-n / dev/fd0 format a floppy disk mkswap / dev/ Hda3 create a swap file system swap file system mkswap / dev/hda3 create a swap file system swapon / dev/hda3 enable a new swap file system swapon / dev/hda2 / dev/hdb3 enable two swap partition backups dump-0aj-f / tmp/home0.bak / home make a full backup of the'/ home' directory dump-1aj-f / tmp/home0.bak / home create a'/ home' directory Interactive backup restore-if / tmp/home0.bak restore an interactive backup rsync-rogpav-- delete / home/ tmp directory on both sides of synchronization rsync-rogpav-e ssh-- delete / home ip_address:/tmp synchronizes a remote directory to the local directory rsync-az-e ssh-delete / home/local ip_ through ssh and compression through the ssh channel rsync rsync-az-e ssh-- delete ip_addr:/home/public / home/local Addr:/home/public synchronizes the local directory to the remote directory dd bs=1m if=/dev/hda through ssh and compression | gzip | ssh user@ip_addr'dd of=hda.gz' performs a backup of the local disk on the remote host through ssh dd if=/dev/sda of=/tmp/file1 backs up the disk contents to a file tar-puf backup.tar / home/user performs an interaction to the'/ home/user' directory Backup operation (cd / tmp/local/ & & tar c. ) | ssh-c user@ip_addr'cd / home/share/ & & tar x-p 'copy a directory content in the remote directory (tar c / home) via ssh | ssh-c user@ip_addr' cd / home/backup-home & & tar x-p 'copy a local directory tar cf -. | (cd / tmp/backup) Tar xf -) copy one directory to another locally Retain the original permissions and link find / home/user1-name'* .txt'| xargs cp-av-- target-directory=/home/backup/-- parents to find and copy all files ending in '.txt' from one directory to another directory find / var/log-name'* .log'| tar cv-- files-from=- | bzip2 > log.tar.bz2 finds all files ending in '.log' and makes one Bzip package dd if=/dev/hda of=/dev/fd0 bs=512 count=1 does the act of copying mbr (master boot record) content to a floppy disk dd if=/dev/fd0 of=/dev/hda bs=512 count=1 restores mbr content CD cdrecord-v gracetime=2 dev=/dev/cdrom-eject blank=fast-force clear a rewritable CD content mkisofs / dev/cdrom > cd.iso create an iso image file mkisofs of a CD on disk / dev/cdrom | gzip > cd_iso.gz create a compressed iso image file on disk mkisofs-j-allow-leading-dots-r-v "label cd"-iso-level 4-o. / cd.iso data_cd create a directory iso image file cdrecord-v dev=/dev/cdrom cd.iso burn an iso image file gzip-dc cd_iso.gz | cdrecord dev=/dev/cdrom-Burn a compressed image file Iso image file mount-o loop cd.iso / mnt/iso mounts an iso image file cd-paranoia-b from a cd CD transcribed audio track to a wav file cd-paranoia-"- 3" from an cd CD transcribed audio track to a wav file (parameter-3) cdrecord-scanbus scan bus to identify scsi channel dd if=/dev/hdc | md5sum verifies a device's md5sum encoding For example, a cd network-(Ethernet and wifi wireless) ifconfig eth0 shows the configuration of an Ethernet card ifup eth0 enables a 'eth0' network device ifdown eth0 disable a' eth0' network device ifconfig eth0 192.168.1.1 netmask 255.255.255.0 control ip address ifconfig eth0 promisc setting 'eth0' in promiscuous mode to sniff packet (sniffing) dhclient eth0 enabled in dhcp mode' Eth0' route-n show routing table route add-net 0 gw ip_gateway remove static route echo 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 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 microsoft windows networks (samba) nbtscan ip_addr netbios name resolution nmblookup-an 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 reads here. This article "what are the common Linux commands and what are their functions" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report