SlideShare a Scribd company logo
Linux Mint / Ubuntu Cheat Sheet www.ihaveapc.com
For more Linux tips and tricks visit - http://ihaveapc.com/category/linux/
Navigation:
pwd – print working directory
ls –la – list contents of directory
cd – change directory
cp –avr <path to source directory/file> <path to destination directory/file> - copy directory / file
mv <path to source directory/file> <path to destination directory/file> - move directory / file
mkdir <directory name> - create directory
touch <filename> - create / update file
rm –rf <directory / file name> - delete directory / file
Viewing:
cat <path to file> - view contents of a file
more <path to file> - view contents of a file (screen full at a time)
less <path to file> - view contents of a file (screen full at a time with option to scroll backwards)
nano <path to file> - create and open / open file for editing in nano text editor
vi <path to file> - create and open / open file for editing in vi text editor
head <path to file> - view first 10 lines of the file
tail <path to file> - view last 10 lines of the file
tail –f <path to file> - view last 10 lines of a changing file (usually a log file) in real time
watch <linux command> - watch the output of a command (refreshes every 2 seconds by default)
File Permissions:
File permissions representation:
- r w x(owner) r w x(group) r w x(others)
r (read) – Allows user to view the file – numerical value = 4
w (write) – Allows user to edit the file – numerical value = 2
x (execute) – Allows user to run the file as an executable – numerical value = 1
chmod 777 <path to file> - Owner, group users and other users can read, write and execute the file.
chmod 700 <path to file> - Owner can read, write and execute the file. Group users and other users do not have any
permission for the file.
chmod 666 <path to file> - All users can read and write to the file.
chmod 644 <path to file> - Owner can read and write to the file. Group users and others can only read the file.
Linux Mint / Ubuntu Cheat Sheet www.ihaveapc.com
For more Linux tips and tricks visit - http://ihaveapc.com/category/linux/
Folder Permissions:
Folder permissions representation:
d r w x(owner) r w x(group) r w x(others)
r (read) – Allows user to list the files in the directory – numerical value = 4
w (write) – Allows user to create new files and delete the files in the directory – numerical value = 2
x (execute) – Allows user to change to the directory via cd command – numerical value = 1
chmod 777 <path to folder> - Allows owner, group members and others to list files in directory, create files in
directory, delete files from the directory and to change to the directory.
chmod 755 <path to folder> - Allows owner to list files in directory, create files in directory, delete files from the
directory and to change to the directory. Group members and others can change to the directory and list the files only.
chmod 700 <path to folder> - Allows owner to list files in directory, create files in directory, delete files from the
directory and to change to the directory. Group members and others do not have any permission on the directory. This
makes the directory private to the owner.
User Management:
adduser <new user name> - create a new user
deluser <existing user name> - remove a user without removing user’s home directory
deluser <existing user name> -remove-home – remove a user with user’s home directory
addgroup <new group name> - create a new group
delgroup <existing group name> - remove a group
passwd – modify password
who – shows list of logged in users
useradd –g <group name> <user name> - add user to a group, group specified will be user’s primary group
useradd –G <group name> <user name> - add user to a group, group specified will be user’s secondary group
usermod –g <group name> <user name> - change user’s primary group
usermod –a –G <group name> <user name> - change user’s secondary group
chown <user name> <file name> - change file’s owner
chgrp <group name> <file name> - change file’s group ownership
System:
hostname - displays the hostname of Linux Mint/Ubuntu system
uptime - displays how long the system has been running
echo $SHELL - displays the current Linux Mint/Ubuntu shell being used (bash by default)
Linux Mint / Ubuntu Cheat Sheet www.ihaveapc.com
For more Linux tips and tricks visit - http://ihaveapc.com/category/linux/
man <command name> - displays the manual pages of specified command
ps – lists all the processes running in the system
top - real-time information about Linux system uptime, number of users, system load, number of tasks, and utilization
of system resources
kill -9 <pid> - kills the process with the specified process id
killall proc – kills all processes named proc*
uname –a - name, kernel version, machine type, network node host name, processor type, OS release, OS version and
other system architecture details
lsb_release –a - LSB version, distributor ID, description of distribution, release number and codename of the
distribution
df –h – display file system and disk space usage
free –m – display amount of free and used system memory
lspci – lists all PCI buses and devices connected to them
lsusb – lists all USB buses and devices connected to them
lshal – lists all the devices that HAL(Hardware Abstraction Layer) is aware about i.e. most of the hardware connected to
your system
lshw – lists hardware present in the system including information about manufacturer, device type and where it is
connected
Networking:
ping <website/ip address> - to test connectivity or response from a particular IP address or website
traceroute <website/ip address> - trace the network path to a website or IP address.
ifconfig - displays list of all network interfaces
ifconfig <interface> up - enables the specified interface
ifconfig <interface> down - disables the specified interface
iwconfig - displays list of all wireless network interfaces
ssh <user name>@<host name> - login to network host as specified user
Installation:
apt-get install <packagename> - installs specified application / package
apt-get remove <packagename> - uninstalls specified application / package
apt-get update - updates the Linux Mint / Ubuntu package lists
apt-get upgrade - upgrades the Linux Mint/Ubuntu packages
Linux Mint / Ubuntu Cheat Sheet www.ihaveapc.com
For more Linux tips and tricks visit - http://ihaveapc.com/category/linux/
apt-get -f install - troubleshoots broken packages
apt-get autoremove - automatically removes obsolete packages
Installation from source:
./configure
make
make install
Search:
locate <file name> - search the system for the specified file name
grep <pattern> <file name> - searches file for specified pattern
Linux command | grep <pattern> - searches the output of the command for the specified pattern
whereis <command> - shows the locations of the command’s executable file
which <command> - shows the executable which would be run by default for executing the command
Compression:
tar –czvf <archive name>.tar.gz <file name 1> <file name 2>…<file name n> - create a tarball by compressing the
specified files
tar –xzvf <archive name>.tar.gz – extract files from a tarball
tar –cf <archive name>.tar <file name 1> <file name 2>…<file name n> - create a tar archive by compressing the
specified files
tar –xf <archive name>.tar – extract files from a tar archive
gzip <file name> - compresses a file and creates a gzip archive called <file name>.gz
gzip –d <file name>.gz – extracts files from a gzip archive
Power:
poweroff – powers off the system
reboot – reboots the system
echo b > /proc/sysrq-trigger – hard reboot

