Frequently used commands CentOS (RedHat)

Very often I forget I command, such people, especially those who use once a month, that’s found a list of commonly used commands with a short description of what they are and how to use them, but the man has not been canceled.
File commands
lslist the files and directories
ls-alformatted list of hidden
directories and files
CD dirchange directory to dir
CDchange to your home directory
pwdshow current directory
mkdir dircreate directory dir
RM file-delete file
RM-r dirdelete the directory dir
RM-f file-delete the file manage
rm-rf dirthe dir directory boosted * delete
CP file1 file2file1 file2 copy
CP-r dir1 dir2 to dir1, dir2 copy; will create a
catalogue of dir2, if it does not exist
MV file1 file2file1 rename or move
in file2. If file2 existing directorymove
file1 file2 directory
ln-s file linklink to create a symbolic link
file file
touch file-create file
cat filesend > standard input to the file
more file-display the contents of a file
head file-the first 10 rows in the output file
tail file-bring out the last 10 lines of a file
tail-f file-display the contents of a file as you grow,
starts with the last 10 rows
Process management
PSbring your current active processes
topshow all running processes
kill pidkill the process with id pid
killallkill all processes proc named proc *
BG-list of stopped and background tasks;
to continue a stopped task in the background
FGbrings to the fore the recent tasks
FG nmaking task n to the fore
Access rights on files
chmod octal file-change file permissions in octal,
for the user, group, and for all
the addition of:
4read (r)
2record (w)
1performance (x)
Examples:
chmod 777read, write, execute for all
chmod 755rwx for owner, rx for the Group and
the rest.
Additional options: man chmod.
SSH
SSH user@host and connect to the host as a user
SSH-p port user@hostconnects to the host on port
port as user
SSHcopy-id user@host-add your key to the host
for the user to enable a login without a password, and to keys
Search
grep pattern files-search pattern files
grep-r dirsearch pattern pattern dir recursively
command | grep patternsearch for pattern in the output
command
Locate the file to find all files named file
System information
datedisplay the current date and time
CALprint calendar for the current month
uptimeshow current uptime
wshow users online
whoami is a name under which you logged in
finger user: show the information about the user
uname-a to display information about the kernel
cat/proc/cpuinfo-information CPU
cat/proc/meminfomemory information
the man command to display man page for command
DF-display info. the use of disks
dudisplay the “weightof the current directory
free memory and swap usage
whereis apppossible location program
app
which app is what the app will be run by default
Archiving
tar cf file.tar files-create a tarball named
file.tar containing files
tar xf file.tarunpack file.tar
tar czf file.tar.gz files-create a tar archive with
Gzip compression
tar xzf file.tar.gzunpack the tar with Gzip
tar cjf file.tar.bz2create a tar archive with compression
Bzip2
/xjf file.tar.bz2unpack the tar tar with Bzip2
gzip compress file-the file and rename to file.gz
gzip-d file.gz to unclench file.gz in file
tarpczf имяархива.tar.gz *compress the current folder
Network
ping hostping the host and display the result
whois domainget whois information for
domain
dig a domainget domain DNS information
dig-x hostreverse search host
wget file-download file
wget-c file-to continue a stopped download
Installing packages
Installing from source:
./configure
make
make install
dpkg-i pkg.debinstall (Debian)
rpm-Uvh pkg.rpminstall (RPM)
Keyboard shortcuts
CTRL + C to terminate the current command
CTRL + Zstop current command prodolžt′ with fg
in the foreground or in the background, bg
CTRL + Drazloginit′sâ, same as exit
CTRL + Wdelete one word in the current line
CTRL + Udelete row
!! repeat last command
exit-razloginit′sâ