Home > quality assurance, unix > Helpful Unix Commands

Helpful Unix Commands

Below are the helpful Unix commands I learned when we handled SHINE project, where part of our QA task is to checkout/update the latest SVN codes, run maven and jetty in order for us to setup a local build and run our Selenium scripts.

1. ps aux – ps short for “process status” displays all the currently-running processes in the terminal

aux is an option where:
“a” lists all processes on a terminal, including those of other users,
“u” adds a column for the controlling user for each process, and
“x” lists all processes without controlling terminals

2. grep – searches files or string that matches the given expression

grep “id=inputaddress” *.pl – searches all files with “.pl” extension and returns files with string “id=inputaddress”

3. pipe “|” – allows you to execute number of commands in sequence

ps aux | grep jetty – displays all the currently-running processes in the terminal and filters the jetty process

exist     7712  0.0  0.0   8952   876 pts/0    S+   18:21   0:00 grep –color=auto jetty

4. kill  – sends termination signal, which requests that the process exit.

In our project we frequently used the command “kill -9” everytime our scripts hang and Google taught me that there are several ways to kill a task. Based on our output in item #3 let’s try to kill the jetty process with process ID 7712:

-9 and -KILL are options to send SIGKILL, a signal sent to a process to cause it to terminate immediately
kill -9 7712
kill -KILL 7712

-15 and -TERM are options for SIGTERM, a signal sent to a process to request its termination. This signal can do useful cleanup operations (e.g. saving configuration information to a file) before quitting
kill -15 7712
kill -TERM 7712

5. dpkg -L {package} – List where files/package are installed

dpkg -L maven2 – list where Maven is installed

Categories: quality assurance, unix Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: