Skip to content

Latest commit

 

History

History
123 lines (59 loc) · 1.87 KB

terminal-commands.md

File metadata and controls

123 lines (59 loc) · 1.87 KB

Terminal Commands

find a process

    ps -aef 

search for string

    grep node

find a process called node

    ps -aef | grep node
    pgrep node

find a process named node and kill it

    ps -aef | grep node
    kill -9 {pid}
    pkill node

follow the tail/end of a text file:

    tail -f {logfile}

get help/manual for command:

    man {command}

run server in background

    nohup node server.js &

check what sudo permissions your user has:

    sudo -l

example for running command as sudo:

    sudo pkill

yum is the package manager for centOS

    yum install {command}

example:

    yum install nginx

start/stop nginx service

    sudo service nginx {start/stop}

put foreground process to sleep

    CONTROL-Z

wake up the last process you put to sleep

    fg 

show all sleeping processes

    jobs

emacs/vi editor

    emacs/vi {file}

detach the session and run in the background.

    nohup node server.js &

change the default pw through SSH

    passwd {username}

**see the menue of nano **

    man nano

create account

    sudo adduser {your uname}

give the sudo right to new user

    sudo visudo
    # User privilege specification -----> add new user

give the user ssh right

    sudo nano /etc/ssh/sshd_config
    #change to no to disable tunnelled clear text passwords ----> PasswordAuthentication yes

restart server

    sudo nano /etc/ssh/sshd_config

exit ssh

    exit

hide hidden files

    defaults write com.apple.finder AppleShowAllFiles -bool {true/false}

start a http server

    python -m SimpleHTTPServer 3000