Tuesday, January 4, 2011

Linux Commands

Linux Commands


Command Description
pwd to get the present working directory
ls listing out current directory entries
cd change directory
ps aux to get the present running process details
kill -9 to kill a specific process using process id
killall -9

to kill a set of processes of same name
ll same as ls but long list
./startup.sh (assuming current directory is tomcat bin) to start tomcat server
tail to see last few lines of give file
ex: tail logs/catalina.out (pwd is tomcat home)
tail -f to see last few lines of give file continuously until Ctrl+c is pressed
ex: tail -f logs/catalina.out (pwd is tomcat home)
cp to copy the files
ex: cp /var/abc.txt /var/ex/
scp to copy the files to a remote system

ex: scp /var/abc.txt root@23.22.82.247:/var/new_liferay

you need to enter the remote server password before copy
rm to delete a file
mv to move or rename of file
free [-m] to see the current RAM usage
ex: free or free -m
df [-h] to see the disk usage.
mysql -U root -pkmipl to connect to mysql.
service mysqld to see the status/start/stop of mysql service
ssh  23.22.82.247  -l root to access remote server ( 23.22.82.247 ) from terminal
vi for editing a file.

2 comments:

  1. to connect to mysql

    mysql -U root -pkmipl
    or

    mtsql -U username databasename

    ReplyDelete
  2. service mysqld to see the status/start/stop of mysql service
    or

    /etc/init.d/mysql status
    '' '' '' start

    ReplyDelete