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

Unix Commands

The document provides a comprehensive overview of various command-line commands used for file system navigation, file manipulation, process management, text processing, network communication, and system administration. Each command is accompanied by a brief description and an example of its usage. This serves as a quick reference guide for users to efficiently interact with the command line interface.

Uploaded by

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

Unix Commands

The document provides a comprehensive overview of various command-line commands used for file system navigation, file manipulation, process management, text processing, network communication, and system administration. Each command is accompanied by a brief description and an example of its usage. This serves as a quick reference guide for users to efficiently interact with the command line interface.

Uploaded by

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

File System Navigation :

Command Description Example

cd Changes the current working directory. cd Documents

Lists files and directories in the current


ls
ls directory.

pwd Prints the current working directory. pwd

mkdir Creates a new directory. mkdir new_folder

rmdir Removes an empty directory. rmdir empty_folder

mv file1.txt
Moves files or directories.
mv Documents/

File Manipulation

Command Description Example

Creates an empty file or updates the access


touch new_file.txt
touch and modification times.

cp file1.txt
Copies files or directories.
cp file2.txt

mv file1.txt
Moves files or directories.
mv Documents
Command Description Example

rm Remove files or directories. rm old_file.txt

Concatenates files and displays their cat file1.txt


cat contents. file2.txt

head Displays the first few lines of a file. head file.txt

tail Displays the last few lines of a file. tail file.txt

Process Management

Command Description Example

Displays information about active processes,


ps aux
ps including their status and IDs.

Displays a dynamic real-time view of system


top
top processes and their resource usage.

Terminates processes using their process IDs


kill <pid>
kill (PIDs).

Sends signals to processes based on name or


pkill -9 firefox
pkill other attributes.

killall -9
Terminates processes by name.
killall firefox

renice Changes the priority of running processes. renice -n 10


Command Description Example

<pid>

Runs a command with modified scheduling nice -n 10


nice priority. command

pstree Displays running processes as a tree. pstree

Searches for processes by name or other


pgrep firefox
pgrep attributes.

Lists active jobs and their status in the current


jobs
jobs shell session.

Text Processing

Command Description Example

grep Searches for patterns in text files. grep "error" logfile.txt

Network Communication

Command Description Example

Tests connectivity with another host using ping


ping ICMP echo requests. google.com

host Performs DNS lookups, displaying domain host


Command Description Example

name to IP address resolution. google.com

hostname Displays or sets the system’s hostname. hostname

System Administration

Command Description Example

df Displays disk space usage. df -h

Displays disk usage of files and du -sh


du directories. /path/to/directory

You might also like