SlideShare a Scribd company logo
Unix/Linux Command Reference .com
File Commands
ls – directory listing
ls -al – formatted listing with hidden files
cd dir - change directory to dir
cd – change to home
pwd – show current directory
mkdir dir – create a directory dir
rm file – delete file
rm -r dir – delete directory dir
rm -f file – force remove file
rm -rf dir – force remove directory dir *
cp file1 file2 – copy file1 to file2
cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it
doesn't exist
mv file1 file2 – rename or move file1 to file2
if file2 is an existing directory, moves file1 into
directory file2
ln -s file link – create symbolic link link to file
touch file – create or update file
cat > file – places standard input into file
more file – output the contents of file
head file – output the first 10 lines of file
tail file – output the last 10 lines of file
tail -f file – output the contents of file as it
grows, starting with the last 10 lines
Process Management
ps – display your currently active processes
top – display all running processes
kill pid – kill process id pid
killall proc – kill all processes named proc *
bg – lists stopped or background jobs; resume a
stopped job in the background
fg – brings the most recent job to foreground
fg n – brings job n to the foreground
File Permissions
chmod octal file – change the permissions of file
to octal, which can be found separately for user,
group, and world by adding:
● 4 – read (r)
● 2 – write (w)
● 1 – execute (x)
Examples:
chmod 777 – read, write, execute for all
chmod 755 – rwx for owner, rx for group and world
For more options, see man chmod.
SSH
ssh user@host – connect to host as user
ssh -p port user@host – connect to host on port
port as user
ssh-copy-id user@host – add your key to host for
user to enable a keyed or passwordless login
Searching
grep pattern files – search for pattern in files
grep -r pattern dir – search recursively for
pattern in dir
command | grep pattern – search for pattern in the
output of command
locate file – find all instances of file
System Info
date – show the current date and time
cal – show this month's calendar
uptime – show current uptime
w – display who is online
whoami – who you are logged in as
finger user – display information about user
uname -a – show kernel information
cat /proc/cpuinfo – cpu information
cat /proc/meminfo – memory information
man command – show the manual for command
df – show disk usage
du – show directory space usage
free – show memory and swap usage
whereis app – show possible locations of app
which app – show which app will be run by default
Compression
tar cf file.tar files – create a tar named
file.tar containing files
tar xf file.tar – extract the files from file.tar
tar czf file.tar.gz files – create a tar with
Gzip compression
tar xzf file.tar.gz – extract a tar using Gzip
tar cjf file.tar.bz2 – create a tar with Bzip2
compression
tar xjf file.tar.bz2 – extract a tar using Bzip2
gzip file – compresses file and renames it to
file.gz
gzip -d file.gz – decompresses file.gz back to
file
Network
ping host – ping host and output results
whois domain – get whois information for domain
dig domain – get DNS information for domain
dig -x host – reverse lookup host
wget file – download file
wget -c file – continue a stopped download
Installation
Install from source:
./configure
make
make install
dpkg -i pkg.deb – install a package (Debian)
rpm -Uvh pkg.rpm – install a package (RPM)
Shortcuts
Ctrl+C – halts the current command
Ctrl+Z – stops the current command, resume with
fg in the foreground or bg in the background
Ctrl+D – log out of current session, similar to exit
Ctrl+W – erases one word in the current line
Ctrl+U – erases the whole line
Ctrl+R – type to bring up a recent command
!! - repeats the last command
exit – log out of current session
* use with extreme caution.

More Related Content

PDF
LinuxCon 2015 Linux Kernel Networking Walkthrough
PDF
IP Virtual Server(IPVS) 101
PPTX
Rpl:Routing Protocol for Low-Power and Lossy Networks
PDF
MAAS High Availability Overview
PDF
Alphorm.com Formation WSUS (Windows Server Update Services) 3.0 SP2
PPT
Openstack swift - VietOpenStack 6thmeeetup
PPT
PDF
Ccnp enterprise workbook v1.0 bgp zero to hero
LinuxCon 2015 Linux Kernel Networking Walkthrough
IP Virtual Server(IPVS) 101
Rpl:Routing Protocol for Low-Power and Lossy Networks
MAAS High Availability Overview
Alphorm.com Formation WSUS (Windows Server Update Services) 3.0 SP2
Openstack swift - VietOpenStack 6thmeeetup
Ccnp enterprise workbook v1.0 bgp zero to hero

What's hot (20)

