Sum up - Linux Interview Questions (Updating)

2 篇文章 0 订阅
2 篇文章 0 订阅

Linux / Shell  interview questions

 

1.    Write a command that will look for files with anextension “c”, and has the occurrence of the string “apple” in it.

Find ./ -name “*.c” | xargs grep –i “apple”

2.    Xargs 代替一堆parameters,就是把之前的参数都在这次传进来,比如你想rm一堆你你find到的文件,likethis:rm`find /path -type f`。但是这样会报错,参数太多,所以需要改成这样find/path -type f -print0 | xargs -0 rm。记住:单纯的”|”是不管用的,因为是rm sth而不是sth->命令,所以”|”没用。

3.    Valid Phone Number:

cat file.txt | grep -E "^(([0-9]{3})|[0-9]{3}-)[0-9]{3}-[0-9]{4}$"

4.    Let’s say you maintains a backup on regularbasis for the company you are working. The backups are maintained in Compressedfile format. You need to examine a log, two months old. What would you suggestwithout decompressing the compressed file?

5.  # zcat ­f phpshell­2.4.tar.gz

 

6.    You need to track events on your system. Whatwill you do?

Running ‘syslogd‘ application in terminalgenerates log file at the location ‘/var/log/syslog‘. The syslogd applicationis very useful in troubleshooting Linux sytems. A sample log file looks similarto below.

 

7.    Telnet and SSH both are communication protocolwhich are used to manage remote system. SSH is Secured, which requiresexchanging of key opposite of telnet which transmit data in plain text, whichmeans telnet is less secure than SSH.

8.     You need to search for the string “Tecmint” in allthe “.txt” files in the current directory. How will you do it?

9.  # find -­name “*.txt” | xargs grep “Tecmint”


当启动MySQL时,出现"Starting MySQL. ERROR! Manager of pid-file quit without updating file"错误提示。这个错误通常是由于MySQL无法正常更新pid文件而导致的。 解决这个问题的方法有以下几种: 1. 检查my.cnf配置文件:打开my.cnf文件,并确保在下添加了datadir=/data/mysql/的配置。这里的/data/mysql是你的数据库文件目录,根据你的实际情况进行调整。这样可以帮助MySQL正确找到数据库文件目录并更新pid文件。 2. 检查pid文件路径:检查my.cnf配置文件中的server_pid_file项,确保其指定的路径和实际的pid文件路径相匹配。有时候,如果pid文件的路径与实际存放的位置不一致,会导致pid文件更新失败。确保路径正确可以解决这个问题。 3. 检查权限问题:确保MySQL所在的目录和文件具有正确的权限。特别是pid文件所在的目录,确保MySQL进程有足够的权限来创建和更新该文件。如果权限设置不正确,可以使用chmod命令修改权限。 这些方法可以帮助你解决"Starting MySQL. ERROR! Manager of pid-file quit without updating file"错误。根据具体情况,选择适合你的方法进行操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [MYSQL Starting MySQL. ERROR! Manager of pid-file quit without updating file](https://blog.csdn.net/weixin_34253539/article/details/92762368)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [启动mysql报错(Starting MySQL..Manager of pid-file quit without updating f[失败]) 解决方法集锦...](https://blog.csdn.net/weixin_30908941/article/details/98582288)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值