More Related Content

What's hot

Linux
LinuxLinux
Ipc in linux
Ipc in linuxIpc in linux
Ipc in linux
Dr. C.V. Suresh Babu
 
Elasticsearch features and ecosystem
Elasticsearch features and ecosystemElasticsearch features and ecosystem
Elasticsearch features and ecosystem
Pavel Alexeev
 
basic linux command (questions)
basic linux command (questions)basic linux command (questions)
basic linux command (questions)
Sukhraj Singh
 
Glusterfs 구성제안 및_운영가이드_v2.0
Glusterfs 구성제안 및_운영가이드_v2.0Glusterfs 구성제안 및_운영가이드_v2.0
Glusterfs 구성제안 및_운영가이드_v2.0sprdd
 
Linux cheat-sheet
Linux cheat-sheetLinux cheat-sheet
Linux cheat-sheet
Craig Cannon
 
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVMHypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
vwchu
 
Linux File System
Linux File SystemLinux File System
Linux File System
Anil Kumar Pugalia
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
Anil Kumar Pugalia
 
Linux Interrupts
Linux InterruptsLinux Interrupts
Linux Interrupts
Kernel TLV
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and Analysis
Paul V. Novarese
 
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Stefano Stabellini
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysis
Anne Nicolas
 
Hypervisor
HypervisorHypervisor
Hypervisor
kalpita surve
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver
艾鍗科技
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
Alexei Starovoitov
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
Buland Singh
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
Kernel TLV
 
Unix file api’s
Unix file api’sUnix file api’s
Unix file api’s
Sunil Rm
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 

What's hot (20)

Linux
LinuxLinux
Linux
 
Ipc in linux
Ipc in linuxIpc in linux
Ipc in linux
 
Elasticsearch features and ecosystem
Elasticsearch features and ecosystemElasticsearch features and ecosystem
Elasticsearch features and ecosystem
 
basic linux command (questions)
basic linux command (questions)basic linux command (questions)
basic linux command (questions)
 
Glusterfs 구성제안 및_운영가이드_v2.0
Glusterfs 구성제안 및_운영가이드_v2.0Glusterfs 구성제안 및_운영가이드_v2.0
Glusterfs 구성제안 및_운영가이드_v2.0
 
Linux cheat-sheet
Linux cheat-sheetLinux cheat-sheet
Linux cheat-sheet
 
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVMHypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
Linux Interrupts
Linux InterruptsLinux Interrupts
Linux Interrupts
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and Analysis
 
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysis
 
