Skip to content

Instantly share code, notes, and snippets.

@wolf-mtwo
Last active August 29, 2015 14:09
Show Gist options
  • Save wolf-mtwo/9590132fdca45971fc52 to your computer and use it in GitHub Desktop.
Save wolf-mtwo/9590132fdca45971fc52 to your computer and use it in GitHub Desktop.
Easy Commands CentOS 5

CHMOD

$ chmod 777 folder
$ chmod 777 1.txt
$ chmod -R 0777 /mydirectory
# drwxrwxrwx - folder
# -R recursive
000
001 1
010 2
011 3
100 4
101 5
110 6
111 7

ll

RAM

free
free -m // en MB

hard disc

df //en Bits
df- h //en Mb

touch 1.txt mkdir wolf

rm

rm wolf.txt
rm wolf -r
rm -r -f mi_directorio

Cp

cp 1.txt wolf/
cp a/ b/
cp -r a/ b/
/* b/a/ */
 
cp -p -r a/ b/

Mv

mv 1.txt a/
mv 1.txt ../

find

find -name *.txt
find -name 1*

clear

Crontab

$ man crontab
$ crontab -e

MySql

$ mysql -h localhost -u root -p
$ show databases
$ use my_table
$ show tables
$ select * from my_table
$ update my_table set meta_value='hola' where meta_id=37

Apache

vim /etc/php.ini
service httpd restart

Ifconfig

ifconfig eth0 ip/24

Tail

$ tail -f 2012.log | grep wsx
**wsx** # find word

Date

$ date
$ date --set="2 OCT 2006 18:00:00"

Cluster

ndb_mgm
show
exit

Backup MySql

$ mysqldump --opt mibase > copia_seguridad.sql

chown shredder12 file1 du -h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment