Add some aliases for your commands
.bashrc
is a file that stores the alias of command,
its content executed each time the shell is opened.
So we can add alias in the file by:
1 vim $HOME/.bashrc
Then, for example, if we wanna use the colored version of ls
without typing “—color” mechanically & repeatedly, add an
alias ls=”ls —color” at the end of the file.
Check your unwired lan driver
lspci
is a command that lists all your PCI’s conditions.
We can check our drivers using grep and pipe:
1 | lspci | grep -i ethernet |
Task management
We can see the detailed information of our tasks
by commandjobs -l
and:
kill them usingkill -KILL [pid]
,
stop them usingkill -STOP [pid]
,
continue themkill -CONT [pid]
.
If we wanna terminate all our processeskill -KILL -1
halt
, shutdown
, reboot
halt
shuts down the system, but users still need to manually turn off the electricity.
shutdown
requires parameters to function. It will both shut down the system and the electricity.
reboot
restarts the system.Both of them requires a root authentication.
Pass Parameters to your shell script
For example, if we wanna edit an existent text, and if the file doesn’t exist, the system shall create one, we can write a script named ‘’edit.sh”” as below:
1
2
3
4
5
6
7 name=$1
if [ -d /e/blog/source/_posts/${name} ]
then
echo "${name} does not exist\n"
hexo new ${name}
fi
vim /e/blog/source/_posts/${name}then:
1 chmod 755 edit.shSo can we call the
edit.sh
as if using a built-in command.
1 edit.sh "FOO"
Convert .deb into .tar
安装alien
1 | # 从镜像站下载alien的rpm包 |
使用alien
1 | alien -r filename.deb generated |