1, Linux command classification
This section describes the classification of Linux commandsCopy the code
1.1. System information commands
Uname -m Displays the processor architecture of the machine uname -r displays the kernel version in use dmidecode -q Displays the hardware system components - (SMBIOS/DMI) hdparm -i /dev/hda lists the disk architecture features hdPARm -tT /dev/sda Performs test reads on disks. Cat /proc/cpuinfo Displays CPU info information. Cat /proc/interrupts Displays interrupted information Cat /proc/swaps Displays which swaps are used. Cat /proc/version displays the kernel version. Cat /proc/net/dev displays network adapters and statistics. Cat /proc/mounts displays lSPCI-TV lists of loaded file systems PCI device LSUSB-TV displays USB devicesCopy the code
1.2. Date Displays the system date
CAL 2007 Displays the calendar for 2007 date 041217002007.00 Set the date and time - month/day/hour/year. Second clock -w Saves the time change to the BIOSCopy the code
1.3 Linux shutdown restart command
Telinit 0 shutdown the system shutdown -h hours:minutes & shutdown the system shutdown -c cancel the shutdown -r now Restart reboot Logout Restart logoutCopy the code
1.4. Linux File and directory commands
CD /home Go to '/ home' directory 'CD.. Return to the upper directory CD.. /.. CD Go to the personal home directory CD ~user1 Go to the personal home directory CD - Go back to the last directoryCopy the code
1.5. PWD Realistic working path
Ls -f View files in the directory ls -l Display details about files and directories ls -a Display hidden files ls *[0-9]* Display file names and directory names containing digits tree Display the tree structure of files and directories starting from the root directory (1) lstree Mkdir dir1 Create a directory named 'dir1'. 'mkdir dir1 dir2 Create two directories at the same time. Mkdir -p/TMP /dir1/dir2 Create a directory tree rm -f file1 Delete a file called 'file1' 'rmdir dir1 delete a directory called 'dir1'' rm -rf dir1 Delete a directory called 'dir1' and delete its contents rm -rf dir1 dir2 delete two directories and their contents simultaneously Mv dir1 new_dir Rename/move a directory cp file1 file2 Copy a file cp dir/*. Copy all files in a directory to the current working directory cp -a/TMP /dir1. Copy a directory to the current working directory cp -a dir1 dir2 Copy a directory ln -s file1 lnk1 Create a soft link to a file or directory ln file1 lnk1 Create a physical link to a file or directory touch -t 0712250000 Outputs iconv -l to modify the time stamp of a file or directory - (YYMMDDhhmm) file file1 the MIME type of the file as text iconv -l lists the known encoditiesCopy the code
1.6. Linux file search
Find / -name file1 Slave'/'Start Access the root file system to search for files and directories. Find / -user user1 Searches for users'user1'Find /home/user1-name \*.bin in the directory'/ home/user1'Search with'.bin'The end file find /usr/bin-type f-atime +100Search in the past100Find /usr/bin-type f -mtime - That has not been used within a day10Search in the10Find / -name \*. RPM -exec chmod File created or modified within days755 '{}'\; The search for'.rpm'End file and define its permissions find / -xdev-name \*.rpm search to'.rpm'At the end of the file, ignore the CD drive, flash drive and other portable devices locate \*.ps to find'.ps'File at the end - Run first'updatedb'The command whereis halt displays the location of a binary, source, or man. Which halt displays the full path to a binary or executableCopy the code
1.7, Linux network commands
Ifconfig eth0 displays the configuration of one Ethernet card ifup eth0 enables one'eth0'Network device ifDown eth0 Disables one'eth0'Network device ifconfig eth0192.1681.1. netmask 255.255255.. 0Control IP address ifconfig eth0 promisc Set'eth0'Sniffing mode Dhclient eth0 is enabled in DHCP mode'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.1681.1. configure static route to reach network '192.168.0.0/16
Copy the code
Reference [1] : www.linuxprobe.com/linux-commo…