markdown Linux - 有用的Linux命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Linux - 有用的Linux命令相关的知识,希望对你有一定的参考价值。

# Linux Commands

More info [here](http://researchhubs.com/post/computing/linux-cmd/sudo-command.html)

1. Run command as user:

`sudo -u user command` 

## Run ifconfig as www-data

More info [here](https://serverfault.com/questions/480812/privileges-for-ifconfig) and [here](http://www.andy-pearce.com/blog/posts/2013/Mar/file-capabilities-in-linux/)

`cp /sbin/ifconfig .`

`sudo setcap cap_net_admin=eip ./ifconfig`

`./ifconfig eth0 1.2.3.4` -> Succeed

`rm ifconfig` -> remove copy of ifconfig because is a security hole

## Check command history

`nano ~/.bash_history`

## Common Internet File System (CIFS)

`mount -t cifs -o username=myname //my/path/to/folder /mnt/folder`

## Other Commands

`cat /etc/passwd` - Show list of the system’s accounts and information. 

`chmod +x file.sh` - Makes file.sh executable

`ps -ef` - Display every active process in generic (Unix/Linux) format. (f) Display details

`ps aux` - (a) Show processes for all users, (u) display process user/owner, (x) Show processes not attached to a terminal.

`kill -9 <PIDNUMBER>` -  Stop the selected process

`ldd` - print shared object dependencies

`make` - utility for building and maintaining groups of programs. More info [here](https://www.tutorialspoint.com/unix_commands/make.htm)

`rm` - remove files or directories. More info [here](https://www.systutorials.com/docs/linux/man/1-rm/)

以上是关于markdown Linux - 有用的Linux命令的主要内容,如果未能解决你的问题,请参考以下文章

Linu之linux系统基础优化和基本命令

linu运维:一次linux重启时间过长的排查

linu基础

4 种绕过 Linux/Unix 命令别名的方法 | Linux 中国

arm-linu-gcc安装

linu一些相关知识