0% found this document useful (0 votes)
2 views

Linux_Commands_Developer

This document provides a comprehensive list of essential Linux commands for developers, categorized into sections such as File and Directory Management, Text Processing, Networking, Process Management, Version Control (Git), System Monitoring and Disk Usage, Archive and Compression, Package Management, and Development Utilities. Each command is accompanied by a brief description and an example of its usage. It serves as a quick reference guide for developers working in a Linux environment.

Uploaded by

studyhacks88
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Linux_Commands_Developer

This document provides a comprehensive list of essential Linux commands for developers, categorized into sections such as File and Directory Management, Text Processing, Networking, Process Management, Version Control (Git), System Monitoring and Disk Usage, Archive and Compression, Package Management, and Development Utilities. Each command is accompanied by a brief description and an example of its usage. It serves as a quick reference guide for developers working in a Linux environment.

Uploaded by

studyhacks88
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Linux Commands for Developers

File and Directory Management

ls - Lists files and directories in the current directory. Example: ls -l shows

details.

cd - Changes the current directory. Example: cd /home navigates to the /home

directory.

pwd - Displays the current working directory.

mkdir - Creates a new directory. Example: mkdir project creates a folder named

'project'.

rm - Deletes files or directories. Example: rm file.txt deletes 'file.txt'. Use rm -r for

directories.

cp - Copies files or directories. Example: cp file1.txt file2.txt copies file1.txt to

file2.txt.

mv - Moves or renames files and directories. Example: mv old.txt new.txt renames

old.txt to new.txt.

touch - Creates an empty file. Example: touch file.txt creates a blank 'file.txt'.

find - Searches files and directories. Example: find / -name file.txt looks for 'file.txt'.

locate - Finds files quickly using an indexed database. Example: locate file.txt.

Text Processing

cat - Displays file contents. Example: cat file.txt shows the content of 'file.txt'.

less - Views file content page by page. Example: less file.txt.

grep - Searches for patterns in files. Example: grep 'error' log.txt finds 'error' in
log.txt.

awk - Processes and analyzes text data. Example: awk '{print $1}' file.txt prints the

first column.

sed - Performs text substitution and manipulation. Example: sed 's/old/new/g'

file.txt replaces 'old' with 'new'.

Networking

ping - Tests connectivity to a host. Example: ping google.com.

curl - Fetches data from URLs. Example: curl http://example.com downloads the

page content.

wget - Downloads files from the internet. Example: wget http://example.com/file.zip.

netstat - Displays network connections, routing tables, etc.

ss - Shows detailed network statistics. Example: ss -tuln displays listening ports.

scp - Securely copies files between servers. Example: scp file.txt user@host:/path

transfers file.txt.

ftp - Transfers files using the FTP protocol. Example: ftp hostname.

Process Management

ps - Displays current running processes. Example: ps aux shows all processes

with details.

top - Displays real-time system resource usage and running processes.

htop - An interactive process viewer (similar to top).

kill - Terminates a process by its PID. Example: kill 1234 kills the process with

PID 1234.
killall - Kills processes by name. Example: killall firefox ends all Firefox processes.

bg - Resumes a suspended job in the background.

fg - Resumes a job in the foreground.

Version Control (Git)

git init - Initializes a new Git repository.

git clone - Clones an existing repository. Example: git clone <repo_url>.

git add - Stages changes for commit. Example: git add file.txt.

git commit - Commits staged changes. Example: git commit -m 'message'.

git push - Pushes changes to a remote repository. Example: git push origin main.

git pull - Fetches and merges changes from a remote repository.

git status - Displays the status of the working directory.

git log - Shows the commit history.

git branch - Lists, creates, or deletes branches.

git merge - Merges branches together.

System Monitoring and Disk Usage

df - Displays disk space usage. Example: df -h shows human-readable disk

usage.

du - Shows directory size. Example: du -sh /home gives the size of /home.

free - Displays memory usage. Example: free -h shows human-readable memory

usage.

uptime - Shows how long the system has been running.

uname - Displays system information. Example: uname -a shows all details.


who - Shows logged-in users.

dmesg - Displays kernel log messages.

Archive and Compression

tar - Archives files. Example: tar -cvf archive.tar file.txt creates an archive.

gzip - Compresses files. Example: gzip file.txt compresses 'file.txt'.

gunzip - Decompresses files. Example: gunzip file.txt.gz decompresses 'file.txt.gz'.

zip - Creates zip archives. Example: zip archive.zip file.txt.

unzip - Extracts zip archives. Example: unzip archive.zip.

Package Management

apt-get - Installs or removes packages on Debian-based systems. Example: apt-get

install git.

yum - Installs or removes packages on RHEL-based systems. Example: yum install

git.

dnf - A newer package manager for RHEL-based systems. Example: dnf install

git.

pip - Installs Python packages. Example: pip install flask.

Development Utilities

gcc - Compiles C/C++ code. Example: gcc main.c -o main compiles 'main.c'.

make - Builds projects using Makefiles. Example: make all builds all targets.

vim - Edits text files in the terminal. Example: vim file.txt opens 'file.txt' for editing.

nano - A simple text editor. Example: nano file.txt opens 'file.txt' for editing.

ssh - Connects to remote servers securely. Example: ssh user@host.

You might also like