0% found this document useful (0 votes)
10 views3 pages

Linux Commands

Linux is essential in cybersecurity as it powers most servers and is favored by hackers and sysadmins for its command-line interface, providing greater control. The document covers basic Linux command-line operations, including navigating the file system, working with files and directories, and searching for files. It also explains the hierarchical structure of the Linux file system, highlighting key directories and their purposes.

Uploaded by

ahmedaryan731
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

Linux Commands

Linux is essential in cybersecurity as it powers most servers and is favored by hackers and sysadmins for its command-line interface, providing greater control. The document covers basic Linux command-line operations, including navigating the file system, working with files and directories, and searching for files. It also explains the hierarchical structure of the Linux file system, highlighting key directories and their purposes.

Uploaded by

ahmedaryan731
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Linux Fundamentals for Cybersecurity

1. Why Linux in Cybersecurity?


●​ Linux powers most servers (websites, databases, security tools).​

●​ Hackers, penetration testers, and sysadmins rely on Linux.​

●​ Unlike Windows (GUI-heavy), Linux is command-line driven → more control, more


power.​

2. Linux Command-Line Basics (Shell / Terminal)


The terminal lets you interact with the system using text commands.

a) Navigating the File System


Show current directory:​

pwd

●​ Example: /home/student​

List files/folders:​

ls
ls -l # long listing (permissions, owner, size, date)
ls -a # show hidden files (start with .)
ls -lh # human-readable file sizes

Change directory:​

cd /home # go to /home
cd .. # go up one directory
cd ~ # go to home directory

b) Working with Files


Create files:​

touch [Link] # create empty file
nano [Link] # create/edit file in nano editor
echo "Hello" > [Link] # write text into a file

View files:​

cat [Link] # show full content
less [Link] # view large files (scroll)
head -n 5 [Link] # show first 5 lines
tail -n 5 [Link] # show last 5 lines

Copy/Move/Delete:​

cp [Link] [Link] # copy file
mv [Link] /home/user/ # move/rename file
rm [Link] # delete file

c) Working with Directories


Create/Delete directories:​

mkdir projects # create directory
mkdir -p work/java # create nested dirs
rmdir empty_dir # remove empty dir
rm -r folder # remove folder with files

d) Searching & Finding Files


Find files:​

find /home -name "[Link]"

Search inside files:​



grep "keyword" [Link]
grep -i "error" [Link] # case insensitive

3. Linux File System Structure


Linux uses a hierarchical tree structure.

Directory Purpose
/ Root directory (everything starts here)

/home User directories (/home/celia)

/etc System configuration files

/bin Essential binaries (commands like ls,


cp)

/var Logs, temporary files

/tmp Temporary files (deleted on reboot)

/root Root user’s home directory

/usr Applications and utilities

Concept: Unlike Windows (C:, D: drives), Linux has one root / and everything lives under it.

You might also like