Useful Linux commands for developers

15 April 2014

System Information

Processor Info:

 cat /proc/cpuinfo 

Memory Info:

 cat /proc/meminfo

Version of your kernel and the GCC compiler:

 cat /proc/version 

Release information

 lsb_release -a

File and display commands

Lists files with permissions, shows hidden files, displays them in a column format, and suppresses group information.

 ls -laxo

Clear screen:


Display current path:


Remove directory with all content inside:

 rm -rf example

User access

List all users

 getent passwd


 cat /etc/passwd/

List all groups

 getent group


 cat /etc/group/

Switch to a different user:

 su - user2

Display current logged user:


display members of a group:

 members mygroup

change file permission to make file executable:

 sudo chmod +x "file_name"

Open application using Super user:

 sudo open -a "app_name"

Open Graphical User Interface application using Super user:

 gksudo gedit sample.txt

Process management

List active processes:

 ps -a

discover PID of a process by name:

 pidof java

Kill process by PID:

 kill 2581

Kill process and force shutdown:

 kill -9 2581

Kill all processes with same name:

 killall java


list all running services and their status:

 service --status-all

check specific service status:

 service myservice status

start service:

 service myservice start

stop service:

 service myservice stop

check if a service is currently configured to start or not on the next reboot:

 systemctl is-enabled nginx

disable service autostart:

 systemctl disable nginx

show detailed info about a service:

 systemctl show nginx

comments powered by Disqus