Skip to content

andremoriya/linux-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 

Repository files navigation

linux command

ssh

ssh [remote_user]@[remote_ip]

tunnels

ssh -p [port_number] -L [local_server_port]:[local_server_ip]:[local_server_port] [remote_user]@[remote_ip]

with more connection

ssh -p [port_number] -L [local_server_port]:[local_server_ip]:[local_server_port] -L [local_server_port]:[local_server_ip]:[local_server_port] [remote_user]@[remote_ip]

ssh-keygen

Remove the RSA KEY. When display the message: "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!", execute the command

ssh-keygen -R [IP]

du

Show the file/folder size

du -s -h *

du -s -h /[folder]

du -s -h [file]

scp

scp -P [ port ] [file_name] [user]@[ IP ]:[remote path]

To copy a directory add param -r:

scp -r -P [ port ] [file_name] [user]@[ IP ]:[remote path]

update-alternatives

update-alternatives --install /usr/bin/[command_name] [command_name] [path]/bin/[some command] 100

update-alternatives --display [command_name]

update-alternatives --config [comand_name]

ls

ls -la |grep [PARAM]\ [PARAM]

ex.: ls -la |grep Feb\ 21

Clear RAM Memory Cache Buffer and Swap Space

https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/

  1. Clear PageCache only.

#echo 1 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a

  1. Clear dentries and inodes.

#echo 2 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a

  1. Clear PageCache, dentries and inodes.

#echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a

Crontab

Edit crontab

crontab -e

* * * * * /path/file.sh

Descriptions of the crontab date/time fields

field     meaning        allowed values
__________________________________________________________
  1       minute          0-59
  2       hour            0-23
  3       day of month    1-31
  4       month           1-12 (or names, see below)
  5       day of week     0-7 (0 or 7 is Sun, or use names)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published