linux命令

消除linux声音

  取消shell bell报警声:/etc/inputrc 找到set bell-style none 将前面的#去掉,之后重启系统

  取消vi编辑器报警声: 在/etc/bashrc中加入一行: setterm -blength 0

unpack tar.gz或者tgz 文件

  通过tar命令解压 例如: tar zxvf backups.tgz

  -z : Uncompress the resulting archive with gzip command. (*.tar.gz *.tgz)
  -j : Uncompress the resulting archive with bzip2 command.(*.*.tar.bz2)
  -x : Extract to disk from the archive.
  -v : Produce verbose output i.e. show progress and file names while extracting files.
  -f backup.tgz : Read the archive from the specified file called backup.tgz.
  -C /tmp/data : Unpack/extract files in /tmp/data instead of the default current directory.

service

  service命令本身是一个shell脚本,它在/etc/init.d/目录查找指定的服务脚本,然后调用该服务脚本来完成任务。

查看linux位数

  getconf LONG_BIT

linux进程在后台运行

  (1)ctrl+z挂起该任务,然后用bg使之后台执行

  (2)我们也可以在命令后面加上&,使任务在后台运行

   如上方到后台执行的进程,其父进程还是当前终端shell的进程,而一旦父进程退出,则会发送hangup信号给所有子进程,子进程收到hangup以后也会退出。

  如果我们要在退出shell的时候继续运行进程,则需要使用nohup忽略hangup信号,或者setsid将将父进程设为init进程(进程号为1)

  命令:nohup ./test.sh & 或者 setsid ./test.sh &

  那么对于已经在后台运行的进程,也可以使用disown命令使其一直运行

  命令:jobs -l   查看任务号   如果只有一个任务使用 disown -h %1

修改时区

  复制文件到/etc目录下 sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  重新登陆即可

  

6.复制文件到/etc目录下

sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
posted @ 2017-08-19 10:19  nozbwang  阅读(211)  评论(0编辑  收藏  举报