Linun tranning in company

Joined a Linux tranning in company and share the notes, thanks.

=======class 1: mianly for basic commands=======

normal --> root
su -


root-- >other use
su - wasadmin


Linux basic commands:
cd ..
pwd
ls: show path or directory
ls -ls: details
ls -l -a: show detialsi including hidden files
mkdir <directory>
touch <file name>: create a file
rmdir <directory>
rm <file name>
copy <source file> <destination file>
Cp -rp <source diretory> <destination directory>
mv <source file/directory> <destination file/directory>: move or rename

cat <source file name>: display all content
less <source file name>:  display content page by page, more page by PgUp or PgDn button
cd ~: home directory
ls .: current directly
cd ..: go to parnet directory


Echo “hello world” > /tmp/testfile


=======class 2: mainly for FS=======

three type of disks : local , SAN and NAS

1.
Command to check disks(SAN/local disk) :      lsscsi
then such as dev/sr0, dev/sda, dev/sdb will be the disks.

Command to check disks size(san disk):      fdisk –l /dev/sda
Command to check disks size(loal disk):      lsblk (fyi: lsblk | tail -5)
Command to check disks size(nas disk):      df –h  (  AIX : df –g)


2.
Create a filesystem and mount(command runing within root):
comamnd: pvcreate /dev/sdb3  -----> create physical volumn
         vgcreate  vg03  /dev/sdb3  -----> create volumn group
         lvcreate -L 1G -n lv_test vg03  -----> create logic volumn
        
create FS: mkfs.ext4 /dev/mapper/vg03-lv_test
mount: mount /dev/mapper/vg03-lv_test /usr/tmp/higirlbehappy

3.
verify/view command(need run within root):
-vgs
-lvs
-pgs


4.
umount the FS(or mountpoint):umount /var/tmp/higirlbehappy    
verify comamnd: df /var/tmp/higirlbehappy    

remove logic volume command:lvremove
verify command: lvs


=======class 3: mianly for persmission=======
edit file in AIX: command vi, such as vi test.txt/touch test.txt
edit file in AIX: command nano, such as nano test.txt/touch test.txt(save file: ctrl+o, exit: ctrl + x)

how to check a user: id userid
check all the accounts: cat /ect/passwd
check all the groups: cat/etc/group         cat /etc/group | grep cmbitid


change the owner of file/folder
command: chown <user.group> <file/folder>
command sample: chown cmbitid.loggrp test

change the permisson fo file/folder:
command: chmod <u/g/o> <+/-r/w/x> <file/folder>
command sample: chmod u+x,o+r test
command sample: chmod u-wx, g-r,o-r test or chmod 755 folder

r(4)w(2)x(1)
Users : rwx = 4+2+1 = 7
Groups : r-x = 4+1 = 5
Others : --- = 0


What is /etc/fstab file ?
The fstab file is read by the mount command, which happens automatically at boot time to determine the overall file system

structure
The NAS filesystem will NOT mount after reboot!

How to add an NAS filesystem entry into /etc/fstab ?

Vi /etc/fstab
Edit file , add the line to bottom <NAS volume> <directory / mount point> nfs default 0 0
Save the /etc/fstab
Run the command “mount”




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值