VMware+Linux 使用笔记

这篇博客详细记录了在VMware中使用Linux时,如何利用apt进行软件安装,包括遇到问题时的解决办法,以及安装和配置samba、tftp和svn的过程,是Linux初学者的实用教程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

0. Linux Command

   # grep 
     e.g. grep -R abc /etc/network/     #-R ,"chmod -R"
          [other param] grep -l -n -v
   
   # find
     e.g. find -type f -exec grep aaaa {} \;
          [other param] find -name -size -perm -type -ctime -a -o -exec -ok
   
   # input/output redirect
     command > a.txt         command >> a.txt
     command 2> a.txt        command 2>> a.txt
     command > a.txt 2>&1   command &> a.txt
   
   # tar
     e.g. tar cvf 123.tar /etc/network/
          tar xvf 123.tar
         
          tar cvfz 123.tar.gz /etc/network/
          tar xvfz 123.tar.gz
         
          tar cvfj 123.tar.bzip /etc/network/
          tar xvfj 123.tar.bzip
         
          # "tar rvf 123.tar.gz/123.tar.bzip" is not invalid  
          tar rvf 123.tar /etc/abc/ /etc/we/  #append tar
          tar tvf 123.tar                     #review tar
          tar tvf 123.tar.gz                  #review zip
          tar tvf 123.tar.bzip                #review bzip
   
       man tar
          c [create]
          x [extract]
          v [verbose]
          f [file]
          z [gzip]
          j [bzip2]
            

1. 软件安装工具apt

     在利用apt工具安装软件时,若安装软件包出问题,则可以尝试一下更新软件包列表和软件更新,方法如下:

        # apt-get update     //获取最新的软件包列表
        # apt-get upgrade    //软件更新
     如果更新失败,则可以进一步尝试更新apt源,即更新 /etc/apt/sources.list
     比如,在Ubuntu 12.10版本可以使用如下源列表:
        deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
        deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
        deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
        deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
        deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
        deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
        deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
        deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
        deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
        deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
   

2. 利用apt工具安装常用软件     

   1)ssh的安装和启动
         # apt-cache search sshd
         # apt-get install openssh-server 
         # /etc/init.d/ssh start
   2)其他软件的安装类似,比如samba、svn等
         # apt-get install samba 
         # apt-get install subversion
     

3. samba                                                                     

   1) 修改 /etc/samba/ 目录下的 smb.conf ,增加如下配置                      
      [username]                                                                 
         path = /home/username                                                   
         available = yes                                                        
         browsealbe = yes                                                       
         public = yes                                                           
         writable = yes                                                         
         valid users = username                                                                                                                         
   2)添加samba用户名和密码                                                  
         # useradd username   (一般第一步中设置的users为已经存在的用户,因此,username一般已经存在,无需进行useradd操作)                                                
         # smbpasswd -a username                                                                                                                             
   3)启动samba服务                                                          
         # service smbd start                                                   
         重启samba服务                                                          
         # service smbd restart                                                                                                                         
   4)windows中直接从工具中映射网络驱动器即可                                
         映射文件夹设置:\\虚拟机IP\samba用户名(举例:\\192.168.5.170\username)

补充:

            ① 检测samba配置smb.conf的正确性的命令 testparm
            ② 查看samba(smb.conf)所有设定值(包括smb.conf中没有设定的默认值),则可以使用 testparm -v


4. tftp

      tftp -r abc.txt -g 192.168.0.2      
      tftp -r abc.txt -p 192.168.0.2   
   

5. svn

   svn checkout https://192.168.10.165/svn/GR-3000-V1/code
   svn add file
   svn commit -m "修改说明" file
   svn update [ -r version ]
   svn status
   svn diff    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值