Hypervisor
HypervisorHypervisor
Hypervisor
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Unix file api’s
Unix file api’sUnix file api’s
Unix file api’s
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 

Similar to Linux command line cheatsheet

Rhel1
Rhel1Rhel1
Basics of Linux
Basics of LinuxBasics of Linux
Basics of Linux
SaifUrRahman180
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
hetaldobariya
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
Lilesh Pathe
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3
Gourav Varma
 
Unixcommandsinetltesting 130712050932-phpapp01
Unixcommandsinetltesting 130712050932-phpapp01Unixcommandsinetltesting 130712050932-phpapp01
Unixcommandsinetltesting 130712050932-phpapp01
Gyanendra Kumar
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testing
Garuda Trainings
 
Linux
LinuxLinux
Linux ppt
Linux pptLinux ppt
Linux ppt
Sanmuga Nathan
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebook
Yash Gulati
 
Linux Commandos Cheat
Linux Commandos CheatLinux Commandos Cheat
Linux Commandos Cheat
Alvaro Gomes
 
Linux
LinuxLinux
3.1.a linux commands reference
3.1.a linux commands reference3.1.a linux commands reference
3.1.a linux commands reference
Acácio Oliveira
 
Linux ppt
Linux pptLinux ppt
Linux ppt
Rohit Kumar
 
Common linux ubuntu commands overview
Common linux  ubuntu commands overviewCommon linux  ubuntu commands overview
Common linux ubuntu commands overview
Ameer Sameer
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
Dima Gomaa
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebook
Yash Gulati
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
Teja Bheemanapally
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
Muhammad Qazi
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
Hanan Nmr
 

Similar to Linux command line cheatsheet (20)

Rhel1
Rhel1Rhel1
Rhel1
 
Basics of Linux
Basics of LinuxBasics of Linux
Basics of Linux
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3
 
Unixcommandsinetltesting 130712050932-phpapp01
Unixcommandsinetltesting 130712050932-phpapp01Unixcommandsinetltesting 130712050932-phpapp01
Unixcommandsinetltesting 130712050932-phpapp01
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testing
 
Linux
LinuxLinux
Linux
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebook
 
Linux Commandos Cheat
Linux Commandos CheatLinux Commandos Cheat
Linux Commandos Cheat
 
Linux
LinuxLinux
Linux
 
3.1.a linux commands reference
3.1.a linux commands reference3.1.a linux commands reference
3.1.a linux commands reference
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Common linux ubuntu commands overview
Common linux  ubuntu commands overviewCommon linux  ubuntu commands overview
Common linux ubuntu commands overview
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebook
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 

Recently uploaded

Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 

Recently uploaded (20)

Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 

