Thursday, March 9, 2017

[ Linux ] Basic command line in Redhat Linux

REDHAT, LINUX, AIX(IBM), WIN

1.      Lệnh tìm các dịch vụ đang chạy

ps -ef | grep asm

2.      Lệnh xem tất cả người dùng trên Linux

[root@PTUDServer2 ~]# cat /etc/passwd

3.      Mở cổng kết nối server linux

[root@PTUDServer2 ~]# vim /etc/sysconfig/iptables
Thêm cổng:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

4.      Xem quyền thư mục, files

[oracle@PTUDServer3 ~]$ ls -l

5.      Xem thông tin vùng storage

df –h

Kết quả:
Filesystem                          Size  Used Avail Use% Mounted on
/dev/mapper/vg_ptudserver2-lv_root   50G   44G  3.3G  94% /
tmpfs                               8.0G  1.1G  7.0G  13% /dev/shm
/dev/sda1                           485M   40M  420M   9% /boot
/dev/mapper/vg_ptudserver2-lv_home  386G  9.7G  357G   3% /home

6.      Xem thông tin biến môi trường

Printenv
[oracle@PTUDServer2 ~]$ cat .bash_profile

7.      Apply biến môi trường bằng cách chạy script file

. .bash_profile

8.      Xem thông tin 1 biến

echo $PATH

9.      Xem dung lượng trong 1 thư mục

du -ah

10.  Xem thông tin quyền các file trong thư mục

ls -lt

11.  Xem log file (more)

more monitor1.log

12.  Xem nội dung cuối của file

tail –f monitor1.log

13.  Chuyển User mà load được tất cả thông tin

14.  Version của Linux

uname –m
32-bit (“i686” or “i386”)
64-bit (“x86_64”)

15.  Gán quyền sở hữu thư mục gg cho người dùng oracle

bash-4.2# chown -R oracle:oinstall gg

16.  Xem version của AIX (IBM)

bash-4.2# ls -l / |grep unix
lrwxrwxrwx    1 root     system           21 Jan 03 23:28 unix -> /usr/lib/boot/unix_64

17.  Xem thông tin user, group

ID

18.  Copy file từ WIN tới LINUX, UNIX

pscp E:\#5Prj_VTG_MONITOR\GG\aix\GG_AIX_64\ggs_AIX_ppc_ora11g_64bit.tar oracle@10.229.42.5:/u01/app/gg

19.  MV - move (rename) files

mv backup_full backup_full_$DATE

20.  chmod : gán quyền

chmod 754 myfile
4 stands for "read",
2 stands for "write",
1 stands for "execute", and
0 stands for "no permission."
So 
7 is the combination of permissions 4+2+1 (read, write, and execute), 
5 is 4+0+1(read, no write, and execute), and 
4 is 4+0+0 (read, no write, and no execute).
chmod options permissions filename
chmod u=rwx,g=rx,o=r myfile                 
The letters ug, and o stand for "user", "group", and "other"

21.  IPTABLES

cd /etc/sysconfig
[root@PTUDServer2 sysconfig]# cat iptables

22.  Giải nén file tar

tar © fbo_ggs_Linux_x64_ora11g_64bit.tar

23.  Check CR ( IP-Port)

Tracetcp
tracetcp www.microsoft.com:80 -m 60
tracetcp post.sponge.com:smtp
tracetcp 192.168.0.1 -n -t 500

Tracert <IP>
Telnet <IP> <Port>
traceroute -nT 10.30.165.147 -p 22 (linux thôi)

24.  Đổi mật khẩu user



0 nhận xét:

Post a Comment