LoginSignup
1
1

More than 5 years have passed since last update.

linux よく使うコマンド1(備忘録)

Posted at

ユーザ作成

[root@HOGE~]# useradd devel
[root@HOGE ~]# passwd devel
ユーザー devel のパスワードを変更。
新しいパスワード:
新しいパスワードを再入力してください:
passwd: 全ての認証トークンが正しく更新できました。

ユーザ確認

[root@HOGE ~]# cut -d: -f1 /etc/passwd
root
bin

権限付与

 chmod o+x /home/devel
[devel@HOGE ~]$ vi .bashrc
 alias sudo='sudo -E env PATH=$PATH '

検索

find /探したいディレクトリ -name 検索キーワード
find . -name "*.v" -ls
find . -type f | xargs grep hoge | less
find . -type f | grep -v .svn | xargs grep hoge | less

yumが古くてインストールできない時

[root@HOGE ~]# yum -y install zsh
Downloading Packages:
http://centos.mirror.secureax.com/6.5/os/x86_64/Packages/zsh-4.3.10-7.el6.x86_64.rpm: [Errno 12] Timeout on http://centos.mirror.secureax.com/6.5/os/x86_64/Packages/zsh-4.3.10-7.el6.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
http://ftp.iij.ad.jp/pub/linux/centos/6.5/os/x86_64/Packages/zsh-4.3.10-7.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
http://ftp.jaist.ac.jp/pub/Linux/CentOS/6.5/os/x86_64/Packages/zsh-4.3.10-7.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 503"
[root@HOGE ~]# yum clean all
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@HOGE ~]# yum -y install ftp

zshに変更

[root@HOGE ~]# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/zsh
[root@HOGE ~]# usermod -s /bin/zsh devel
[root@HOGE ~]# su devel
[devel@HOGE ~]$ echo $SHELL
/bin/zsh
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1