PPTX
Ansible for beginners
PPTX
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
PPTX
NGINX Installation and Tuning
PDF
The ideal and reality of NVDIMM RAS
PDF
Mikrotik VRRP
PDF
Introdução ao SNMP
PDF
Alphorm.com Formation Certification NSE4 - Fortinet Fortigate Infrastructure 6.x
PDF
OCIランタイムの筆頭「runc」を俯瞰する
PDF
Make Internet Safer with DNS Firewall - Implementation Case Study at a Major ISP
PPTX
Wireshark入門(4)
PDF
Ifupdown2: Network Interface Manager
PDF
Jakarta EE 8 on JDK17
PDF
Atelier IDS SNORT
PPT
BGP protocol presentation
PDF
macvlan and ipvlan
PPTX
OTV PPT by NETWORKERS HOME
ODP
eBPF maps 101
PPTX
Spy hard, challenges of 100G deep packet inspection on x86 platform
PDF
Alphorm.com Formation Hacking et Sécurité, l'essentiel
PDF
Ieee 802.1 x
Ansible for beginners
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
NGINX Installation and Tuning
The ideal and reality of NVDIMM RAS
Mikrotik VRRP
Introdução ao SNMP
Alphorm.com Formation Certification NSE4 - Fortinet Fortigate Infrastructure 6.x
OCIランタイムの筆頭「runc」を俯瞰する
Make Internet Safer with DNS Firewall - Implementation Case Study at a Major ISP
Wireshark入門(4)
Ifupdown2: Network Interface Manager
Jakarta EE 8 on JDK17
Atelier IDS SNORT
BGP protocol presentation
macvlan and ipvlan
OTV PPT by NETWORKERS HOME
eBPF maps 101
Spy hard, challenges of 100G deep packet inspection on x86 platform
Alphorm.com Formation Hacking et Sécurité, l'essentiel
Ieee 802.1 x
Ad

Viewers also liked (20)

PDF
3.8.b vim reference card
PPTX
La pobreza
PDF
3.1.d manual bash script guide lsstv 2.0r11
PPT
3.4 use streams, pipes and redirects v2
PPT
2.2 install boot manager
PDF
01.08.15
PPT
3.2 process text streams using filters
PPT
2.5 use rpm and yum package management
PPT
2.4.1 use debian package management v2
PPT
2.4.0 software installation v2
PPT
3.6 modify process execution priorities v2
PDF
1.1.b hdd block sector
PPT
3.7 search text files using regular expressions
PPT
3.1.c apend scripting, crond, atd
PPT
3.3 perform basic file management
PDF
Portafolio digital de-aprendizaje
PPT
4.2 maintain the integrity of filesystems
PDF
3.1.b how to - colors and prompts in bash
PPTX
Music Video Coursework - Digipak Analysis
DOCX
Dissertation
3.8.b vim reference card
La pobreza
3.1.d manual bash script guide lsstv 2.0r11
3.4 use streams, pipes and redirects v2
2.2 install boot manager
01.08.15
3.2 process text streams using filters
2.5 use rpm and yum package management
2.4.1 use debian package management v2
2.4.0 software installation v2
3.6 modify process execution priorities v2
1.1.b hdd block sector
3.7 search text files using regular expressions
3.1.c apend scripting, crond, atd
3.3 perform basic file management
Portafolio digital de-aprendizaje
4.2 maintain the integrity of filesystems
3.1.b how to - colors and prompts in bash
Music Video Coursework - Digipak Analysis
Dissertation
Ad

Similar to 3.1.a linux commands reference (20)

PDF
14.Linux Command
PDF
The Linux Command Cheat Sheet
PPTX
Basic unix
PDF
Linux command line
PDF
Unix/Linux Command Reference - File Commands and Shortcuts
PDF
linuxcommands.pdf
PDF
some title
PDF
Linuxcommands
PDF
Linux Basic Commands
PDF
Basic shell commands by Jeremy Sanders
PDF
Unix commands
PDF
Unix / Linux Command Reference
PPT
Linux ppt
PDF
Information about linux operating system
PDF
Information about linux operating system
PDF
Termux commands-list
PDF
Linux command line cheatsheet
PDF
Unix reference sheet
PPTX
Unix slideshare
PPT
14.Linux Command
The Linux Command Cheat Sheet
Basic unix
Linux command line
Unix/Linux Command Reference - File Commands and Shortcuts
linuxcommands.pdf
some title
Linuxcommands
Linux Basic Commands
Basic shell commands by Jeremy Sanders
Unix commands
Unix / Linux Command Reference
Linux ppt
Information about linux operating system
Information about linux operating system
Termux commands-list
Linux command line cheatsheet
Unix reference sheet
Unix slideshare

