Table of Contents
Linux Skills
Return to Linux
What are the most important Linux skills you must have as a developer?
You should know Linux file commands and Linux directory commands.
List files
- ls -al
Copy files
- cp source dest
Move files
- mv source dest
Delete files
- rm
- Understand Linux file system layout.
In Linux / the root is the top of the file tree, /home is the home directory, /var/logs is where you find log files for different system services and also usually web servers. /etc is where configuration files for system services reside and also where you change network settings. /bin,/sbin,/usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin is where you normally find the system binaries you can ls these directories to look for commands.
- Know how to navigate from one directory to another.
This takes you to the root
- cd /
Go to the parent of the current directory, one level up in the directory tree closer to the root.
- cd ..
Change to a specific directory, in this case the Apache web server log files in /var/log/apache2
- cd /var/log/apache2
In Linux system the system administrator account is usually called root and is the superuser which has userid UID 0. In order to use system administration commands you must first become root. As a normal user you have command prompt $, the superuser has command prompt hash #.
- To become super user root, you can either use sudo or su depending on which Linux distro - Linux version you are using.
- sudo bash
- su
- Know basic process commands
- List all running processes, the first column list process ids that you can use with the kill command to kill process you do not want.
- ps -ef
Kill a process that you no longer want running, kill takes a signal and a PID number. Kill -9 means hard kill.
- kill -9 PID
Package management so that you can install missing packages that you need for development.
- Search for packages
Apt-cache for Debian based distributions
- apt-cache search name_of_package
Yum for Red Hat based distributions
- yum search name_of_package
Install package
- Yum for Red-Hat based Linux distributions such as Red Hat enterprise linux RHEL, Centos, Fedora
- yum install package_name
Apt-get] for Debian-based distributions such as Debian, Ubuntu and Linux Mint.
- apt-get install package_name
Source control
Know how to use source revision control systems that track changes in source code and allows collaboration with other developers such as Git and Subversion
- Init a new source control==
- git init
Clone a public git repository
- git clone https://github.com/.../somerepo.git
Pull and merge upstream changes into your repository
- git pull
Commit source code changes to git
- git commit -a
Push up source code changes to the source control server/repo
- git push
Know how to shutdown and reboot the system.
Shutdown and power off the Linux machine, remember to use sudo or su to become super user first
- shutdown -h now
Reboot / restart the machine
- reboot