CommandDescription
system information
archdisplay computer architecture
uname -m
uname -rshow used kernel version
dmidecode -qshow hardware system components – (SMBIOS / DMI)
hdparm -i / dev / hdaHDD output characteristics
hdparm -tT / dev / sdato test the performance of reading data from the hard disk
cat / proc / cpuinfodisplay processor information
cat / proc / interruptsshow interrupts
cat / proc / meminfocheck memory usage
cat / proc / swapsshow file (s) swap
cat / proc / versiondisplay kernel version
cat / proc / net / devshow network interfaces and statistics on them
cat / proc / mountsdisplay mounted file systems
lspci -tvshow in a tree PCI devices
lsusb -tvshow in the form of a USB device tree
datebring the system date
cal 2007display table calendar 2007 year
date 041217002007.00set the system date and time MMDDChChmmGGGG.SS (MesyatsDenChasMinutyGod.Sekundy)
clock -wkeep the system time in the BIOS
Stop system
shutdown -h nowStop system
init 0
telinit 0
shutdown -h hours: minutes &schedule the system to stop at a specified time
shutdown -ccancel a planned scheduled stop system
shutdown -r nowreboot the system
reboot
logoutlogout
Files and directories
cd / homego to the directory ‘/ home’
cd ..go into the directory level above
cd ../ ..go to the directory two levels above
cdgo to your home directory
cd ~ usergo to the user’s home directory user
cd –go to the directory where you were before the transition to the current directory
pwdshow current directory
lsdisplay the contents of the current directory
ls -Fdisplay the contents of the current directory with the addition of a character name, type hrakterizuyuschih
ls -lshow details view of files and directories in the current directory
ls -aShow hidden files and folders in the current directory
ls * [0-9] *show files and directory containing numbers in a name
treeshow files and directories in a tree starting from root (/)
lstree
mkdir dir1create a directory called ‘dir1’
mkdir dir1 dir2create two directories simultaneously
mkdir -p / tmp / dir1 / dir2create a directory tree
rm -f file1delete a file called ‘file1’
rmdir dir1remove a directory called ‘dir1’
rm -rf dir1remove a directory called ‘dir1’ and recursively all of its contents
rm -rf dir1 dir2remove two directories and their contents recursively
mv dir1 new_dirrename or move a file or directory
cp file1 file2sopirovat 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 dir2copy the directory dir1 to dir2 directory
ln -s file1 lnk1create a symbolic link to a file or directory
ln file1 lnk1create a “rigid” (physical) link to a file or directory
touch -t 0712250000 fileditestmodify 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 file1find files and directories with the name file1. Search to begin with root (/)
find / -user user1search 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 +100find all files in the ‘/ usr / bin’, time of last access to which more than 100 days
find / usr / bin -type f -mtime -10find 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 haltIt shows the placement of binary files, source code and manuals relating to the file ‘halt’
which haltIt displays the full path to ‘halt’
Mounting File Systems
mount / dev / hda2 / mnt / hda2mounts section ‘hda2’ in the mount point ‘/ mnt / hda2’. Make sure you have a mount-point directory ‘/ mnt / hda2’
umount / dev / hda2unmount the section ‘hda2’. Before performing, leave ‘/ mnt / hda2’
fuser -km / mnt / hda2Forced unmount section. It is used when a section is occupied by any user
umount -n / mnt / hda2razmonitrovanie 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 / floppymount the floppy drive
mount / dev / cdrom / mnt / cdrommount the CD or DVD
mount / dev / hdc / mnt / cdrecordermount the CD-R / CD-RW or DVD-R / DVD-RW (+ -)
mount -o loop file.iso / mnt / cdrommount ISO -image
mount -t vfat / dev / hda5 / mnt / hda5mount 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 sharemount 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 -hdisplays 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 |moreIt produces a list of files and directories recursively sorted ascending size and allows for paging
du -sh dir1calculates and displays the size occupied by directory ‘dir1’ (Prim.perevodchika. -h key does not work in all * nix systems)
* -sk du |The sort -rnIt 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,1nshows 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,1nshows the size of disk space occupied by the file deb-package, sorted by size (ubuntu, debian, etc.)
Users and Groups
groupadd group_namecreate a new group with the name group_name
groupdel group_nameremove group group_name
groupmod -n new_group_name old_group_namerename old_group_name group new_group_name
useradd -c “Nome Cognome” -g admin -d / home / user1 -s / bin / bash user1create 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 user1create user user1
userdel -r user1delete 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 user1change user attributes
passwdChange password
passwd user1change the password of the user user1 (root only)
chage -E 2005-12-31 user1set the expiration date of the user account user1
pwckvalidate the system account files. Checks the file / etc / passwd and / etc / shadow
grpckvalidates the system account files. Checking the file / etc / group
newgrp [-] group_namechange 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 -lhview of authority to the files and directories in the current directory
the ls / tmp directory |the pr $ -W T5 the COLUMNSdisplay the contents of the / tmp directory and divide the output into five columns
chmod ugo + rwx directory1add 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 directory1away from the group and others full authority to the directory directory1.
chown user1 file1assign ownership to the user user1 file1 file
chown -R user1 directory1appoint recursively owner user1 directory1 User directory
chgrp group1 file1change the owner group of file1 in the group1
chown user1: group1 file1Change the owner and group owner of the file file1
find / -perm -u + sfind, starting from the root, all files with SUID exposed
chmod u + s / bin / binary_fileassign SUID-bit file / bin / binary_file. This allows any users to execute a file with the file owner permissions.
chmod us / bin / binary_fileremove the SUID-bit with the file / bin / binary_file.
chmod g + s / home / publicappoint SGID-bit directory / home / public.
chmod gs / home / publicremove SGID-bit with the directory / home / public.
chmod o + t / home / publicappoint STIKY-bit directory / home / public. It allows you to delete only the owners
chmod ot / home / publicremove STIKY-bit with the directory / home / public
Special file attributes
chattr + a file1allow to open a file for writing only in append mode
chattr + c file1It allows the kernel to automatically compress / decompress the file.
chattr + d file1ukazavet dump utility to ignore this file during the execution of the backup
chattr + i file1It makes the file inaccessible to any changes: edit, delete, move, create links to it.
chattr + s file1It 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 file1It indicates that, when changes are saved, synchronization is performed as when the sync command
chattr + u file1this attribute indicates that the file is deleted, its contents will be saved and, if necessary, the user can restore it
lsattrshow file attributes
Archive and compress files
bunzip2 file1.bz2decompresses the file ‘file1.gz’
gunzip file1.gz
gzip file1squeezes ‘file1’ file
bzip2 file1
gzip -9 file1file1 compress a file with maximum compression
rar a file1.rar test_filecreate a rar-archive ‘file1.rar’ and include the file test_file
rar a file1.rar file1 file2 dir1create a rar-archive ‘file1.rar’ and include the file1, file2 and dir1
unrar x file1.rarunpack rar-archive
tar -cvf archive.tar file1create a tar-archive archive.tar, containing the file file1
tar -cvf archive.tar file1 file2 dir1create a tar-archive archive.tar, containing file1, file2, and dir1
tar -tf archive.tarshow the contents of the archive
tar -xvf archive.tarunzip
tar -xvf archive.tar -C / tmpunzip the file in / tmp
tar -cvfj archive.tar.bz2 dir1create an archive and compress it using the bzip2 (Prim.perevodchika. -j key does not work in all * nix systems)
tar -xvfj archive.tar.bz2decompress the archive and extract it (Prim.perevodchika. -j key does not work in all * nix systems)
tar -cvfz archive.tar.gz dir1create an archive and compress it with gzip
tar -xvfz archive.tar.gzdecompress the archive and extract it
zip file1.zip file1create a compressed zip-archive
zip -r file1.zip file1 file2 dir1create a compressed zip-file and from the inclusion of multiple files and / or directories
unzip file1.zipdecompress and extract the zip-archive
RPM Packages (Fedora, Red Hat and like)
rpm -ivh package.rpminstall the package with the output messages and progress bar
-ivh the rpm --nodeps package.rpminstall the package with the output messages and progress bar without control dependencies
rpm -U package.rpmupdate the package without configuration file changes, in the absence of the package, it will be installed
rpm -F package.rpmupdate package only if it is installed
rpm -e package_name.rpmremove a package
rpm -qalist all packages installed on the system
-qa the rpm |the grep the httpdamong all the packages installed on the system, find a package with the name “httpd”
rpm -qi package_namedisplay information about the package konkrentnom
rpm -qg “System Environment / Daemons”display packages included in the package group
rpm -ql package_namedisplay a list of files included in the package
rpm -qc package_namedisplay a list of configuration files provided by a package
-q package_name the rpm --whatrequiresdisplay the list of packages required to install specific dependencies on the package
-q package_name the rpm --whatprovidesshow capability provided by a rpm package
-q package_name the rpm --scripts directorywill show scripts started during installation / removal package
-q package_name the rpm --the changelogdisplay package revision history
rpm -qf /etc/httpd/conf/httpd.confverify which package belongs to the specified file. Pointing is the full path and file name.
rpm -qp package.rpm -lIt 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 KEYiportirovat public key digital signature
the rpm --checksig package.rpmcheck package signatures
rpm -qa gpg-pubkeycheck the integrity of the contents of the package set
rpm -V package_namecheck file size, permissions, type, owner, group, MD5-sum and date of last modification package
rpm -Vacheck all packages installed on the system. Use with caution!
rpm -Vp package.rpmcheck 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.rpminstall a package compiled from source
the rpmbuild --rebuild the package_name.src.rpmcompile the package from source
YUM – vehicle upgrade packages (Fedora, RedHat, etc.)
yum install package_nameupload and selected to install package
yum updateupdate all packages installed on the system
yum update package_nameupdate package
yum remove package_nameremove a package
yum listlist all packages installed on the system
yum search package_namefind a package in the repository
yum clean packagescleanse rpm-cache, deleting the downloaded packages
yum clean headersremove all the file headers that the system uses to resolve dependency
yum clean allcleanse rpm-cache, deleting the downloaded packages and headers
DEB packages (Debian, Ubuntu, etc.)
dpkg -i package.debinstall / upgrade package
dpkg -r package_nameremove the package from the system
dpkg -lshow all packages installed in
-l the dpkg |the grep the httpdamong all the packages installed on the system, find a package with the name “httpd”
dpkg -s package_namedisplay information may be requested on a specific package
dpkg -L package_namelist of files included in the package installed in the system
the dpkg --contents The package.debdisplay a list of files included in the package that Yeshe is not installed in the system
dpkg -S / bin / pingfind a package that includes the file specified.
APT – package management tool (Debian, Ubuntu, etc.)
apt-get install package_nameinstall / upgrade package
apt-cdrom install package_nameinstall / upgrade the package to the CDROM
apt-get updateget updated lists of packages
apt-get upgradeupdate packages installed in
apt-get remove package_nameremove the packages installed on the system to save the configuration file
apt-get purge package_nameremove the packages installed on the system with the remote configuration files
apt-get checkcheck the integrity of dependencies
apt-get cleandelete the downloaded archive package files
apt-get autocleandelete old downloaded archive package files
View the contents of files
cat file1print the contents of file1 to the standard output ustroysva
tac file1print the contents of file1 to the standard ustroysva output in reverse order (the last line to become the first, and so on)
more file1paged content of file1 to the standard output
less file1paged 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 file1to bring the first two lines of file1 to the standard output. The default output ten lines
tail -2 file1output the last two lines of file1 to the standard output. The default output ten lines
tail -f / var / log / messagesdisplay 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.txtthe 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.txtthe 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 / messagesfrom file ‘/ var / log / messages’ to select and display the standard output device line containing “Aug”
the grep ^Date Aug / the var / the log / messagesfrom file ‘/ var / log / messages’ to select and print to standard output lines that begin with “Aug”
grep [0-9] / var / log / messagesfrom 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.txtin example.txt file replace “string1” to “string2”, the result output to standard output.
the sed '/^$/d ‘example.txtremove blank lines from file example.txt
the sed '/ *#/d; /^$/d ‘example.txtremove blank lines and comments from example.txt file
the echo ‘test’ |tr ‘[: lower:]’ ‘[: upper:]’convert from lower case to upper
sed -e ‘1d’ result.txtremove 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.txtremove empty characters at the end of each line
-e the sed ‘s /string1 //g’ example.txtremove the string “string1” from text without changing the rest of the
sed -n ‘1,8p; 5q’ example.txttake the file from the first to the eighth row and the output of which the first five
sed -n ‘5p; 5q’ example.txtbring the fifth row
sed -e ‘s / * 0/0 / g’ example.txtreplace a sequence of any number of zeros with a single zero
cat -n file1number 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 file2combine 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 file2combine the contents of file1 and file2 as a table with the separator “+”
sort file1 file2sort contents of two files
file2 file1 is The sort |uniqsort contents of two files omitting lines repeated
file2 file1 is The sort |uniq -usort 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 -dsort contents of two files by viewing only duplicate line
comm -1 file1 file2compare the contents of two files by displaying the line belonging to the file ‘file1’
comm -2 file1 file2compare the contents of two files by displaying the line belonging to the file ‘file2’
comm -3 file1 file2compare contents of two files by deleting only the lines that appear in both files
Converting character sets and file formats
dos2unix filedos.txt fileunix.txtconvert the file in text format from MSDOS to UNIX (in characters koretki refund the difference)
unix2dos fileunix.txt filedos.txtconvert the file in text format from UNIX to MSDOS (in characters koretki refund the difference)
.. the recode the HTML <page.txt> page.htmlconvert the contents of the test page.txt file in a html-file page.html
-l the recode |moredisplay a list of available formats
Analysis of the file systems
badblocks -v / dev / hda1check hda1 partition for bad-blocks
fsck / dev / hda1repair / check integrity of linux-file system partition hda1
fsck.ext2 / dev / hda1repair / check integrity of ext2 filesystem on disk hda1
e2fsck / dev / hda1
e2fsck -j / dev / hda1repair / check integrity of ext3 filesystem on disk hda1 with the indication that the journal is located in the same place
fsck.ext3 / dev / hda1repair / check integrity of ext3 filesystem on disk hda1
fsck.vfat / dev / hda1repair / check integrity of fat filesystem on disk hda1
fsck.msdos / dev / hda1
dosfsck / dev / hda1
Formatting File Systems
mkfs / dev / hda1create a linux-filesystem on hda1 section
mke2fs / dev / hda1create an ext2 filesystem on hda1 section
mke2fs -j / dev / hda1to create an ext3 file system are logged on hda1 section
mkfs -t vfat 32 -F / dev / hda1create a FAT32 file system on hda1 section
fdformat -n / dev / fd0formatting a floppy disk without checking
mkswap / dev / hda3creation of swap-space section hda3
swap-space
mkswap / dev / hda3creation of swap-space section hda3
swapon / dev / hda3activate the swap-space, located on the section hda3
swapon / dev / hda2 / dev / hdb3activate the swap-space, located on sections hda2 and hdb3
Creating a backup (backup)
dump -0aj -f /tmp/home0.bak / hometo create a full backup of the / home directory in a file /tmp/home0.bak
dump -1aj -f /tmp/home0.bak / homemake a incremental backup of the / home directory in a file /tmp/home0.bak
restore -if /tmp/home0.bakrestore from backup /tmp/home0.bak
-rogpav the rsync --the delete / home / tmp directorysynchronize the / tmp / home
-rogpav the ssh -e the rsync --the delete / home ip_address: / tmp directorysynchronize via SSH -FLASH
-az the ssh -e the rsync --the delete ip_addr: / home / the public / home / localsynchronize 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 publicsynchronize 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 / usermake 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.bz2search 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 = 1make a copy of MBR (Master Boot Record) to / dev / hda on the floppy disk
dd if = / dev / fd0 of = / dev / hda bs = 512 count = 1restore the MBR from a floppy disk on / dev / hda
CDROM
cdrecord -v gracetime = 2 dev = / dev / cdrom -eject blank = fast -forceclean a rewritable cdrom
mkisofs / dev / cdrom> cd.isocreate an iso image of cdrom on disk
of mkisofs / dev / the cdrom |the gzip> cd_iso.gzcreate a compressed iso image of cdrom on disk
mkisofs -J -allow-leading-dots -R -V “Label CD” -iso-level 4 -o ./cd.iso data_cdcreate an iso image of a directory
cdrecord -v dev = / dev / cdrom cd.isoan 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 / isoan the mount the ISO image
cd-paranoia -Brip 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 --scanbusscan bus to identify the channel scsi
Networking (LAN and WiFi)
ifconfig eth0show the configuration of the network interface eth0
ifup eth0activate (lift) eth0 interface
ifdown eth0deactivate (delete) eth0 interface
ifconfig eth0 192.168.1.1 netmask 255.255.255.0set the interface eth0 ip-address and subnet mask
ifconfig eth0 promisctranslate the interface eth0 in promiscuous-mode to “capture” packets (sniffing)
ifconfig eth0 -promiscdisable the promiscuous-mode on eth0
dhclient eth0activate eth0 interface dhcp-mode.
route -nbring local routing table
netstat -rn
route add -net 0/0 gw IP_Gatewayset 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.1add 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_gatewayremove the ip-address of the default gateway (default gateway)
echo “1”> / proc / sys / net / ipv4 / ip_forwardallow packet forwarding (forwarding)
hostnamedisplay the name of the computer
the www the host .yandex .ruresolve the name of the www .yandex .ru host ip-address, and vice versa
host 93.158.134.3
ip link showdisplay the status of all interfaces
mii-tool eth0display the status and connection type for the interface eth0
ethtool eth0Statistics eth0 displays user interface of the withdrawal of such information, as supported and current connection modes
netstat -tupndisplays 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 -tuplndisplays 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 80display all traffic with the TCP-port 80 (usually – the HTTP )
iwlist scanscan the air for, availability of wireless access points
iwconfig eth1show configuration of a wireless network interface eth1
the www the traceroute .ya .ruTrace 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_addrresolve 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 / hostnamedisplay the resources made available to the general access to windows-machine
-RR the smb smbget: //ip_addr /this content sharelike 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 sharesmb-mount resources provided for windows-machine to the local file system
IPTABLES (firewall)
iptables -t filter -nLdisplay all the rules in a chain
iptables -nL
iptables -t nat -Lshow all chains of rules NAT-table
iptables -t filter -Fclear all rules in a chain filter-table
iptables -F
iptables -t nat -Fclear all the rules in the chain of the NAT-table
iptables -t filter -Xdelete 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 ACCEPTallow incoming telnet connection
the filter -A -t the iptables -p the tcp the OUTPUT --dport http -j the DROPblock outgoing HTTP -connection
the filter -A -t the iptables -p the tcp the FORWARD --dport the pop3 -j the ACCEPTallow “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 MASQUERADEenable 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
topdisplay running processes, use of resources and other useful information (automatic data update)
ps -eafwdisplay running processes, use of resources and other useful information (once)
the pid -e -o the ps, the args --forestPIDs and output processes as a tree
pstreedisplay 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,989Correctly complete the process with PID 98989
kill -1 98989make the process with PID 98989 pereprochitat configuration file
kill -HUP 98989
lsof -p 98989display a list of files opened by a process with PID 98989
lsof / home / user1display a list of open files in the directory / home / user1
lsof -iTCP: 59302an application that uses TCP-port 59302 (not necessarily listen)
strace -c ls> / dev / nulllist the system calls created and received by a process ls
strace -f -e open ls> / dev / nullChallenges bring bibilotek
watch -n1 ‘cat / proc / interrupts’interrupting display in real time
last rebootdisplay the history of the system reboots
last user1user1 display the user registration system in history, and during his stay there
lsmodbring loaded kernel modules
free -mshow the status of RAM in megabytes
smartctl -A / dev / hdacontrol of the state hard drive / dev / hda through SMART
smartctl -i / dev / hdacheck availability SMART hard disk / dev / hda
tail / var / log / dmesgdisplay the last ten entries from the kernel boot log
tail / var / log / messagesdisplay the last ten entries from the log
Other Useful Commands
The apropos … the keywordIt 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 pinga call to work with the program management, in this case, – ping
the whatis … the keyworddisplays the description of the actions of this program
mkbootdisk --device / dev / fd0 `the uname -r`It creates a bootable floppy disk
gpg -c file1file1 encrypt a file using GNU Privacy Guard
gpg file1.gpgdecrypts the file file1 using GNU Privacy Guard
-r the www the wget .example .comrecursively loads the contents of the site the www .example .com
-c the www the wget .example .com / file .the isoupload 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:00start a download at a specified time
ldd / usr / bin / sshdisplay a list of libraries required to run ssh
alias hh = ‘history’assign an alias hh history team
(Visited 81 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