SlideShare uma empresa Scribd logo
1 de 4
Baixar para ler offline
Linux Commands Cheat-sheet
General Linux Commands
● To print today’s date: ​date
● To print hostname of the pc: ​hostname
● To perform basic mathematical calculation: ​expr [number 1 (+/-/(/)/*) number 2
(+/-/(/)/*) number 3 . . . ]
● To print string of characters: ​echo “Any string”
● To print name of the OS: ​uname
● To print details of the OS: ​uname -a
● To print version of the bash: ​bash --version
● Debugging a program: ​echo $?
● To print history of commands typed on the terminal: ​history
● To change hostname: ​hostnamectl set-hostname --static "name of your choice"
File Management
● To see only files: ​ls
● To see lists even hidden files: ​ls -a
● To see details of the files: ​ls -l
● To see details of the normal and hidden files: ​ls -la
● To remove a file from current directory: ​r​m [filename in any format]
● To remove all files from current directory: ​rm -a
● To ​change directory, to move around to different folders: ​cd ./name of the directory
● To return directly to home directory: ​cd
● To return to previous folder: ​cd ..
● To make a directory: ​mkdir
● To remove a directory: ​rmdir
● To remove a directory and all of its contents recursively: rmdir -r [name of the directory]
● To change permissions of accessibility of file in the terminal: ​chmod +x ‘filename’
● To download a folder: ​(wget or (curl -L))
http://udacity.github.io/ud595-shell/stuff.zip -o things.zip
● To show current directory: ​pwd
● To read a file from terminal: ​cat <name of the file in .txt format>
● To​ ​read a file one at a time from terminal:​ ​less [name of the file in .txt format]
● To copy a file: ​cp <name of the file to be copied> <new name of the file that will
be copied>
● To move a file​: ​mv <name of the file> <directory file to be moved>
● To create a file: ​touch <filename.extension>
● To open a folder: ​nautilus /<destination of the directory>
● To create shortcut for commands: ​alias <user defined shortcut key>=‘<command>’
1
● To see list of block devices i.e. internal and external hard drives:​ ​lsblk
● To burn .iso image in USB: ​sudo dd if=nameoffile.iso of=/dev/destinationdisk bs=1M
● To have access as root user: ​sudo passwd root​ followed by ​su -
● To open terminal text editor either vim or nano: ​vim​ (for vim) or ​nano​ (for nano)
● To check architecture if 32 or 64 bit:​ ​arch​ result x86_64 for 64 bit and i386 for 32 bit
● For loop syntax(to automate making of files or folders):
for i in {1...x};
do
mk or mkdir [file or folder name with extension]
done
Note:
● Tab completion makes life easier in order to complete the file or directory name.
● To use globbing commands, refer udacity last lecture of Linux Basic commands.
Network command lines for Linux
● To display HTTP header(information about server and cookies): ​printf 'HEAD /
HTTP/1.1rnHost: [host address]rnrn' | nc [host address] 80
●
● To check IP address and details about mail handled of a website: ​host [domain name]
● To test network connection if it is established and speed of the connection:​ ​ping [domain name]
● To check how network is configured. Displays NAT ip addresses of ethernet connection and wifi
and all other information: ​ifconfig
● To check all the information of network devices whether they are active or inactive: ​ifconfig -a
● To enable or disable one of the networking device:​ ​ifconfig [name of the device] [up to
enable and down to disable]
● To display ethernet address of the current network card: ​arp
● To change​ ​ip address:​ ​ifconfig (name of the device) ip address of your desire
● To change subnet mask: ​ifconfig (name of the device) netmask 255.255.255.1
● To change mac address: ​ifconfig (name of the device) hw ether 43:42:12. .
● To display more information about wifi:​ ​iwconfig
● To show only ip addresses of all the devices rather than just domains connected to machine:
netstat -nr
● To display the usage of the network cards(to show how many packets in bytes are sent and
transferred): ​netstat -i
● To look for active internet connections: ​netstat -ta
● To look for active internet connections: ​netstat -tan
● To find detailed information of a domain: ​whois (domain name)
● To perform detailed DNS lookup: ​dig (domain name)
● To perform DNS lookup: ​nfslookup (domain name)
● To trace no. of hops taken to access domain and lists all the routers the packets come across:
traceroute (domain name)
● To show hostname:​ ​hostname
2
● To show ip addresses both ipv4 and and ipv6:​ ​hostname -I
● To capture all packets that are going to and from the pc:​ ​sudo tcpdump
● To capture only certain amount of packets: ​sudo tcpdump -c no. of packets to be
captured(amount in numbers)
● To capture only certain amount of packets in hexadecimal or ascii format: ​sudo tcpdump (-XX for
hexa or -A) for ASCII -c 5
Useful command-lines for C
● To compile a file in ​.c​ format:​ ​clang file.c
● Executable file ​a.out​ is generated. To run this file:​ ​./a.out
● To generate executable file with nicer name:​ ​clang -o file file.c​. ​Now,​ ​./file​ ​can be run.
● To use make command to generate executable file, MakeFile has to be present in the directory where
.c​ ​files are stored.
● MakeFile source code:
# compile the hello program with spaces instead of Tabs
# the compiler to use
CC = clang
# compiler flags:
# -g adds debugging information to the executable file
# -Wall turns on most, but not all, compiler warnings
CFLAGS = -ggdb3 -Wall -Werror -lm
#files to link:
LFLAGS = -lcs50
# require that an argument be provided at the command line for the target name:
TARGET = $(target)
all: ​$(TARGET)
$(TARGET)​: ​$(TARGET)​.c ; ​$(CC)​ ​$(CFLAGS)​ -o ​$(TARGET)​ ​$(TARGET)​.c ​$(LFLAGS)
● To generate assembly code:​ ​clang -S filename.c
Useful command-lines for Python
● To open python file, write the following code inside python script:​ ​#! /usr/bin/python3
● To disable assertions:​ ​- o filename.py
3
Useful command-lines for Java
● To compile a java file to generate .class executable file: ​javac filename.java
● To run java file on terminal or console:​ ​java filename
4

Mais conteúdo relacionado

Mais procurados

PowerDNS-Admin vs DNS-UI
PowerDNS-Admin vs DNS-UIPowerDNS-Admin vs DNS-UI
PowerDNS-Admin vs DNS-UIbarbarousisk
 
Oracle ACFS High Availability NFS Services (HANFS) Part-I
Oracle ACFS High Availability NFS Services (HANFS) Part-IOracle ACFS High Availability NFS Services (HANFS) Part-I
Oracle ACFS High Availability NFS Services (HANFS) Part-IAnju Garg
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different hostOsama Mustafa
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Ludovico Caldara
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar Kumar
 
Episode 2 DB2 pureScale Installation, Instance Management &amp; Monitoring
Episode 2 DB2 pureScale Installation, Instance Management &amp; MonitoringEpisode 2 DB2 pureScale Installation, Instance Management &amp; Monitoring
Episode 2 DB2 pureScale Installation, Instance Management &amp; MonitoringLaura Hood
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바NeoClova
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
 
/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repositoryJukka Zitting
 
What's new in Oracle 19c & 18c Recovery Manager (RMAN)
What's new in Oracle 19c & 18c Recovery Manager (RMAN)What's new in Oracle 19c & 18c Recovery Manager (RMAN)
What's new in Oracle 19c & 18c Recovery Manager (RMAN)Satishbabu Gunukula
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016Brendan Gregg
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recoveryYogiji Creations
 
ceph optimization on ssd ilsoo byun-short
ceph optimization on ssd ilsoo byun-shortceph optimization on ssd ilsoo byun-short
ceph optimization on ssd ilsoo byun-shortNAVER D2
 
MySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsMySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsFrederic Descamps
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsBrendan Gregg
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMiguel Araújo
 
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OSPractical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OSCuneyt Goksu
 
Db2 hadr commands
Db2 hadr commandsDb2 hadr commands
Db2 hadr commandsvnanaji
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupHighly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupNilnandan Joshi
 

Mais procurados (20)

PowerDNS-Admin vs DNS-UI
PowerDNS-Admin vs DNS-UIPowerDNS-Admin vs DNS-UI
PowerDNS-Admin vs DNS-UI
 
Oracle ACFS High Availability NFS Services (HANFS) Part-I
Oracle ACFS High Availability NFS Services (HANFS) Part-IOracle ACFS High Availability NFS Services (HANFS) Part-I
Oracle ACFS High Availability NFS Services (HANFS) Part-I
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Episode 2 DB2 pureScale Installation, Instance Management &amp; Monitoring
Episode 2 DB2 pureScale Installation, Instance Management &amp; MonitoringEpisode 2 DB2 pureScale Installation, Instance Management &amp; Monitoring
Episode 2 DB2 pureScale Installation, Instance Management &amp; Monitoring
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
 
/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository/path/to/content - the Apache Jackrabbit content repository
/path/to/content - the Apache Jackrabbit content repository
 
What's new in Oracle 19c & 18c Recovery Manager (RMAN)
What's new in Oracle 19c & 18c Recovery Manager (RMAN)What's new in Oracle 19c & 18c Recovery Manager (RMAN)
What's new in Oracle 19c & 18c Recovery Manager (RMAN)
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
ceph optimization on ssd ilsoo byun-short
ceph optimization on ssd ilsoo byun-shortceph optimization on ssd ilsoo byun-short
ceph optimization on ssd ilsoo byun-short
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
 
MySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsMySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & Operations
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
 
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OSPractical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
 
Db2 hadr commands
Db2 hadr commandsDb2 hadr commands
Db2 hadr commands
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupHighly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackup
 

Semelhante a Linux Commands - Cheat Sheet (20)

Linux tech talk
Linux tech talkLinux tech talk
Linux tech talk
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Raj linux
Raj linux Raj linux
Raj linux
 
Rhel3
Rhel3Rhel3
Rhel3
 
Linux Workshop , Day 3
Linux Workshop , Day 3Linux Workshop , Day 3
Linux Workshop , Day 3
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
Linux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compactLinux Capabilities - eng - v2.1.5, compact
Linux Capabilities - eng - v2.1.5, compact
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Linux
LinuxLinux
Linux
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 

Mais de Isham Rashik

Text Preprocessing - 1
Text Preprocessing - 1Text Preprocessing - 1
Text Preprocessing - 1Isham Rashik
 
9608 Computer Science Cambridge International AS level Pre-Release May June p...
9608 Computer Science Cambridge International AS level Pre-Release May June p...9608 Computer Science Cambridge International AS level Pre-Release May June p...
9608 Computer Science Cambridge International AS level Pre-Release May June p...Isham Rashik
 
Fundamentals of Cryptography - Caesar Cipher - Python
Fundamentals of Cryptography - Caesar Cipher - Python Fundamentals of Cryptography - Caesar Cipher - Python
Fundamentals of Cryptography - Caesar Cipher - Python Isham Rashik
 
Python 3.x Dictionaries and Sets Cheatsheet
Python 3.x Dictionaries and Sets CheatsheetPython 3.x Dictionaries and Sets Cheatsheet
Python 3.x Dictionaries and Sets CheatsheetIsham Rashik
 
HackerRank Repeated String Problem
HackerRank Repeated String ProblemHackerRank Repeated String Problem
HackerRank Repeated String ProblemIsham Rashik
 
Operations Management - BSB INC - Case Study
Operations Management - BSB INC - Case StudyOperations Management - BSB INC - Case Study
Operations Management - BSB INC - Case StudyIsham Rashik
 
Corporate Finance - Disney Sea Park Project
Corporate Finance - Disney Sea Park ProjectCorporate Finance - Disney Sea Park Project
Corporate Finance - Disney Sea Park ProjectIsham Rashik
 
Questionnaire - Why women entrepreneurs are happier than men?
Questionnaire - Why women entrepreneurs are happier than men?Questionnaire - Why women entrepreneurs are happier than men?
Questionnaire - Why women entrepreneurs are happier than men?Isham Rashik
 
Human Resource Management - Different Interview Techniques
Human Resource Management - Different Interview TechniquesHuman Resource Management - Different Interview Techniques
Human Resource Management - Different Interview TechniquesIsham Rashik
 
Python 3.x File Object Manipulation Cheatsheet
Python 3.x File Object Manipulation CheatsheetPython 3.x File Object Manipulation Cheatsheet
Python 3.x File Object Manipulation CheatsheetIsham Rashik
 
Android Application Development - Level 3
Android Application Development - Level 3Android Application Development - Level 3
Android Application Development - Level 3Isham Rashik
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2Isham Rashik
 
Android Application Development - Level 1
Android Application Development - Level 1Android Application Development - Level 1
Android Application Development - Level 1Isham Rashik
 
Managerial Skills Presentation - Elon Musk
Managerial Skills Presentation - Elon MuskManagerial Skills Presentation - Elon Musk
Managerial Skills Presentation - Elon MuskIsham Rashik
 
Operations Management - Business Process Reengineering - Example
Operations Management - Business Process Reengineering - ExampleOperations Management - Business Process Reengineering - Example
Operations Management - Business Process Reengineering - ExampleIsham Rashik
 
Lighting Design - Theory and Calculations
Lighting Design - Theory and CalculationsLighting Design - Theory and Calculations
Lighting Design - Theory and CalculationsIsham Rashik
 
Linear Control Hard-Disk Read/Write Controller Assignment
Linear Control Hard-Disk Read/Write Controller AssignmentLinear Control Hard-Disk Read/Write Controller Assignment
Linear Control Hard-Disk Read/Write Controller AssignmentIsham Rashik
 
Transformers and Induction Motors
Transformers and Induction MotorsTransformers and Induction Motors
Transformers and Induction MotorsIsham Rashik
 
Three phase balanced load circuits and synchronous generators
Three phase balanced load circuits and synchronous generatorsThree phase balanced load circuits and synchronous generators
Three phase balanced load circuits and synchronous generatorsIsham Rashik
 
Circuit Breakers for Low Voltage Applications
Circuit Breakers for Low Voltage ApplicationsCircuit Breakers for Low Voltage Applications
Circuit Breakers for Low Voltage ApplicationsIsham Rashik
 

Mais de Isham Rashik (20)

Text Preprocessing - 1
Text Preprocessing - 1Text Preprocessing - 1
Text Preprocessing - 1
 
9608 Computer Science Cambridge International AS level Pre-Release May June p...
9608 Computer Science Cambridge International AS level Pre-Release May June p...9608 Computer Science Cambridge International AS level Pre-Release May June p...
9608 Computer Science Cambridge International AS level Pre-Release May June p...
 
Fundamentals of Cryptography - Caesar Cipher - Python
Fundamentals of Cryptography - Caesar Cipher - Python Fundamentals of Cryptography - Caesar Cipher - Python
Fundamentals of Cryptography - Caesar Cipher - Python
 
Python 3.x Dictionaries and Sets Cheatsheet
Python 3.x Dictionaries and Sets CheatsheetPython 3.x Dictionaries and Sets Cheatsheet
Python 3.x Dictionaries and Sets Cheatsheet
 
HackerRank Repeated String Problem
HackerRank Repeated String ProblemHackerRank Repeated String Problem
HackerRank Repeated String Problem
 
Operations Management - BSB INC - Case Study
Operations Management - BSB INC - Case StudyOperations Management - BSB INC - Case Study
Operations Management - BSB INC - Case Study
 
Corporate Finance - Disney Sea Park Project
Corporate Finance - Disney Sea Park ProjectCorporate Finance - Disney Sea Park Project
Corporate Finance - Disney Sea Park Project
 
Questionnaire - Why women entrepreneurs are happier than men?
Questionnaire - Why women entrepreneurs are happier than men?Questionnaire - Why women entrepreneurs are happier than men?
Questionnaire - Why women entrepreneurs are happier than men?
 
Human Resource Management - Different Interview Techniques
Human Resource Management - Different Interview TechniquesHuman Resource Management - Different Interview Techniques
Human Resource Management - Different Interview Techniques
 
Python 3.x File Object Manipulation Cheatsheet
Python 3.x File Object Manipulation CheatsheetPython 3.x File Object Manipulation Cheatsheet
Python 3.x File Object Manipulation Cheatsheet
 
Android Application Development - Level 3
Android Application Development - Level 3Android Application Development - Level 3
Android Application Development - Level 3
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2
 
Android Application Development - Level 1
Android Application Development - Level 1Android Application Development - Level 1
Android Application Development - Level 1
 
Managerial Skills Presentation - Elon Musk
Managerial Skills Presentation - Elon MuskManagerial Skills Presentation - Elon Musk
Managerial Skills Presentation - Elon Musk
 
Operations Management - Business Process Reengineering - Example
Operations Management - Business Process Reengineering - ExampleOperations Management - Business Process Reengineering - Example
Operations Management - Business Process Reengineering - Example
 
Lighting Design - Theory and Calculations
Lighting Design - Theory and CalculationsLighting Design - Theory and Calculations
Lighting Design - Theory and Calculations
 
Linear Control Hard-Disk Read/Write Controller Assignment
Linear Control Hard-Disk Read/Write Controller AssignmentLinear Control Hard-Disk Read/Write Controller Assignment
Linear Control Hard-Disk Read/Write Controller Assignment
 
Transformers and Induction Motors
Transformers and Induction MotorsTransformers and Induction Motors
Transformers and Induction Motors
 
Three phase balanced load circuits and synchronous generators
Three phase balanced load circuits and synchronous generatorsThree phase balanced load circuits and synchronous generators
Three phase balanced load circuits and synchronous generators
 
Circuit Breakers for Low Voltage Applications
Circuit Breakers for Low Voltage ApplicationsCircuit Breakers for Low Voltage Applications
Circuit Breakers for Low Voltage Applications
 

Último

Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowgargpaaro
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themeitharjee
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制vexqp
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfSayantanBiswas37
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...kumargunjan9515
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...HyderabadDolls
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...kumargunjan9515
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...kumargunjan9515
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...gragchanchal546
 

Último (20)

Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
 

Linux Commands - Cheat Sheet

  • 1. Linux Commands Cheat-sheet General Linux Commands ● To print today’s date: ​date ● To print hostname of the pc: ​hostname ● To perform basic mathematical calculation: ​expr [number 1 (+/-/(/)/*) number 2 (+/-/(/)/*) number 3 . . . ] ● To print string of characters: ​echo “Any string” ● To print name of the OS: ​uname ● To print details of the OS: ​uname -a ● To print version of the bash: ​bash --version ● Debugging a program: ​echo $? ● To print history of commands typed on the terminal: ​history ● To change hostname: ​hostnamectl set-hostname --static "name of your choice" File Management ● To see only files: ​ls ● To see lists even hidden files: ​ls -a ● To see details of the files: ​ls -l ● To see details of the normal and hidden files: ​ls -la ● To remove a file from current directory: ​r​m [filename in any format] ● To remove all files from current directory: ​rm -a ● To ​change directory, to move around to different folders: ​cd ./name of the directory ● To return directly to home directory: ​cd ● To return to previous folder: ​cd .. ● To make a directory: ​mkdir ● To remove a directory: ​rmdir ● To remove a directory and all of its contents recursively: rmdir -r [name of the directory] ● To change permissions of accessibility of file in the terminal: ​chmod +x ‘filename’ ● To download a folder: ​(wget or (curl -L)) http://udacity.github.io/ud595-shell/stuff.zip -o things.zip ● To show current directory: ​pwd ● To read a file from terminal: ​cat <name of the file in .txt format> ● To​ ​read a file one at a time from terminal:​ ​less [name of the file in .txt format] ● To copy a file: ​cp <name of the file to be copied> <new name of the file that will be copied> ● To move a file​: ​mv <name of the file> <directory file to be moved> ● To create a file: ​touch <filename.extension> ● To open a folder: ​nautilus /<destination of the directory> ● To create shortcut for commands: ​alias <user defined shortcut key>=‘<command>’ 1
  • 2. ● To see list of block devices i.e. internal and external hard drives:​ ​lsblk ● To burn .iso image in USB: ​sudo dd if=nameoffile.iso of=/dev/destinationdisk bs=1M ● To have access as root user: ​sudo passwd root​ followed by ​su - ● To open terminal text editor either vim or nano: ​vim​ (for vim) or ​nano​ (for nano) ● To check architecture if 32 or 64 bit:​ ​arch​ result x86_64 for 64 bit and i386 for 32 bit ● For loop syntax(to automate making of files or folders): for i in {1...x}; do mk or mkdir [file or folder name with extension] done Note: ● Tab completion makes life easier in order to complete the file or directory name. ● To use globbing commands, refer udacity last lecture of Linux Basic commands. Network command lines for Linux ● To display HTTP header(information about server and cookies): ​printf 'HEAD / HTTP/1.1rnHost: [host address]rnrn' | nc [host address] 80 ● ● To check IP address and details about mail handled of a website: ​host [domain name] ● To test network connection if it is established and speed of the connection:​ ​ping [domain name] ● To check how network is configured. Displays NAT ip addresses of ethernet connection and wifi and all other information: ​ifconfig ● To check all the information of network devices whether they are active or inactive: ​ifconfig -a ● To enable or disable one of the networking device:​ ​ifconfig [name of the device] [up to enable and down to disable] ● To display ethernet address of the current network card: ​arp ● To change​ ​ip address:​ ​ifconfig (name of the device) ip address of your desire ● To change subnet mask: ​ifconfig (name of the device) netmask 255.255.255.1 ● To change mac address: ​ifconfig (name of the device) hw ether 43:42:12. . ● To display more information about wifi:​ ​iwconfig ● To show only ip addresses of all the devices rather than just domains connected to machine: netstat -nr ● To display the usage of the network cards(to show how many packets in bytes are sent and transferred): ​netstat -i ● To look for active internet connections: ​netstat -ta ● To look for active internet connections: ​netstat -tan ● To find detailed information of a domain: ​whois (domain name) ● To perform detailed DNS lookup: ​dig (domain name) ● To perform DNS lookup: ​nfslookup (domain name) ● To trace no. of hops taken to access domain and lists all the routers the packets come across: traceroute (domain name) ● To show hostname:​ ​hostname 2
  • 3. ● To show ip addresses both ipv4 and and ipv6:​ ​hostname -I ● To capture all packets that are going to and from the pc:​ ​sudo tcpdump ● To capture only certain amount of packets: ​sudo tcpdump -c no. of packets to be captured(amount in numbers) ● To capture only certain amount of packets in hexadecimal or ascii format: ​sudo tcpdump (-XX for hexa or -A) for ASCII -c 5 Useful command-lines for C ● To compile a file in ​.c​ format:​ ​clang file.c ● Executable file ​a.out​ is generated. To run this file:​ ​./a.out ● To generate executable file with nicer name:​ ​clang -o file file.c​. ​Now,​ ​./file​ ​can be run. ● To use make command to generate executable file, MakeFile has to be present in the directory where .c​ ​files are stored. ● MakeFile source code: # compile the hello program with spaces instead of Tabs # the compiler to use CC = clang # compiler flags: # -g adds debugging information to the executable file # -Wall turns on most, but not all, compiler warnings CFLAGS = -ggdb3 -Wall -Werror -lm #files to link: LFLAGS = -lcs50 # require that an argument be provided at the command line for the target name: TARGET = $(target) all: ​$(TARGET) $(TARGET)​: ​$(TARGET)​.c ; ​$(CC)​ ​$(CFLAGS)​ -o ​$(TARGET)​ ​$(TARGET)​.c ​$(LFLAGS) ● To generate assembly code:​ ​clang -S filename.c Useful command-lines for Python ● To open python file, write the following code inside python script:​ ​#! /usr/bin/python3 ● To disable assertions:​ ​- o filename.py 3
  • 4. Useful command-lines for Java ● To compile a java file to generate .class executable file: ​javac filename.java ● To run java file on terminal or console:​ ​java filename 4