Command Description
system information
arch display computer architecture
uname -m
uname -r show used kernel version
dmidecode -q show hardware system components – (SMBIOS / DMI)
hdparm -i / dev / hda HDD output characteristics
hdparm -tT / dev / sda to test the performance of reading data from the hard disk
cat / proc / cpuinfo display processor information
cat / proc / interrupts show interrupts
cat / proc / meminfo check memory usage
cat / proc / swaps show file (s) swap
cat / proc / version display kernel version
cat / proc / net / dev show network interfaces and statistics on them
cat / proc / mounts display mounted file systems
lspci -tv show in a tree PCI devices
lsusb -tv show in the form of a USB device tree
date bring the system date
cal 2007 display table calendar 2007 year
date 041217002007.00 set the system date and time MMDDChChmmGGGG.SS (MesyatsDenChasMinutyGod.Sekundy)
clock -w keep the system time in the BIOS
Stop system
shutdown -h now Stop system
init 0
telinit 0
shutdown -h hours: minutes & schedule the system to stop at a specified time
shutdown -c cancel a planned scheduled stop system
shutdown -r now reboot the system
reboot
logout logout
Files and directories
cd / home go to the directory ‘/ home’
cd .. go into the directory level above
cd ../ .. go to the directory two levels above
cd go to your home directory
cd ~ user go to the user’s home directory user
cd – go to the directory where you were before the transition to the current directory
pwd show current directory
ls display the contents of the current directory
ls -F display the contents of the current directory with the addition of a character name, type hrakterizuyuschih
ls -l show details view of files and directories in the current directory
ls -a Show hidden files and folders in the current directory
ls * [0-9] * show files and directory containing numbers in a name
tree show files and directories in a tree starting from root (/)
lstree
mkdir dir1 create a directory called ‘dir1’
mkdir dir1 dir2 create two directories simultaneously
mkdir -p / tmp / dir1 / dir2 create a directory tree
rm -f file1 delete a file called ‘file1’
rmdir dir1 remove a directory called ‘dir1’
rm -rf dir1 remove a directory called ‘dir1’ and recursively all of its contents
rm -rf dir1 dir2 remove two directories and their contents recursively
mv dir1 new_dir rename or move a file or directory
cp file1 file2 sopirovat file1 file in the file file2
cp dir / *. copy all the files in the directory dir current directory
cp -a / tmp / dir1. copy dir1 directory and all its contents to the current directory
cp -a dir1 dir2 copy the directory dir1 to dir2 directory
ln -s file1 lnk1 create a symbolic link to a file or directory
ln file1 lnk1 create a “rigid” (physical) link to a file or directory
touch -t 0712250000 fileditest modify the date and time the file was created, in the absence thereof, to create a file with the specified date and time (YYMMDDhhmm)
Search files
find / -name file1 find files and directories with the name file1. Search to begin with root (/)
find / -user user1 search file and directory belonging to the user user1. Search to begin with root (/)
find / home / user1 -name “* .bin” Find all files and directories whose names end in ‘. bin ‘. Search to begin with ‘/ home / user1’
find / usr / bin -type f -atime +100 find all files in the ‘/ usr / bin’, time of last access to which more than 100 days
find / usr / bin -type f -mtime -10 find all files in the ‘/ usr / bin’, created or modified in the last 10 days
find / -name * .rpm -exec chmod 755 ‘{}’ \; find all the halyards and directories whose names end with ‘.rpm’, and change the access rights to them
find / -xdev -name “* .rpm” find all the halyards and directories whose names end with ‘.rpm’, ignoring removable media such as a cdrom, floppy, etc.
locate “* .ps” find all files that contain the raw in the name of ‘.ps’. Previously recommended to execute the command ‘updatedb’
whereis halt It shows the placement of binary files, source code and manuals relating to the file ‘halt’
which halt It displays the full path to ‘halt’
Mounting File Systems
mount / dev / hda2 / mnt / hda2 mounts section ‘hda2’ in the mount point ‘/ mnt / hda2’. Make sure you have a mount-point directory ‘/ mnt / hda2’
umount / dev / hda2 unmount the section ‘hda2’. Before performing, leave ‘/ mnt / hda2’
fuser -km / mnt / hda2 Forced unmount section. It is used when a section is occupied by any user
umount -n / mnt / hda2 razmonitrovanie perform without entering information in / etc / mtab. It is useful when a file has the attributes “read only” or not enough space on the disk
mount / dev / fd0 / mnt / floppy mount the floppy drive
mount / dev / cdrom / mnt / cdrom mount the CD or DVD
mount / dev / hdc / mnt / cdrecorder mount the CD-R / CD-RW or DVD-R / DVD-RW (+ -)
mount -o loop file.iso / mnt / cdrom mount ISO -image
mount -t vfat / dev / hda5 / mnt / hda5 mount a Windows FAT32 file system
the smbfs -o -t the mount the username = the user, the password = pass //WinClient /this content share/mnt /this content share mount network Windows (SMB / CIFS) file system
mount -o bind / home / user / prg / var / ftp / user “Mounts” directory in the directory (binding). Available from version 2.4.0 kernel. It is useful, for example, to provide the contents of the user directory via ftp at ftp-server in the “sandbox” (chroot), when it is impossible to make symlinks.
Disk space
df -h displays information about the mounted sections displaying the total, free and used space (Prim.perevodchika. -h key does not work in all * nix systems)
-lSr the ls |more It produces a list of files and directories recursively sorted ascending size and allows for paging
du -sh dir1 calculates and displays the size occupied by directory ‘dir1’ (Prim.perevodchika. -h key does not work in all * nix systems)
* -sk du |The sort -rn It displays the size and the names of files and directories, with soritrovkoy size
-a -q the rpm --qf ‘10% the SIZE} {\ t% {the NAME} \ the n’ |The sort -k1,1n shows the size of disk space occupied by files rpm-package, sorted by size (fedora, redhat and like)
dpkg-query -W -f = ‘$ {Installed-Size; 10} \ t $ {} the Package \ the n’ |The sort -k1,1n shows the size of disk space occupied by the file deb-package, sorted by size (ubuntu, debian, etc.)
Users and Groups
groupadd group_name create a new group with the name group_name
groupdel group_name remove group group_name
groupmod -n new_group_name old_group_name rename old_group_name group new_group_name
useradd -c “Nome Cognome” -g admin -d / home / user1 -s / bin / bash user1 create user user1, to appoint him as the home directory / home / user1, as the shell / bin / bash, to include it in the admin group and add a comment Nome Cognome
useradd user1 create user user1
userdel -r user1 delete a user user1 and his home directory
-c the usermod “the User the FTP ” -g system -d / the ftp / user1 -s / bin directory / nologin exists user1 change user attributes
passwd Change password
passwd user1 change the password of the user user1 (root only)
chage -E 2005-12-31 user1 set the expiration date of the user account user1
pwck validate the system account files. Checks the file / etc / passwd and / etc / shadow
grpck validates the system account files. Checking the file / etc / group
newgrp [-] group_name change the primary group of the current user. If you specify “-“, the situation will be identical to the one in which the user of the system and embroidered entered again. If you do not specify a group, the primary group will be assigned from the / etc / passwd
Setting / changing the authority files
ls -lh view of authority to the files and directories in the current directory
the ls / tmp directory |the pr $ -W T5 the COLUMNS display the contents of the / tmp directory and divide the output into five columns
chmod ugo + rwx directory1 add authority to the directory directory1 ugo (User Group Other) + rwx (Read Write eXecute) – all full rights. The same can be done in such a way “chmod 777 directory1”
chmod go-rwx directory1 away from the group and others full authority to the directory directory1.
chown user1 file1 assign ownership to the user user1 file1 file
chown -R user1 directory1 appoint recursively owner user1 directory1 User directory
chgrp group1 file1 change the owner group of file1 in the group1
chown user1: group1 file1 Change the owner and group owner of the file file1
find / -perm -u + s find, starting from the root, all files with SUID exposed
chmod u + s / bin / binary_file assign SUID-bit file / bin / binary_file. This allows any users to execute a file with the file owner permissions.
chmod us / bin / binary_file remove the SUID-bit with the file / bin / binary_file.
chmod g + s / home / public appoint SGID-bit directory / home / public.
chmod gs / home / public remove SGID-bit with the directory / home / public.
chmod o + t / home / public appoint STIKY-bit directory / home / public. It allows you to delete only the owners
chmod ot / home / public remove STIKY-bit with the directory / home / public
Special file attributes
chattr + a file1 allow to open a file for writing only in append mode
chattr + c file1 It allows the kernel to automatically compress / decompress the file.
chattr + d file1 ukazavet dump utility to ignore this file during the execution of the backup
chattr + i file1 It makes the file inaccessible to any changes: edit, delete, move, create links to it.
chattr + s file1 It allows you to make secure file deletion, ie s exhibition attribute says that when you delete a file, the space occupied by the file on the disk is filled with zeros, which Prevents the possibility of data recovery.
chattr + S file1 It indicates that, when changes are saved, synchronization is performed as when the sync command
chattr + u file1 this attribute indicates that the file is deleted, its contents will be saved and, if necessary, the user can restore it
lsattr show file attributes
Archive and compress files
bunzip2 file1.bz2 decompresses the file ‘file1.gz’
gunzip file1.gz
gzip file1 squeezes ‘file1’ file
bzip2 file1
gzip -9 file1 file1 compress a file with maximum compression
rar a file1.rar test_file create a rar-archive ‘file1.rar’ and include the file test_file
rar a file1.rar file1 file2 dir1 create a rar-archive ‘file1.rar’ and include the file1, file2 and dir1
unrar x file1.rar unpack rar-archive
tar -cvf archive.tar file1 create a tar-archive archive.tar, containing the file file1
tar -cvf archive.tar file1 file2 dir1 create a tar-archive archive.tar, containing file1, file2, and dir1
tar -tf archive.tar show the contents of the archive
tar -xvf archive.tar unzip
tar -xvf archive.tar -C / tmp unzip the file in / tmp
tar -cvfj archive.tar.bz2 dir1 create an archive and compress it using the bzip2 (Prim.perevodchika. -j key does not work in all * nix systems)
tar -xvfj archive.tar.bz2 decompress the archive and extract it (Prim.perevodchika. -j key does not work in all * nix systems)
tar -cvfz archive.tar.gz dir1 create an archive and compress it with gzip
tar -xvfz archive.tar.gz decompress the archive and extract it
zip file1.zip file1 create a compressed zip-archive
zip -r file1.zip file1 file2 dir1 create a compressed zip-file and from the inclusion of multiple files and / or directories
unzip file1.zip decompress and extract the zip-archive
RPM Packages (Fedora, Red Hat and like)
rpm -ivh package.rpm install the package with the output messages and progress bar
-ivh the rpm --nodeps package.rpm install the package with the output messages and progress bar without control dependencies
rpm -U package.rpm update the package without configuration file changes, in the absence of the package, it will be installed
rpm -F package.rpm update package only if it is installed
rpm -e package_name.rpm remove a package
rpm -qa list all packages installed on the system
-qa the rpm |the grep the httpd among all the packages installed on the system, find a package with the name “httpd”
rpm -qi package_name display information about the package konkrentnom
rpm -qg “System Environment / Daemons” display packages included in the package group
rpm -ql package_name display a list of files included in the package
rpm -qc package_name display a list of configuration files provided by a package
-q package_name the rpm --whatrequires display the list of packages required to install specific dependencies on the package
-q package_name the rpm --whatprovides show capability provided by a rpm package
-q package_name the rpm --scripts directory will show scripts started during installation / removal package
-q package_name the rpm --the changelog display package revision history
rpm -qf /etc/httpd/conf/httpd.conf verify which package belongs to the specified file. Pointing is the full path and file name.
rpm -qp package.rpm -l It displays a list of files provided by a package not yet installed in the system
the rpm --import statement / media / the cdrom / the RPM-the GPG-the KEY iportirovat public key digital signature
the rpm --checksig package.rpm check package signatures
rpm -qa gpg-pubkey check the integrity of the contents of the package set
rpm -V package_name check file size, permissions, type, owner, group, MD5-sum and date of last modification package
rpm -Va check all packages installed on the system. Use with caution!
rpm -Vp package.rpm check the package, which is not installed in the system
package.rpm rpm2cpio |the cpio --the extract --the make-directories bin directory * * extract the files from the package with the name bin
rpm -ivh /usr/src/redhat/RPMS/`arch`/package.rpm install a package compiled from source
the rpmbuild --rebuild the package_name.src.rpm compile the package from source
YUM – vehicle upgrade packages (Fedora, RedHat, etc.)
yum install package_name upload and selected to install package
yum update update all packages installed on the system
yum update package_name update package
yum remove package_name remove a package
yum list list all packages installed on the system
yum search package_name find a package in the repository
yum clean packages cleanse rpm-cache, deleting the downloaded packages
yum clean headers remove all the file headers that the system uses to resolve dependency
yum clean all cleanse rpm-cache, deleting the downloaded packages and headers
DEB packages (Debian, Ubuntu, etc.)
dpkg -i package.deb install / upgrade package
dpkg -r package_name remove the package from the system
dpkg -l show all packages installed in
-l the dpkg |the grep the httpd among all the packages installed on the system, find a package with the name “httpd”
dpkg -s package_name display information may be requested on a specific package
dpkg -L package_name list of files included in the package installed in the system
the dpkg --contents The package.deb display a list of files included in the package that Yeshe is not installed in the system
dpkg -S / bin / ping find a package that includes the file specified.
APT – package management tool (Debian, Ubuntu, etc.)
apt-get install package_name install / upgrade package
apt-cdrom install package_name install / upgrade the package to the CDROM
apt-get update get updated lists of packages
apt-get upgrade update packages installed in
apt-get remove package_name remove the packages installed on the system to save the configuration file
apt-get purge package_name remove the packages installed on the system with the remote configuration files
apt-get check check the integrity of dependencies
apt-get clean delete the downloaded archive package files
apt-get autoclean delete old downloaded archive package files
View the contents of files
cat file1 print the contents of file1 to the standard output ustroysva
tac file1 print the contents of file1 to the standard ustroysva output in reverse order (the last line to become the first, and so on)
more file1 paged content of file1 to the standard output
less file1 paged content of file1 to the standard output, but with the ability to scroll in both directions (up and down) the contents of the search, etc.
head -2 file1 to bring the first two lines of file1 to the standard output. The default output ten lines
tail -2 file1 output the last two lines of file1 to the standard output. The default output ten lines
tail -f / var / log / messages display the contents of the file / var / log / messages on the standard output device as they appear in the text of it.
Text manipulation
file cat is |the grep -i “the Criteria”> result.txt the general syntax for performing actions on the contents of the file processing and output the result in the new
file cat is |the grep -i “the Criteria” >>result.txt the general syntax for performing actions on the contents of the file processing and output the result to an existing file. If the file does not exist, it is created
grep Aug / var / log / messages from file ‘/ var / log / messages’ to select and display the standard output device line containing “Aug”
the grep ^Date Aug / the var / the log / messages from file ‘/ var / log / messages’ to select and print to standard output lines that begin with “Aug”
grep [0-9] / var / log / messages from file ‘/ var / log / messages’ to select and display the standard output device strings containing numbers
grep Aug -R / var / log / * select and print to standard output lines that contain “Aug” O, all files in the directory / var / log and below
sed ‘s / stringa1 / stringa2 / g’ example.txt in example.txt file replace “string1” to “string2”, the result output to standard output.
the sed '/^$/d ‘example.txt remove blank lines from file example.txt
the sed '/ *#/d; /^$/d ‘example.txt remove blank lines and comments from example.txt file
the echo ‘test’ |tr ‘[: lower:]’ ‘[: upper:]’ convert from lower case to upper
sed -e ‘1d’ result.txt remove the first line of the file example.txt
sed -n ‘/ string1 / p’ display only the rows that contain the “string1”
-e the sed ‘s /* $ //‘ example.txt remove empty characters at the end of each line
-e the sed ‘s /string1 //g’ example.txt remove the string “string1” from text without changing the rest of the
sed -n ‘1,8p; 5q’ example.txt take the file from the first to the eighth row and the output of which the first five
sed -n ‘5p; 5q’ example.txt bring the fifth row
sed -e ‘s / * 0/0 / g’ example.txt replace a sequence of any number of zeros with a single zero
cat -n file1 number row of a file’s contents
example.txt cat is |of awk ‘the NR% 2 == 1’ in deriving the contents of the file, not the file to display the even lines
abc the echo |of awk ‘{the print $ 1}’ view the first column. Separation, by default, on problelu / spaces or / tabs
abc the echo |of awk ‘{the print $ 1, $ 3}’ view the first and treyu column. Separation, by default, on problelu / spaces or / tabs
paste file1 file2 combine the contents of file1 and file2 as a table: Line 1 from file1 = row 1 column 1-n, row 1 of file2 = row 1 column n + 1-m
paste -d ‘+’ file1 file2 combine the contents of file1 and file2 as a table with the separator “+”
sort file1 file2 sort contents of two files
file2 file1 is The sort |uniq sort contents of two files omitting lines repeated
file2 file1 is The sort |uniq -u sort contents of two files by viewing only unique lines (lines that appear on both files are output to the standard output)
file2 file1 is The sort |uniq -d sort contents of two files by viewing only duplicate line
comm -1 file1 file2 compare the contents of two files by displaying the line belonging to the file ‘file1’
comm -2 file1 file2 compare the contents of two files by displaying the line belonging to the file ‘file2’
comm -3 file1 file2 compare contents of two files by deleting only the lines that appear in both files
Converting character sets and file formats
dos2unix filedos.txt fileunix.txt convert the file in text format from MSDOS to UNIX (in characters koretki refund the difference)
unix2dos fileunix.txt filedos.txt convert the file in text format from UNIX to MSDOS (in characters koretki refund the difference)
.. the recode the HTML <page.txt> page.html convert the contents of the test page.txt file in a html-file page.html
-l the recode |more display a list of available formats
Analysis of the file systems
badblocks -v / dev / hda1 check hda1 partition for bad-blocks
fsck / dev / hda1 repair / check integrity of linux-file system partition hda1
fsck.ext2 / dev / hda1 repair / check integrity of ext2 filesystem on disk hda1
e2fsck / dev / hda1
e2fsck -j / dev / hda1 repair / check integrity of ext3 filesystem on disk hda1 with the indication that the journal is located in the same place
fsck.ext3 / dev / hda1 repair / check integrity of ext3 filesystem on disk hda1
fsck.vfat / dev / hda1 repair / check integrity of fat filesystem on disk hda1
fsck.msdos / dev / hda1
dosfsck / dev / hda1
Formatting File Systems
mkfs / dev / hda1 create a linux-filesystem on hda1 section
mke2fs / dev / hda1 create an ext2 filesystem on hda1 section
mke2fs -j / dev / hda1 to create an ext3 file system are logged on hda1 section
mkfs -t vfat 32 -F / dev / hda1 create a FAT32 file system on hda1 section
fdformat -n / dev / fd0 formatting a floppy disk without checking
mkswap / dev / hda3 creation of swap-space section hda3
swap-space
mkswap / dev / hda3 creation of swap-space section hda3
swapon / dev / hda3 activate the swap-space, located on the section hda3
swapon / dev / hda2 / dev / hdb3 activate the swap-space, located on sections hda2 and hdb3
Creating a backup (backup)
dump -0aj -f /tmp/home0.bak / home to create a full backup of the / home directory in a file /tmp/home0.bak
dump -1aj -f /tmp/home0.bak / home make a incremental backup of the / home directory in a file /tmp/home0.bak
restore -if /tmp/home0.bak restore from backup /tmp/home0.bak
-rogpav the rsync --the delete / home / tmp directory synchronize the / tmp / home
-rogpav the ssh -e the rsync --the delete / home ip_address: / tmp directory synchronize via SSH -FLASH
-az the ssh -e the rsync --the delete ip_addr: / home / the public / home / local synchronize a local directory with a remote directory via ssh-tunnel compression
-az the ssh -e the rsync --the delete / home / local ip_addr: / home / the public synchronize a remote directory with a local directory via ssh-tunnel compression
of bs = 1M the dd the if = / dev / hda |the gzip |the ssh @ ip_addr the user ‘of the dd = hda.gz’ make a “cast” of the local drive in a file on a remote computer via ssh-tunnel
tar -Puf backup.tar / home / user make a incremental backup of directory ‘/ home / user’ file backup.tar retaining powers
(The cd / tmp directory / local / && the tar c.) |The ssh -C ip_addr the user @ ‘the cd / home / this content share / && the tar x -p’ Copy the contents of / tmp / local to a remote computer via ssh-tunnel / home / share /
(The tar c / home) |the ssh -C ip_addr the user @ ‘the cd / home / home && the backup-the tar x -p’ Copy the contents of / home to a remote computer via ssh-tunnel / home / backup-home
tar cf -. |(cd / tmp / backup; tar xf -) up one directory to another while maintaining authority and links
the find / home / user1 -name ‘* .txt’ |\
the xargs the cp -av --target The-directory = / home / the backup / --parents The
search in / home / user1 all files whose names end in ‘.txt’, and copy them to another directory
the find / the var / the log -name ‘* .log’ |the tar a cv --files is-from = – |the bzip2> log.tar.bz2 search in / var / log of all files whose names end in ‘.log’, and the creation of an archive bzip-one
dd if = / dev / hda of = / dev / fd0 bs = 512 count = 1 make a copy of MBR (Master Boot Record) to / dev / hda on the floppy disk
dd if = / dev / fd0 of = / dev / hda bs = 512 count = 1 restore the MBR from a floppy disk on / dev / hda
CDROM
cdrecord -v gracetime = 2 dev = / dev / cdrom -eject blank = fast -force clean a rewritable cdrom
mkisofs / dev / cdrom> cd.iso create an iso image of cdrom on disk
of mkisofs / dev / the cdrom |the gzip> cd_iso.gz create a compressed iso image of cdrom on disk
mkisofs -J -allow-leading-dots -R -V “Label CD” -iso-level 4 -o ./cd.iso data_cd create an iso image of a directory
cdrecord -v dev = / dev / cdrom cd.iso an the burn the ISO image
-dc cd_iso.gz the gzip |of cdrecord dev = / dev / the cdrom – a compressed the burn the ISO image
mount -o loop cd.iso / mnt / iso an the mount the ISO image
cd-paranoia -B rip audio tracks from a CD to wav files
paranoia-the cd --“-3” rip first three audio tracks from a CD to wav files
of cdrecord --scanbus scan bus to identify the channel scsi
Networking (LAN and WiFi)
ifconfig eth0 show the configuration of the network interface eth0
ifup eth0 activate (lift) eth0 interface
ifdown eth0 deactivate (delete) eth0 interface
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 set the interface eth0 ip-address and subnet mask
ifconfig eth0 promisc translate the interface eth0 in promiscuous-mode to “capture” packets (sniffing)
ifconfig eth0 -promisc disable the promiscuous-mode on eth0
dhclient eth0 activate eth0 interface dhcp-mode.
route -n bring local routing table
netstat -rn
route add -net 0/0 gw IP_Gateway set the ip-address of the default gateway (default gateway)
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1 add a static route to the 192.168.0.0/16 network through the gateway ip-address 192.168.1.1
route del 0/0 gw IP_gateway remove the ip-address of the default gateway (default gateway)
echo “1”> / proc / sys / net / ipv4 / ip_forward allow packet forwarding (forwarding)
hostname display the name of the computer
the www the host .yandex .ru resolve the name of the www .yandex .ru host ip-address, and vice versa
host 93.158.134.3
ip link show display the status of all interfaces
mii-tool eth0 display the status and connection type for the interface eth0
ethtool eth0 Statistics eth0 displays user interface of the withdrawal of such information, as supported and current connection modes
netstat -tupn displays all installed network connections over TCP and UDP protocols without the permission of names in the ip-address and PIDs and names of processes that provide these compounds
netstat -tupln displays all network connections over TCP and UDP protocols without the permission of names in the ip-address and PIDs and names of processes, listening ports
tcpdump tcp port 80 display all traffic with the TCP-port 80 (usually – the HTTP )
iwlist scan scan the air for, availability of wireless access points
iwconfig eth1 show configuration of a wireless network interface eth1
the www the traceroute .ya .ru Trace the route to the specified host (the www .ya .ru), analogue tracert in Windows. Some distributions installed by default only traceroute6 and will have to install more manually.
Microsoft Windows networks (SAMBA)
nbtscan ip_addr resolve the netbios-name nbtscan not all systems is placed by default, you may have to install more manually. nmblookup included in the samba package.
nmblookup -A ip_addr
smbclient -L ip_addr / hostname display the resources made available to the general access to windows-machine
-RR the smb smbget: //ip_addr /this content share like wget can get files from windows-machines via smb-protocol
the smbfs -o -t the mount the username = the user, the password = pass //WinClient /this content share /mnt /this content share smb-mount resources provided for windows-machine to the local file system
IPTABLES (firewall)
iptables -t filter -nL display all the rules in a chain
iptables -nL
iptables -t nat -L show all chains of rules NAT-table
iptables -t filter -F clear all rules in a chain filter-table
iptables -F
iptables -t nat -F clear all the rules in the chain of the NAT-table
iptables -t filter -X delete all user-defined chains of rules in the filter-table
the filter -A -t the iptables the INPUT -p the tcp --dport the telnet -j the ACCEPT allow incoming telnet connection
the filter -A -t the iptables -p the tcp the OUTPUT --dport http -j the DROP block outgoing HTTP -connection
the filter -A -t the iptables -p the tcp the FORWARD --dport the pop3 -j the ACCEPT allow “prokidyval” (the forward) the POP3 -connection
the filter -A -t the iptables the INPUT -j the LOG --the log-prefix “the DROP the INPUT” enable logging kernel packages that pass through the INPUT chain, and adding to the message prefix “DROP INPUT”
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE enable NAT (Network Address Translate) of outgoing packets on interface eth0. Recommended for use with dynamically allocated ip-addresses.
the nat -A -t the iptables the PREROUTING -d 192.168.0.1 -p the tcp -m the tcp --dport 22 \
-j DNAT --to the destination-10.0.0.2:22
redirect packets addressed to a host to another host
Monitoring and Troubleshooting
top display running processes, use of resources and other useful information (automatic data update)
ps -eafw display running processes, use of resources and other useful information (once)
the pid -e -o the ps, the args --forest PIDs and output processes as a tree
pstree display a tree of processes
kill -9 98989 “Kill” the process with PID 98989 “to death” (without observing the integrity of the data)
kill -KILL 98,989
kill -TERM 98,989 Correctly complete the process with PID 98989
kill -1 98989 make the process with PID 98989 pereprochitat configuration file
kill -HUP 98989
lsof -p 98989 display a list of files opened by a process with PID 98989
lsof / home / user1 display a list of open files in the directory / home / user1
lsof -iTCP: 59302 an application that uses TCP-port 59302 (not necessarily listen)
strace -c ls> / dev / null list the system calls created and received by a process ls
strace -f -e open ls> / dev / null Challenges bring bibilotek
watch -n1 ‘cat / proc / interrupts’ interrupting display in real time
last reboot display the history of the system reboots
last user1 user1 display the user registration system in history, and during his stay there
lsmod bring loaded kernel modules
free -m show the status of RAM in megabytes
smartctl -A / dev / hda control of the state hard drive / dev / hda through SMART
smartctl -i / dev / hda check availability SMART hard disk / dev / hda
tail / var / log / dmesg display the last ten entries from the kernel boot log
tail / var / log / messages display the last ten entries from the log
Other Useful Commands
The apropos … the keyword It displays a list of commands that are somehow related to the keywords. It is useful when you know what the program does, but can not remember the command
man ping a call to work with the program management, in this case, – ping
the whatis … the keyword displays the description of the actions of this program
mkbootdisk --device / dev / fd0 `the uname -r` It creates a bootable floppy disk
gpg -c file1 file1 encrypt a file using GNU Privacy Guard
gpg file1.gpg decrypts the file file1 using GNU Privacy Guard
-r the www the wget .example .com recursively loads the contents of the site the www .example .com
-c the www the wget .example .com / file .the iso upload a file the www .example .com / file .the iso with the ability to stop and continue later
the echo ‘the wget -c the www .example .com / files is .the iso’ |AT 09:00 start a download at a specified time
ldd / usr / bin / ssh display a list of libraries required to run ssh
alias hh = ‘history’ assign an alias hh history team
(Visited 36 times, 1 visits today)
adminMy SqlTips
Command Description system information arch display computer architecture uname -m uname -r show used kernel version dmidecode -q show hardware system components - (SMBIOS / DMI) hdparm -i / dev / hda HDD output characteristics hdparm -tT / dev / sda to test the performance of reading data from the hard disk cat / proc / cpuinfo display processor information cat / proc / interrupts show...

Do you want to be notified about new DBA updates, releases, jobs and free tips? Join our email newsletter. It's fast and easy. You will be among the first to know about hot new DBA updates and stuff, it will help you enhance your DBA skills.
We take your privacy very seriously