搜索和替换目录下所有htaccess文件中的代码行

时间:2018-09-21 18:31:36

标签: linux .htaccess ssh find cpanel

我有一台服务器,其中装有cPanel和一堆托管在其下的域,/ home / user /下的一个帐户已将所有.htaccess注入以下代码行

@Entity
@Table("parent")
class Parent(
   @Id @GeneratedValue(strategy = GenerationType.AUTO)
   val id: Long = 0,
   val name,
   val description,
    @OneToMany(
            cascade = [CascadeType.ALL],
            mappedBy = "parent",
            fetch = FetchType.EAGER,
            targetEntity = Child::class,
            orphanRemoval = true
    )
    @Fetch(FetchMode.SELECT)
    val children: MutableList<Child> = mutableListOf()
)

@Entity
@Table("child")
class Child(
   @Id @GeneratedValue(strategy = GenerationType.AUTO)
   val id: Long = 0,
   val childName,
   val childDescription,
   @ManyToOne(optional = false, fetch = FetchType.LAZY, targetEntity = Parent::class)
    @JoinColumn(name = "parentId",
            foreignKey = ForeignKey(name = "FK_CHILD_PARENT"),
            referencedColumnName = "id"
    )
    val parent: Parent,
    @OneToMany(
            cascade = [CascadeType.ALL],
            mappedBy = "child",
            fetch = FetchType.EAGER,
            targetEntity = GrandChild::class,
            orphanRemoval = true
    )
    @Fetch(FetchMode.SELECT)
    val grandchildren: MutableList<GrandChild> = mutableListOf()

我已经执行了find和grep命令来查找使用此代码注入的所有文件,并且至少有100个,我想从/ home / user /下的所有.htaccess文件中搜索并删除这些行,而无需清空htaccess文件。

在不删除.htaccess文件中其他代码行的情况下,我可以做哪些脚本?还是我只需要使用此代码删除所有.htaccess文件?

谢谢!

0 个答案:

没有答案