130 likes | 211 Views
This guide by Sergey Sukhonosov and Dr. Sergey Belov covers login procedures, running processes, file operations, and more on CentOS. Learn essential commands from logging in to shutting down a VM. Perfect for beginners!
E N D
Getting started with CentOS Linux Sergey Sukhonosov, Dr. Sergey Belov National Oceanographic Data Centre, Russia
Login: jboss Password: password Logging In Login: root Password: password Switch user to root: su Switch back from root to jboss exit
Running processes Check if JBoss is running: ps –ef | grep java Check if PostgreSQL is running: ps –ef | grep java
Running processes View all running processes: top
Start/Stop JBoss AS Start JBoss AS: $JBOSS_HOME/bin/jboss_init_redhat.sh start Stop JBoss AS: $JBOSS_HOME/bin/jboss_init_redhat.sh stop
Start/Stop PostgreSQL Start PostgreSQL : service postgresql-8.4 start Stop PostgreSQL : service postgresql-8.4 stop
Browsing local filesystem Print the content of a file cat filename Change the local working directory cd directory List file names in a local directory ls or ll Print the local working directory pwd
File operations Copy a file or directory cp source destination Create a directory in local file system mkdir directory Rename a file or directory mv source destination Remove a file rm file Remove a directory rm –r directory
Viewing files from the shell Display the beginning of a file head filename Display first N lines of a file head –N filename (Ex.: head -20 filename) Display the end of a file tail filename (tail –Nfilename) The more command is a "pager" utility used to view text in the terminal window one page or screen at a time. The [Space] bar moves forward one page and [Q] quits.
Editing files with editor vi Open file for editing: vi filename To start editing press INSERT key To stop editing press ESC key To exit vi and save changes :wq To exit vi without saving changes :q!
Shutdown virtual machine To shutdown vm correctly type command logging as root user: shutdown –h now