More from Acácio Oliveira (20)

PPTX
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
PPTX
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
PPTX
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
PPTX
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
PPTX
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
PPTX
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
PPTX
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
PPTX
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
PPTX
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
PPTX
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
PPTX
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
PPTX
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
PPTX
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
PPTX
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
PPTX
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
PPTX
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
PPTX
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
PPTX
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
PPTX
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
PPTX
Security+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptx

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
KodekX | Application Modernization Development
PDF
cuic standard and advanced reporting.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
Teaching material agriculture food technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Modernizing your data center with Dell and AMD
Approach and Philosophy of On baking technology
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
MYSQL Presentation for SQL database connectivity
Building Integrated photovoltaic BIPV_UPV.pdf
Review of recent advances in non-invasive hemoglobin estimation
The Rise and Fall of 3GPP – Time for a Sabbatical?
KodekX | Application Modernization Development
cuic standard and advanced reporting.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Teaching material agriculture food technology
The AUB Centre for AI in Media Proposal.docx
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Modernizing your data center with Dell and AMD

3.1.a linux commands reference

  • 1. Unix/Linux Command Reference .com File Commands ls – directory listing ls -al – formatted listing with hidden files cd dir - change directory to dir cd – change to home pwd – show current directory mkdir dir – create a directory dir rm file – delete file rm -r dir – delete directory dir rm -f file – force remove file rm -rf dir – force remove directory dir * cp file1 file2 – copy file1 to file2 cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it doesn't exist mv file1 file2 – rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2 ln -s file link – create symbolic link link to file touch file – create or update file cat > file – places standard input into file more file – output the contents of file head file – output the first 10 lines of file tail file – output the last 10 lines of file tail -f file – output the contents of file as it grows, starting with the last 10 lines Process Management ps – display your currently active processes top – display all running processes kill pid – kill process id pid killall proc – kill all processes named proc * bg – lists stopped or background jobs; resume a stopped job in the background fg – brings the most recent job to foreground fg n – brings job n to the foreground File Permissions chmod octal file – change the permissions of file to octal, which can be found separately for user, group, and world by adding: ● 4 – read (r) ● 2 – write (w) ● 1 – execute (x) Examples: chmod 777 – read, write, execute for all chmod 755 – rwx for owner, rx for group and world For more options, see man chmod. SSH ssh user@host – connect to host as user ssh -p port user@host – connect to host on port port as user ssh-copy-id user@host – add your key to host for user to enable a keyed or passwordless login Searching grep pattern files – search for pattern in files grep -r pattern dir – search recursively for pattern in dir command | grep pattern – search for pattern in the output of command locate file – find all instances of file System Info date – show the current date and time cal – show this month's calendar uptime – show current uptime w – display who is online whoami – who you are logged in as finger user – display information about user uname -a – show kernel information cat /proc/cpuinfo – cpu information cat /proc/meminfo – memory information man command – show the manual for command df – show disk usage du – show directory space usage free – show memory and swap usage whereis app – show possible locations of app which app – show which app will be run by default Compression tar cf file.tar files – create a tar named file.tar containing files tar xf file.tar – extract the files from file.tar tar czf file.tar.gz files – create a tar with Gzip compression tar xzf file.tar.gz – extract a tar using Gzip tar cjf file.tar.bz2 – create a tar with Bzip2 compression tar xjf file.tar.bz2 – extract a tar using Bzip2 gzip file – compresses file and renames it to file.gz gzip -d file.gz – decompresses file.gz back to file Network ping host – ping host and output results whois domain – get whois information for domain dig domain – get DNS information for domain dig -x host – reverse lookup host wget file – download file wget -c file – continue a stopped download Installation Install from source: ./configure make make install dpkg -i pkg.deb – install a package (Debian) rpm -Uvh pkg.rpm – install a package (RPM) Shortcuts Ctrl+C – halts the current command Ctrl+Z – stops the current command, resume with fg in the foreground or bg in the background Ctrl+D – log out of current session, similar to exit Ctrl+W – erases one word in the current line Ctrl+U – erases the whole line Ctrl+R – type to bring up a recent command !! - repeats the last command exit – log out of current session * use with extreme caution.