Linux command line cheatsheet

  • 1. Linux Mint / Ubuntu Cheat Sheet www.ihaveapc.com For more Linux tips and tricks visit - http://ihaveapc.com/category/linux/ Navigation: pwd – print working directory ls –la – list contents of directory cd – change directory cp –avr <path to source directory/file> <path to destination directory/file> - copy directory / file mv <path to source directory/file> <path to destination directory/file> - move directory / file mkdir <directory name> - create directory touch <filename> - create / update file rm –rf <directory / file name> - delete directory / file Viewing: cat <path to file> - view contents of a file more <path to file> - view contents of a file (screen full at a time) less <path to file> - view contents of a file (screen full at a time with option to scroll backwards) nano <path to file> - create and open / open file for editing in nano text editor vi <path to file> - create and open / open file for editing in vi text editor head <path to file> - view first 10 lines of the file tail <path to file> - view last 10 lines of the file tail –f <path to file> - view last 10 lines of a changing file (usually a log file) in real time watch <linux command> - watch the output of a command (refreshes every 2 seconds by default) File Permissions: File permissions representation: - r w x(owner) r w x(group) r w x(others) r (read) – Allows user to view the file – numerical value = 4 w (write) – Allows user to edit the file – numerical value = 2 x (execute) – Allows user to run the file as an executable – numerical value = 1 chmod 777 <path to file> - Owner, group users and other users can read, write and execute the file. chmod 700 <path to file> - Owner can read, write and execute the file. Group users and other users do not have any permission for the file. chmod 666 <path to file> - All users can read and write to the file. chmod 644 <path to file> - Owner can read and write to the file. Group users and others can only read the file.
  • 2. Linux Mint / Ubuntu Cheat Sheet www.ihaveapc.com For more Linux tips and tricks visit - http://ihaveapc.com/category/linux/ Folder Permissions: Folder permissions representation: d r w x(owner) r w x(group) r w x(others) r (read) – Allows user to list the files in the directory – numerical value = 4 w (write) – Allows user to create new files and delete the files in the directory – numerical value = 2 x (execute) – Allows user to change to the directory via cd command – numerical value = 1 chmod 777 <path to folder> - Allows owner, group members and others to list files in directory, create files in directory, delete files from the directory and to change to the directory. chmod 755 <path to folder> - Allows owner to list files in directory, create files in directory, delete files from the directory and to change to the directory. Group members and others can change to the directory and list the files only. chmod 700 <path to folder> - Allows owner to list files in directory, create files in directory, delete files from the directory and to change to the directory. Group members and others do not have any permission on the directory. This makes the directory private to the owner. User Management: adduser <new user name> - create a new user deluser <existing user name> - remove a user without removing user’s home directory deluser <existing user name> -remove-home – remove a user with user’s home directory addgroup <new group name> - create a new group delgroup <existing group name> - remove a group passwd – modify password who – shows list of logged in users useradd –g <group name> <user name> - add user to a group, group specified will be user’s primary group useradd –G <group name> <user name> - add user to a group, group specified will be user’s secondary group usermod –g <group name> <user name> - change user’s primary group usermod –a –G <group name> <user name> - change user’s secondary group chown <user name> <file name> - change file’s owner chgrp <group name> <file name> - change file’s group ownership System: hostname - displays the hostname of Linux Mint/Ubuntu system uptime - displays how long the system has been running echo $SHELL - displays the current Linux Mint/Ubuntu shell being used (bash by default)
  • 3. Linux Mint / Ubuntu Cheat Sheet www.ihaveapc.com For more Linux tips and tricks visit - http://ihaveapc.com/category/linux/ man <command name> - displays the manual pages of specified command ps – lists all the processes running in the system top - real-time information about Linux system uptime, number of users, system load, number of tasks, and utilization of system resources kill -9 <pid> - kills the process with the specified process id killall proc – kills all processes named proc* uname –a - name, kernel version, machine type, network node host name, processor type, OS release, OS version and other system architecture details lsb_release –a - LSB version, distributor ID, description of distribution, release number and codename of the distribution df –h – display file system and disk space usage free –m – display amount of free and used system memory lspci – lists all PCI buses and devices connected to them lsusb – lists all USB buses and devices connected to them lshal – lists all the devices that HAL(Hardware Abstraction Layer) is aware about i.e. most of the hardware connected to your system lshw – lists hardware present in the system including information about manufacturer, device type and where it is connected Networking: ping <website/ip address> - to test connectivity or response from a particular IP address or website traceroute <website/ip address> - trace the network path to a website or IP address. ifconfig - displays list of all network interfaces ifconfig <interface> up - enables the specified interface ifconfig <interface> down - disables the specified interface iwconfig - displays list of all wireless network interfaces ssh <user name>@<host name> - login to network host as specified user Installation: apt-get install <packagename> - installs specified application / package apt-get remove <packagename> - uninstalls specified application / package apt-get update - updates the Linux Mint / Ubuntu package lists apt-get upgrade - upgrades the Linux Mint/Ubuntu packages
  • 4. Linux Mint / Ubuntu Cheat Sheet www.ihaveapc.com For more Linux tips and tricks visit - http://ihaveapc.com/category/linux/ apt-get -f install - troubleshoots broken packages apt-get autoremove - automatically removes obsolete packages Installation from source: ./configure make make install Search: locate <file name> - search the system for the specified file name grep <pattern> <file name> - searches file for specified pattern Linux command | grep <pattern> - searches the output of the command for the specified pattern whereis <command> - shows the locations of the command’s executable file which <command> - shows the executable which would be run by default for executing the command Compression: tar –czvf <archive name>.tar.gz <file name 1> <file name 2>…<file name n> - create a tarball by compressing the specified files tar –xzvf <archive name>.tar.gz – extract files from a tarball tar –cf <archive name>.tar <file name 1> <file name 2>…<file name n> - create a tar archive by compressing the specified files tar –xf <archive name>.tar – extract files from a tar archive gzip <file name> - compresses a file and creates a gzip archive called <file name>.gz gzip –d <file name>.gz – extracts files from a gzip archive Power: poweroff – powers off the system reboot – reboots the system echo b > /proc/sysrq-trigger – hard reboot